Asturias
Posts: 11
Joined: Tue Jan 12, 2016 7:52 pm
Location: France

Testing lcd.ILI9341 -SPI Hardware

Thu May 05, 2016 5:41 pm

Hi,

Loboris lcd example works perfectly. I have written something simpler :

Code: Select all

--  lcd.ILI9341 -SPI Hardware

spiOk =spi.setup(2,{mode=3, cs=12, speed=50000})
lcdOk = lcd.init(2,14,3,lcd.LANDSCAPE)
tmr.delayms(1000)
print(spiOk)
gpio.mode(17, gpio.OUTPUT)
-- strtime = rtc.getstrf("%d/%m/%Y")
function header(tx)
   tmr.wdclr()
    maxx, maxy = lcd.getscreensize()
   lcd.clear()
   lcd.setcolor(lcd.CYAN)
   if maxx < 240 then
      lcd.setfont(lcd.FONT_SMALL)
   else
      lcd.setfont(lcd.FONT_DEJAVU12)
   end
   miny = lcd.getfontheight() + 5
   lcd.rect(0,0,maxx-1,miny-1,lcd.OLIVE,{8,16,8})
   lcd.settransp(1)
   lcd.write(lcd.CENTER,2,tx)
   lcd.settransp(0)
end


lcd.clear()
header('SETUP')
lcd.setfont(lcd.FONT_DEJAVU24)
lcd.write(0,30,'TICKS :')

tmr.start(0,2000,
function()
 lcd.setcolor(lcd.BLUE)
lcd.write(120,30,tmr.tick())
end)

tmr.start(1,1000,
function()
tmr.wdclr()
gpio.toggle(17)
end)


My problem is :
Sometimes the display is ok and a few minutes later it disapears.
What am I doing wrong ?
Thank you
Salutations

Asturias
Posts: 11
Joined: Tue Jan 12, 2016 7:52 pm
Location: France

Re: Testing lcd.ILI9341 -SPI Hardware

Mon May 09, 2016 4:02 pm

Hi,

I have found the culprit ... lcd RST was floating ;)


Return to “WiFiMCU”

Who is online

Users browsing this forum: No registered users and 1 guest