RT1062 LCD not working

I previously had a problem with the RT 1062 LCD and resolved it, but the github you mentioned is not opening and the LCD does not work even if I run the IDE4.1.5 LCD example.

The examples were rearranged, you can still find it on github, but you should have the latest working examples in the IDE if you let it update the resources. Can you post the script that’s not working ?

I’m using H7 Plus to make a simple defect detection code
I purchased RT1062 because the H7 Plus model was not supplied, and when I connected, IDE and firmware were updated,
H7 Plus, which was previously used, is also updated with firmware, and the existing code does not run.
Because of import lcd,pyb, it is assumed that neither related code works.
If the firmware version doesn’t fit, can you lower the firmware version?
And can you check the firmware version of the current product?

import time, sensor, image,lcd, pyb
from image import SEARCH_EX, SEARCH_DS
sensor.reset()
#sensor.set_vflip(True)
sensor.set_gainceiling(16)
sensor.set_framesize(sensor.QQVGA)
sensor.set_pixformat(sensor.GRAYSCALE)
led_R = pyb.LED(1)
led_G = pyb.LED(2)
led_B = pyb.LED(3)
led_R.off()
led_G.off()
led_B.off()

lcd.init()
from pyb import Pin
pin1 = Pin('P1', Pin.IN, Pin.PULL_DOWN) #차종1
pin4 = Pin('P4', Pin.IN, Pin.PULL_DOWN) #차종2
pin5 = Pin('P5', Pin.OUT, Pin.PULL_DOWN) #OK
pin6 = Pin('P6', Pin.OUT, Pin.PULL_DOWN) #LCD 제어
pin9 = Pin('P9', Pin.OUT, Pin.PULL_DOWN) #NG

template1 = image.Image("/guiderod_bush11.bmp") #차종1 마스터 사진
template1.to_grayscale()
template2 = image.Image("/guiderod_bush12.bmp") #차종2 마스터 사진
template2.to_grayscale()

clock = time.clock()

Count_I = 0
Count_first_ok = 0
Count_second_ok = 0
Count_first_ng = 0
Count_second_ng = 0
shutter_times = []
pin6.value(1) #LCD Back Light On

while(True):
   img=sensor.snapshot()
   lcd.display(img)
   value1=pin1.value()
   value4=pin4.value()
   if value1==1: #차종1
    Count_I += 1
    if Count_I <= 9:
        r1 = img.find_template(template1, 0.65, roi = (40,66,80,52), step = 1, search=SEARCH_EX)
        if r1:
            img.draw_rectangle(r1)
            print('first OK')
            Count_first_ok += 1
            img.draw_string(0,0,"OK",color=(255,255,255),scale=2,mono_space=False)
            lcd.display(img)
        else:
            print('first NG')
            Count_first_ng += 1
            img.draw_string(0,0,"NG",color=(255,255,255),scale=2,mono_space=False)            
            lcd.display(img)
        img.draw_string(110,0, "{}".format(Count_I), color=(255, 255, 255), scale=2, mono_space=False)
        lcd.display(img)

    else:
        if Count_first_ok > Count_first_ng:
            led_G.on()
            print('total OK')
            pin5.value(1)
            img.draw_string(0,0,"TOTAL OK",color=(255,255,255),scale=2,mono_space=False)
            lcd.display(img)

        else:
            led_R.on()
            print('total ng')
            pin9.value(1)
            img.draw_string(0,0,"TOTAL NG",color=(255,255,255),scale=2,mono_space=False)
            lcd.display(img)

   elif value4==1: #차종2
    Count_I += 1
    if Count_I <= 9:
        r2 = img.find_template(template2, 0.65, roi = (40,66,80,52), step = 1, search=SEARCH_EX)
        if r2:
            img.draw_rectangle(r2)
            print('second OK')
            Count_second_ok += 1
            img.draw_string(0,0,"OK",color=(255,255,255),scale=2,mono_space=False)
            lcd.display(img)

        else:
            print('second NG')
            Count_second_ng += 1
            img.draw_string(0,0,"NG",color=(255,255,255),scale=2,mono_space=False)
            lcd.display(img)
        img.draw_string(110,0, "{}".format(Count_I), color=(255, 255, 255), scale=2, mono_space=False)
        lcd.display(img)

    else:
        if Count_second_ok > Count_second_ng:
            led_G.on()
            print('total OK')
            pin5.value(1)
            img.draw_string(0,0,"TOTAL OK",color=(255,255,255),scale=2,mono_space=False)
            lcd.display(img)
        else:
            led_R.on()
            print('total ng')
            pin9.value(1)
            img.draw_string(0,0,"TOTAL NG",color=(255,255,255),scale=2,mono_space=False)
            lcd.display(img)

   else:
     img.draw_string(0,0," NO INPUT",color=(255,255,255),scale=2,mono_space=False)
     print('no input')
     lcd.display(img)
     pin5.value(0)
     pin9.value(0)
     Count_I = 0
     Count_ok = 0
     Count_ng = 0
     Count_first_ok = 0
     Count_second_ok = 0
     Count_first_ng = 0
     Count_second_ng = 0
     led_R.off()
     led_G.off()
     led_B.off()

Hi, you need to update your code. The API for LCD control was changed. Please see the LCD shield example and update your code.

For H7 Plus, the LCD shield works fine by syntax conversion to lcd.display(img) → lcd.write(img). However, for RT1062, the LCD does not work with the code below

import sensor
import display

sensor.reset() # Initialize the camera sensor.
sensor.set_pixformat(sensor.RGB565) # or sensor.GRAYSCALE
sensor.set_framesize(sensor.QQVGA2) # Special 128x160 framesize for LCD Shield.

lcd = display.SPIDisplay()

while True:
lcd.write(sensor.snapshot()) # Take a picture and display the image.

Hi, there’s a risk of shooting the shield against the board on the RT1062. The spacers included in the headers baggie are to reduce that.

Please check that the shield is not shorting against any of the header pins.

The same code definitely works with the current released firmware. So, if the system is not working it’s either a shorting issue or bad soldering.