LCD_CMD ) def clear (self): # Clear the display self. It’s pretty straightforward, here’s the complete code.ĩ0% of this is not mine - I just adjusted some function calls! from machine import Pin, Timer import utime # Almost entirely copied from micropython-lcd by wjdp # class LCD ( object ): # Pinout, change within or outside class for your use case PINS = # Pin names, don't change PIN_NAMES = # Dict of pins pins = # Timing constants E_PULSE = 1 E_DELAY = 1 def init (self): # Initialise pins for pin, pin_name in zip ( self. It won’t work on the Pi Pico out of the box, but it took me all of fifteen minutes to adapt it to the Pi Pico. Luckily, wjdp has written a perfectly functional generic MicroPython library for the HD44780 and the PyBoard, called micropython-lcd. There is what looks like a decent C library for the HD44780 and the Pi Pico, called picoLCD, but I wanted to try out MicroPython, which was completely new to me. Mine was a lovely Adafruit one via Pimoroni thanks for taking all my money Pimoroni! Suckers, what they don’t know is that I’m going to keep spending my money there until I’m bankrupt. I got my Raspberry Pi Pico today (it’s now part of our mandatory lockdown ration, right?), and immediately tried to do something vaguely undocumnented with it - namely, run one of those generic HD44780 LCD displays.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |