Release notes version cicciocb alpha 21: - Addition of IR decoder / encoder - Addition of TFT ILI9341 display - Addition of the function eval() ///////////////////////////////////////////////////////////////////////////////////////// Detailed informations: Addition of IR encoder (transmitter) ===================================== For the moment only the Sony and the NEC coding are supported for the transmission ir.send.init(pin) set the pin used for the IR transmission (led connected to GND via a resistor) example : ir.send.init(4) set the pin 4 ir.send.nec(code, nb_bits) send the code (string) composed of nb_bits bits example: ir.send.nec("4907d8c5", 32) ir.send.sony(code, nb_bits) send the code (string) composed of nb_bits bits example: ir.send.sony("910", 12) ------------------------------------------------------------------------------------ Addition of IR decoder (receiver) ===================================== Several coding are supported; refer to the library for more details The receiver can be a VS1838B or similar; this is very cheap (less than 2$ for 10!) An hacked IR receiver can be found into a TV, old video recorder, .... ir.recv.init(pin) set the pin used for the IR reception (IR receiver connected to the pin) example: ir.recv.init(5) set the pin 5 ir.recv.get() get the code received ; the code is a string in hex format example: let r = ir.recv.get() ->4907d8c5 ir.recv.full() get the code received + the format + nb_of bits this is useful to identify the kind of remote controller and the size of the message example: let r = ir.recv.full() -> 4907d8c5:NEC:32 ir.recv.dump() get the code received but verbose the message received on the serial port1 Probably more useful during debug example: let r = ir.recv.dump() ------------------------------------------------------------------------------------ Addition of TFT ILI9341 display ===================================== A TFT IL9341 SPI display can be connected to the ESP. This display has a resolution of 320x240 with 16bits color. The display requires at 5 pins : 3 for the SPI, one for the CS and another one for the D/C tft.init(CS_PIN, DC_PIN, rotation) init the display specifying the pin used for the CS, the DC and the screen rotation. If not specified, the rotation will default to 0 (portrait). Rotation can be 0 to 3 example: tft.init(16, 4, 3) set the pin 16 for the CS, the 4 for the DC and Landscape (3) tft.rgb(red, green, blue) return the 16bits convertion of the colors red, green and blue red, green and blue are in the range 0 - 255 example: let col = tft.rgb(255,0,0) tft.fill(color) -> fill the screen with the color; color can be obtained from tft.rgb() function example: tft.fill(tft.color(0,255,0)) -> fill the screen with green tft.line(x1,y1,x2,y2,col) trace a line from the point (x1,y1) to the point(x2,y2) with color 'col' example: tft.line(10,10,20,20,tft.rgb(255,0,0)) tft.rect(x,y,w,h,col) trace a rectangle from the point (x,y) with width 'w' and height 'h' with color 'col' example: tft.rect(10,10,20,20,tft.rgb(0,0,255)) tft.rect.fill(x,y,w,h,col) trace a filled rectangle from the point (x,y) with width 'w' and height 'h' with color 'col' example: tft.rect.fill(10,10,20,20,tft.rgb(0,0,255)) tft.rect.round(x,y,w,h,rad,col) trace a rounded rectangle from the point (x,y) with width 'w' and height 'h', radius 'rad' and with color 'col' example: tft.rect.round(10,10,100,100,5,tft.rgb(0,0,255)) tft.rect.round.fill(x,y,w,h,rad,col) trace a rounded filled rectangle from the point (x,y) with width 'w' and height 'h', radius 'rad' and with color 'col' example: tft.rect.round.fill(10,10,100,100,5,tft.rgb(0,0,255)) tft.circle(x,y,rad,col) trace a circle with center in (x,y), radius 'rad' and color 'col' example: tft.circle(160,120,50,65535) tft.circle.fill(x,y,rad,col) trace a filled circle with center in (x,y), radius 'rad' and color 'col' example: tft.circle.fill(160,120,50,65535) tft.text.color(col) define the color used for the text printed tft.text.cursor(x,y) define the position of the cursor where the text will be printed tft.text.size(size) define the size of the text printed; can be from 1 to 8 (the font is always the same) tft.print(txt) print the text on the screen using the color, position and size defined with the previous commands tft.println(txt) same as tft.print() but after the command goes to the next line example: tft.text.color(tft.rgb(255,255,0)) tft.text.cursor(0,50) tft.text.size(2) tft.print("This is ") tft.println("print ") tft.println("second line") tft.println("third line") tft.demo() -> runs a demo taken directly from the arduino demos. Useful at the beginning to check the display.