Example sketches for the new Arduino IDE for ESP8266

Moderator: igrr

User avatar
By woodat
#42442 Good stuff, I just got a supply of ESP12s, ST7735s, and RFID readers in to specifically wire to one another! I look forward to giving it a try
User avatar
By Rince
#44632 Hi,

just got my ST7735 from China.
Wiring up was a little bit different, because the display has got different pin-names.

Perhaps it is usefull:

http://www.ebay.de/itm/380809480973
on a NodeMCU V2

Wire it up this way:
Code: Select all1 - RST  => D2
2 - CS   => D0
3 - D/C  => D1
4 - DIN  => D7
5 - CLK  => D5
6 - VCC  => 3,3 V
7 - BL   => einstweilen auch an 3,3V
8 - GND  => GND



And I´ve got one question:

For the SD Card isn´t working with an ESP8266 and these sort of displays, sumotoy, would you be so kind to give a small code example, how to load a picture from SPIFF?

If manged to upload a few pictures via ESP8266FS.
(128x160, 8x8x8 Bit BMP)

But how on earth can I now watch them on the tiny display?



Thank you very much

Rince
User avatar
By vcch
#44915 There is apprently no easier way than

a) Converting the pic in a non compressed format using this tool
http://www.digole.com/tools/PicturetoC_ ... verter.php

b) using the following lines to display it line by line
This is an exemple using a 64x64, 3 color bytes file shown on a 128x128 screen, but using drawPixel instead of drawLine you can easily use a 128x128 picture.

spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, 8, 8)
disp = ucg.ili9163_18x128x128_hw_spi(1, 4,2)
node.setcpufreq(node.CPU160MHZ)
file.open("avcpic","r")
disp:begin(ucg.FONT_MODE_TRANSPARENT)
disp:clearScreen()

for x=0,127,2 do
-- tmr.wdclr()
for y=0,127,2 do
r=string.byte(file.read(1))
g=string.byte(file.read(1))
b=string.byte(file.read(1))
disp:setColor(r,g,b)
disp:drawHLine(x,y,2)
disp:drawHLine(x,y+1,2)
end
end
file.close()