Hi everyone. Having just purchased and installed a black & white InkyPHAT, I’m coming across an unusual problem. None of the examples work with the colour attribute set, e.g.
python3 weather-phat.py --colour "black"
The screen fails to update. If I remove the colour flag, the examples function correctly. These might not seem a problem, but I have some 3rd party code that used a red InkyPHAT that I’m trying to adapt. However, there seems a dependency on the colour being set in the listing, which I have been trying to remove without success (a “” is not accepted):
colour="red" inky_display = InkyPHAT(colour) scale_size = 1 padding = 0 img = Image.new("P", (inky_display.WIDTH, inky_display.HEIGHT)) draw = ImageDraw.Draw(img) font = ImageFont.truetype(HankenGroteskMedium, 18) results = twitter.trends.place(_id = 23424975)
trends_string = ""
for location in results: for trend in location["trends"][0:5]: trends_string += " - %s" % trend["name"] + "\n" w, h = font.getsize("Hello, World!") x = 0 y = 0 draw.text((x, y), trends_string, inky_display.RED, font) inky_display.set_image(img) inky_display.show()
Can anyone help?