EasyManuals Logo

STMicroelectronics STM8 User Manual

STMicroelectronics STM8
126 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #112 background imageLoading...
Page #112 background image
Hardware Connection
Code Example
This code demonstrates how to interface BH1750 I2C digital light sensor with STM8S003K3. A LCD is
used to display the light sensor’s output in lux.
main.c
#include "STM8S.h"
#include "BH1750.h"
#include "lcd.h"
void clock_setup(void);
void GPIO_setup(void);
void I2C_setup(void);
void lcd_print(unsigned char x_pos, unsigned char y_pos, unsigned int value);
void main()
{
unsigned int LX = 0x0000;

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the STMicroelectronics STM8 and is the answer not in the manual?

STMicroelectronics STM8 Specifications

General IconGeneral
BrandSTMicroelectronics
ModelSTM8
CategoryMicrocontrollers
LanguageEnglish

Related product manuals