示例#1
0
def test():
    rhs = ssd.width - 1
    ssd.line(rhs - 80, 0, rhs, 80, 1)
    square_side = 40
    ssd.fill_rect(rhs - square_side, 0, square_side, square_side, 1)

    wri = Writer(ssd, freesans20)
    Writer.set_textpos(ssd, 0, 0)  # verbose = False to suppress console output
    wri.printstring('Sunday\n')
    wri.printstring('12 Aug 2018\n')
    wri.printstring('10.30am')

    wri = Writer(ssd, arial_50)
    Writer.set_textpos(ssd, 0, 120)
    wri.printstring('10:30')
    ssd.show()
示例#2
0
def test():
    pcs = machine.Pin('Y5', machine.Pin.OUT_PP, value=0)  # Active high
    spi = machine.SPI(2)
    ssd = SSD(spi, pcs)
    rhs = ssd.width - 1
    ssd.line(rhs - 80, 0, rhs, 80, 1)
    square_side = 40
    ssd.fill_rect(rhs - square_side, 0, square_side, square_side, 1)

    wri = Writer(ssd, freesans20)
    Writer.set_textpos(ssd, 0, 0)  # verbose = False to suppress console output
    wri.printstring('Sunday\n')
    wri.printstring('12 Aug 2018\n')
    wri.printstring('10.30am')

    wri = Writer(ssd, arial_50)
    Writer.set_textpos(ssd, 0, 120)
    wri.printstring('10:30')
    ssd.show()