Hi, So I have been working on a project involving the Micro Dot Phat and for the most part it is working well. I have it wired up with some buttons and have it set so buttons cycle through different displays: the time, IP address etc.
The issue I am having is I am trying to write the strings “D31110” and “D01115” to the display and when I press a button it alternates between them however only the last part shows up when I do this. I get the 1110 & 1115 parts but most of the first 2 LED matrices stay blank, sometimes only the last matrix lights up on each button press. I do not believe this is a wiring error because other parts of my app display the time on each matrix without any issue at all.
I did try write_char instead of write_string but that wrote a 4 instead of D on the first matrix and then the rest were just blank.
To top it all off I am a complete beginner in Python, PHP is my main language. Below is the snippet of code that deals with this part of the code, wasn’t sure of the best way to display code so hope this isn’t to bad.
alarm_obj = json.loads(alarms_string)
str_index = str(alarm_index)
time_str = alarm_obj['alarms'][str_index]['time'].replace(':','')
print("D"+alarm_obj['alarms'][str_index]['day']+time_str)
clear()
write_string("D"+alarm_obj['alarms'][str_index]['day']+time_str, kerning=False, offset_x=0)
#write_char("D")
#write_char(alarm_obj['alarms'][str_index]['day'])
#write_char('1')
#write_char('2')
#write_char('3')
#write_char('4')
show()
alarm_index += 1
if alarm_index > alarm_count:
alarm_index = 0
This here is the afore mentioned alarms_string variable:
{“alarms”: {“0” : {“day”:“0”, “time”:“11:15”, “sound”: “1”},“1” : {“day”:“3”, “time”:“11:10”, “sound”: “2”}}}
I can provide the entire python file if needed but I don’t imagine it is pretty or efficient. I am using GPIO Zero to handle the button inputs if that is important
Any help or assistance greatly appreciated