Ejemplo n.º 1
0
def test1():
    """demo """
    lcd = NJU6450(122, 32, GPIO())

    drv = HD44780(lcd, True)
    print(drv.width, drv.height)
    lcd = CharLCD(drv.width, drv.height, drv, 0, 0)
    lcd.init()
    lcd.write('First Line')
    lcd.write(' it is not', 0, 0)

    lcd.write('HD44780', 6, 3)
    lcd.flush()
    lcd.write('/* ', 12, 0)
    lcd.write('|*|', 12, 1)
    lcd.write(' */', 12, 2)
    lcd.flush()
Ejemplo n.º 2
0
 def test_initialize(self):
     drv = GPIO()
     NJU6450(122, 32, drv)
Ejemplo n.º 3
0
import RPi.GPIO
import sys
from PIL import Image
sys.path.append("../../")
from gfxlcd.driver.nju6450.gpio import GPIO
from gfxlcd.driver.nju6450.nju6450 import NJU6450
RPi.GPIO.setmode(RPi.GPIO.BCM)

lcd_nju = NJU6450(122, 32, GPIO())
lcd_nju.rotation = 90
lcd_nju.init()
lcd_nju.auto_flush = False

image_file = Image.open("assets/20x20.png")
lcd_nju.threshold = 0

lcd_nju.draw_image(10, 0, image_file)

lcd_nju.flush(True)
Ejemplo n.º 4
0
import RPi.GPIO
import sys
from PIL import Image
sys.path.append("../../")
from gfxlcd.driver.nju6450.gpio import GPIO
from gfxlcd.driver.nju6450.nju6450 import NJU6450
RPi.GPIO.setmode(RPi.GPIO.BCM)

lcd = NJU6450(122, 32, GPIO())
lcd.rotation = 0
lcd.init()
lcd.auto_flush = False

lcd.draw_text(25, 1, "Star Wars")
lcd.draw_text(30, 10, "Death Star")

image_file = Image.open("assets/20x20.png")
lcd.threshold = 0

lcd.draw_image(0, 0, image_file)

lcd.flush(True)
Ejemplo n.º 5
0
from gfxlcd.driver.nju6450.nju6450 import NJU6450


def hole(x, y):
    o.draw_pixel(x + 1, y)
    o.draw_pixel(x + 2, y)
    o.draw_pixel(x + 3, y)
    o.draw_pixel(x + 1, y + 4)
    o.draw_pixel(x + 2, y + 4)
    o.draw_pixel(x + 3, y + 4)
    o.draw_pixel(x, y + 1)
    o.draw_pixel(x + 4, y + 1)
    o.draw_pixel(x, y + 2)
    o.draw_pixel(x + 4, y + 2)
    o.draw_pixel(x, y + 3)
    o.draw_pixel(x + 4, y + 3)


drv = GPIO()
o = NJU6450(122, 32, drv)

o.init()
o.auto_flush = False
for _ in range(0, 50):
    hole(random.randint(2, 115), random.randint(2, 25))
hole(10, 10)
hole(15, 13)
hole(18, 23)
hole(40, 10)
o.flush(True)