CircuitPython for STM32
แนะนำการใช้งาน CircuitPython สำหรับบอร์ดไมโครคอนโทรลเลอร์ที่ใช้ ARM Cortex M4F ตระกูล STM32F4 เช่น บอร์ด STM32F411CE Black Pill
วิธีการติดตั้ง CircuitPython สำหรับ STM32




Last updated
แนะนำการใช้งาน CircuitPython สำหรับบอร์ดไมโครคอนโทรลเลอร์ที่ใช้ ARM Cortex M4F ตระกูล STM32F4 เช่น บอร์ด STM32F411CE Black Pill




Last updated
import gc
text = 'Memory Info\n- Free: {} bytes\n- Allocated: {} bytes'
values = (gc.mem_free(), gc.mem_alloc())
print( text.format(*values) )Memory Info
- Free: 71520 bytes
- Allocated: 2208 bytesimport time
import digitalio
import board
from microcontroller import pin
## use onboard LED (blue) / PC13
## 1) use board LED pin or
#led = digitalio.DigitalInOut(board.LED)
## 2) use microcontroller pin
led = digitalio.DigitalInOut(pin.PC13)
## output direction for the LED pin
led.direction = digitalio.Direction.OUTPUT
try:
while True:
led.value = not led.value # toggle output
time.sleep(0.1)
except KeyboardInterrupt:
pass
led.deinit() # release the LEd pin
print('Done')