/* Sketch was generated by motoblockly
Website: http://www.motoblockly.com
Author: www.motoduino.com
Date: Sat Dec 09 2023 20:22:37 GMT+0800
*/
#include <U8g2lib.h>
U8G2_SSD1306_128X64_NONAME_F_HW_I2C u8g2(U8G2_R0, /* reset=*/ U8X8_PIN_NONE);
int light=0;
void setup()
{
pinMode(14, INPUT);
u8g2.begin();
u8g2.setFont(u8g2_font_ncenB10_tr);
u8g2.setFont(u8g2_font_ncenB08_tr);
u8g2.enableUTF8Print();
u8g2.setFont(u8g2_font_unifont_t_chinese1);
}
void loop()
{
u8g2.clear();
light = analogRead(14);
u8g2.setCursor(0,10);
u8g2.print(String("光值:") + String(light));
u8g2.sendBuffer();
}