UCUq #
The UCUq library purpose is to help for the prototyping of devices build around microcontrolers like the Raspberry Pi Pico (2) W or ESP32.
This page demonstrates the use of the UCUq library using some specifically made physical devices, so it will probably of no use for you, but you can find some online demonstrations of the UCUq library which relies on a ESP32 simulator ont this page.
Spécifications kits : https://github.com/epeios-q37/epeios/blob/master/other/brython/htdocs/ucuq_common.py#L120
Sans interface graphique #
Remise à zéro globale #
import ucuq
ucuq.setDevice("Golf")
ucuq.HD44780_I2C(ucuq.SoftI2C(6, 7), 4, 20).backlightOff()
ucuq.PWM(5, freq=50).setNS(0)
ucuq.WS2812(20, 8).fill([0,0,0]).write()
ucuq.SSD1306_I2C(128, 64, ucuq.I2C(8,9)).fill(0).show()
SSD1306 (OLED) #
PRENOM = """
"""
import ucuq, datetime
ucuq.setDevice("Golf")
oled = ucuq.SSD1306_I2C(128, 64, ucuq.I2C(8, 9))
def display(prenom, y):
if prenom:
oled\
.text("Bien le bonjour,", 0, y)\
.text(f"{prenom} !", 0, y+10)\
.text("Merci pour votre", 0, y+45)\
.text("participation !", 0, y+55)\
.show()
else:
oled\
.text("Test accompli le", 0, y+20)\
.text(f"{datetime.datetime.now().strftime("%d/%m/%Y %H:%M")}", 0, y+40)\
.show()
oled.fill(1).show()
ucuq.sleep(0.5)
oled.fill(0).show()
ucuq.sleep(0.5)
for i in range(64):
oled.fill(0)
display(ucuq.toASCII(PRENOM.strip()), 64-i)
Buzzer #
FREQ = 440
import ucuq
ucuq.setDevice("Golf")
buzzer = ucuq.PWM(5, freq=FREQ, u16 = 32000)
ucuq.sleep(1)
buzzer.setU16(0)
WS2812 (LEDs RGB) #
R = 0
G = 30
B = 0
COUNT = 8
import ucuq
ucuq.setDevice("Golf")
ucuq.WS2812(20, COUNT).fill([R,G,B]).write()
HD44780 (LCD) #
import datetime
LINE_1 = "Hello, World!"
LINE_2 = f"{datetime.datetime.now().strftime("%d/%m/%Y %H:%M")}"
import ucuq
ucuq.setDevice("Golf")
lcd = ucuq.HD44780_I2C(ucuq.SoftI2C(6, 7), 4, 20)
lcd\
.putString(LINE_1)\
.moveTo(0,1)\
.putString(LINE_2)\
Avec interface graphique #
Piano (buzzer, loudspeaker) #
WS2812 (RGB LEDs strip) #
HT16K33 (LED matrix) #
Tweak (tinkering with servos) #
Hangman game #
Simon’s game #
Servos #
Divers #
- Manque d’attrait NSI ;
- exemple de robot DIY 3D 3D :