Compromises were made, no choice really with the lack of info on how to get things done. It’s claimed you can scroll text on it, but I have yet to even find a hint as to how to do that. I did have a go at modifying an example for the Galactic Unicorn but could not get it to work. That’s mostly due to my lack of skill in Micro Python. Still IMHO it shouldn’t be this hard?
I have my panels the way I wanted them, and can display the minimal basic info I want to.
Time
Temperature
Humidity
Pressure
It still thinks they are 128 x 32 so I had to compensate in my code to get things where I wanted on screen.
import time
import machine
from interstate75 import Interstate75
from interstate75 import Interstate75, SWITCH_A, SWITCH_B
i75 = Interstate75(display=Interstate75.DISPLAY_INTERSTATE75_128X32)
graphics = i75.display
graphics.set_font("bitmap8")
#graphics.set_font("8x12")
#graphics.set_font("10x14")
t_color = graphics.create_pen(0,0,0)
h_color = graphics.create_pen(0,0,0)
p_color = graphics.create_pen(0,0,0)
black = graphics.create_pen(0,0,0)
red = graphics.create_pen(255,0,0)
green = graphics.create_pen(0,255,0)
blue = graphics.create_pen(0,0,255)
yellow = graphics.create_pen(255,255,0)
orange = graphics.create_pen(255,140,0)
white = graphics.create_pen(255,255,255)
graphics.set_pen(black)
graphics.clear()
i75.update(graphics)
i75.set_led(0, 0 ,0)
from breakout_bme280 import BreakoutBME280
from pimoroni_i2c import PimoroniI2C
i2c = PimoroniI2C(sda=(20), scl=(21))
bme = BreakoutBME280(i2c, 0x76)
temperature, pressure, humidity = bme.read()
from breakout_rtc import BreakoutRTC
from machine import RTC
RV3028 = BreakoutRTC(i2c)
rtc = BreakoutRTC(i2c)
if rtc.is_12_hour:
rtc.set_24_hour()
RV3028.update_time()
hour = rtc.get_hours()
minute = rtc.get_minutes()
month = rtc.get_month()
date = rtc.get_date()
if rtc.read_periodic_update_interrupt_flag():
rtc.clear_periodic_update_interrupt_flag()
if rtc.update_time():
rtc_date = rtc.string_date()
rtc_time = rtc.string_time()
temperature, pressure, humidity = bme.read()
time.sleep (0.5)
start_time = time.time()
while True:
graphics.set_pen(black)
graphics.clear()
i75.update(graphics)
time_elapsed = time.time() - start_time
RV3028.update_time()
hour = rtc.get_hours()
minute = rtc.get_minutes()
month = rtc.get_month()
date = rtc.get_date()
if rtc.read_periodic_update_interrupt_flag():
rtc.clear_periodic_update_interrupt_flag()
if rtc.update_time():
rtc_date = rtc.string_date()
rtc_time = rtc.string_time()
#year, month, day, wd, hour, minute, second, _ = rtc.datetime()
graphics.set_pen(white)
if hour == 0:
graphics.text(f"{12}:{minute:02}AM", 1, 1, scale=2)
elif 0 <= hour < 10:
graphics.text(f"{hour:1}:{minute:02}AM", 7, 1, scale=2)
elif 10 <= hour < 12:
graphics.text(f"{hour:2}:{minute:02}AM", 1, 1, scale=2)
elif hour == 12:
graphics.text(f"{hour:2}:{minute:02}PM", 1, 1, scale=2)
elif hour > 12:
hour = hour - 12
if hour < 10:
graphics.text(f"{hour:1}:{minute:02}PM", 7, 1, scale=2)
elif 10 <= hour < 12:
graphics.text(f"{hour:2}:{minute:02}PM", 1, 1, scale=2)
elif hour == 12:
graphics.text(f"{hour:2}:{minute:02}AM", 1, 1, scale=2)
temperature, pressure, humidity = bme.read()
temperature = round(temperature)
if temperature < -10:
t_color = white
elif -10 <= temperature <= 0:
t_color = blue
elif 0 < temperature <= 12:
t_color = yellow
elif 12 < temperature <= 16:
t_color = green
elif 16 < temperature <= 24:
t_color = green
elif 24 < temperature <= 27:
t_color = orange
elif temperature > 27:
t_color = red
graphics.set_pen(t_color)
graphics.text("{:0.0f}°C" .format(temperature), 15, 17, scale=2)
humidity = round(humidity)
if humidity < 30:
h_color = red
elif 30 <= humidity <= 60:
h_color = green
elif 60 < humidity < 80:
h_color = yellow
elif humidity >= 80:
h_color = orange
graphics.set_pen(h_color)
graphics.text("{:0.0f}%".format(humidity), 79, 1, scale=2)
pressuremb = pressure / 100
pressuremb = round(pressuremb)
if pressuremb < 982:
p_color = red
elif 982 <= pressuremb < 1004:
p_color = yellow
elif 1004 <= pressuremb < 1026:
p_color = green
elif 1026 <= pressuremb < 1048:
p_color = blue
elif pressuremb >= 1048:
p_color = orange
graphics.set_pen(p_color)
graphics.text("{:0.0f}mb" .format(pressuremb), 65, 17, scale=2)
i75.update(graphics)
time.sleep (30)