diff options
| author | D Delmar Davis <don@suspectcevices.com> | 2025-01-31 22:19:15 -0800 |
|---|---|---|
| committer | D Delmar Davis <don@suspectcevices.com> | 2025-01-31 22:19:15 -0800 |
| commit | a15d74ee642721d44329190eec655a66eac460ad (patch) | |
| tree | 3c25bbffbdd81f8fb458c800c3a77c14b1d0d54f /bin | |
| parent | 6fa9d96f6ef662228765b9a4583e0251968e49ff (diff) | |
wtf over
Diffstat (limited to 'bin')
| -rwxr-xr-x[-rw-r--r--] | bin/analogclock.py | 0 | ||||
| -rwxr-xr-x | bin/lcdtemp.py | 61 | ||||
| -rwxr-xr-x[-rw-r--r--] | bin/test.py | 0 | ||||
| -rwxr-xr-x[-rw-r--r--] | bin/test2.py | 0 |
4 files changed, 61 insertions, 0 deletions
diff --git a/bin/analogclock.py b/bin/analogclock.py index 5b99e39..5b99e39 100644..100755 --- a/bin/analogclock.py +++ b/bin/analogclock.py diff --git a/bin/lcdtemp.py b/bin/lcdtemp.py new file mode 100755 index 0000000..5d9d271 --- /dev/null +++ b/bin/lcdtemp.py @@ -0,0 +1,61 @@ +#!/usr/bin/python3 +# SPDX-FileCopyrightText: 2021 ladyada for Adafruit Industries +# SPDX-License-Identifier: MIT + +"""Simple test for 16x2 character lcd connected to an MCP23008 I2C LCD backpack.""" +import time +import board +import adafruit_character_lcd.character_lcd_i2c as character_lcd + +# Modify this if you have a different sized Character LCD +lcd_columns = 16 +lcd_rows = 2 + +# Initialise I2C bus. +i2c = board.I2C() # uses board.SCL and board.SDA +# i2c = board.STEMMA_I2C() # For using the built-in STEMMA QT connector on a microcontroller + +# Initialise the lcd class +lcd = character_lcd.Character_LCD_I2C(i2c, lcd_columns, lcd_rows) + +# Turn backlight on +lcd.backlight = True +# Print a two line message +lcd.message = "Hello\nCircuitPython" +# Wait 5s +time.sleep(5) +lcd.clear() +# Print two line message right to left +lcd.text_direction = lcd.RIGHT_TO_LEFT +lcd.message = "Hello\nCircuitPython" +# Wait 5s +time.sleep(5) +# Return text direction to left to right +lcd.text_direction = lcd.LEFT_TO_RIGHT +# Display cursor +lcd.clear() +lcd.cursor = True +lcd.message = "Cursor! " +# Wait 5s +time.sleep(5) +# Display blinking cursor +lcd.clear() +lcd.blink = True +lcd.message = "Blinky Cursor!" +# Wait 5s +time.sleep(5) +lcd.blink = False +lcd.clear() +# Create message to scroll +scroll_msg = "<-- Scroll" +lcd.message = scroll_msg +# Scroll message to the left +for i in range(len(scroll_msg)): + time.sleep(0.5) + lcd.move_left() +lcd.clear() +lcd.message = "Going to sleep\nCya later!" +time.sleep(5) +# Turn backlight off +lcd.backlight = False +time.sleep(2) diff --git a/bin/test.py b/bin/test.py index af2e0d7..af2e0d7 100644..100755 --- a/bin/test.py +++ b/bin/test.py diff --git a/bin/test2.py b/bin/test2.py index ee6ea5b..ee6ea5b 100644..100755 --- a/bin/test2.py +++ b/bin/test2.py |
