MicroPython光感測器模組
from ssd1306 import initialize, clear_oled
from ssd1306_text import add_text
from microbit import *
initialize()
clear_oled()
add_text(0, 0, 'NKUST')
add_text(0, 1, 'Richard Ho')
while True:
add_text(0, 2, 'Temp.:{} C'.format(temperature()))
add_text(0, 3, 'Light:{:>4d}'.format(pin1.read_analog()))
sleep(2000)
Last updated