QUERY · ISSUE
display.get_pixel unexpected output on microbit
port-nrf
hi there,
The display.get_pixel method with a full bright pixel on the a microbit returns a "255" instead of a "9".
This is not conform the docs on internet. The method should have returned a "9" for a full pixel.
It seems the display.get_pixel method returns a value between 0-255 instead of 0-9.
from microbit import *
display.set_pixel(0, 0, 9)
display.scroll(str(display.get_pixel(0, 0)))
CANDIDATE · ISSUE
lcd160cr.py get_pixel() and set_pixel() methods are not mutually compatible
The following produces a surprising (to me, at least) colour change:
import lcd160cr
lcd = lcd160cr.LCD160CR('X')
lcd.set_orient(lcd160cr.PORTRAIT)
lcd.set_pos(0, 0)
lcd.set_text_color(lcd.rgb(255, 0, 0), lcd.rgb(0, 0, 0))
lcd.set_font(1)
lcd.write('Hello MicroPython!')
print('touch:', lcd.get_touch())
for y in range(10):
for x in range(60):
lcd.set_pixel(x, y, lcd.get_pixel(x, y))