aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-x[-rw-r--r--]bin/analogclock.py0
-rwxr-xr-xbin/lcdtemp.py61
-rwxr-xr-x[-rw-r--r--]bin/test.py0
-rwxr-xr-x[-rw-r--r--]bin/test2.py0
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