start:arduino:esp32:smart:micropython
Différences
Ci-dessous, les différences entre deux révisions de la page.
Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédente | ||
start:arduino:esp32:smart:micropython [2025/02/26 17:50] – [Test ouverture porte servoMoteur avec code -.- sur BP1] admin | start:arduino:esp32:smart:micropython [2025/02/26 17:53] (Version actuelle) – [Test LCD] admin | ||
---|---|---|---|
Ligne 542: | Ligne 542: | ||
==== Test connection Wifi ==== | ==== Test connection Wifi ==== | ||
- | <code python exemple016> | + | <code python exemple016.py> |
import time | import time | ||
import network #Import network module | import network #Import network module | ||
Ligne 571: | Ligne 571: | ||
sta_if.disconnect() | sta_if.disconnect() | ||
+ | </ | ||
+ | |||
+ | ==== Test LCD ==== | ||
+ | |||
+ | <code python exemple017.py> | ||
+ | from time import sleep_ms, ticks_ms | ||
+ | from machine import I2C, Pin | ||
+ | from i2c_lcd import I2cLcd | ||
+ | |||
+ | DEFAULT_I2C_ADDR = 0x27 | ||
+ | |||
+ | i2c = I2C(scl=Pin(22), | ||
+ | lcd = I2cLcd(i2c, DEFAULT_I2C_ADDR, | ||
+ | |||
+ | lcd.move_to(1, | ||
+ | lcd.putstr(' | ||
+ | lcd.move_to(1, | ||
+ | lcd.putstr(' | ||
+ | |||
+ | # The following line of code should be tested | ||
+ | # using the REPL: | ||
+ | |||
+ | # 1. To print a string to the LCD: | ||
+ | # lcd.putstr(' | ||
+ | # 2. To clear the display: | ||
+ | # | ||
+ | # 3. To control the cursor position: | ||
+ | # lcd.move_to(2, | ||
+ | # 4. To show the cursor: | ||
+ | # lcd.show_cursor() | ||
+ | # 5. To hide the cursor: | ||
+ | # | ||
+ | # 6. To set the cursor to blink: | ||
+ | # | ||
+ | # 7. To stop the cursor on blinking: | ||
+ | # | ||
+ | # 8. To hide the currently displayed character: | ||
+ | # | ||
+ | # 9. To show the currently hidden character: | ||
+ | # | ||
+ | # 10. To turn off the backlight: | ||
+ | # | ||
+ | # 11. To turn ON the backlight: | ||
+ | # | ||
+ | # 12. To print a single character: | ||
+ | # | ||
+ | # 13. To print a custom character: | ||
+ | #happy_face = bytearray([0x00, | ||
+ | # | ||
+ | # | ||
</ | </ |
/home/chanteri/www/fablab37110/data/attic/start/arduino/esp32/smart/micropython.1740588623.txt.gz · Dernière modification : 2025/02/26 17:50 de admin