P018 I2C 16x2 LCD Arduino Code December 25, 2013 08:52PM |
Registered: 10 years ago Posts: 6 |
Re: P018 I2C 16x2 LCD Arduino Code December 27, 2013 08:40PM |
Registered: 10 years ago Posts: 6 |
#include "Wire.h" void setup() { Wire.begin(); Wire.beginTransmission(0x38); Wire.write(1); Wire.write(0); //Red Wire.write(10); //Green Wire.write(0); //Blue Wire.endTransmission(); }
#include "Wire.h" void setup() { Wire.begin(); Wire.beginTransmission(0x38); Wire.write(3); // Print A Wire.write(65); Wire.write(13); Wire.endTransmission(); }
Re: P018 I2C 16x2 LCD Arduino Code December 28, 2013 05:58PM |
Admin Registered: 11 years ago Posts: 351 |
// Example of how to use the LCD library with the P018. // P017 - serial LCD controller IC // P018 - I2C controller IC #include <Wire.h> #include <p018.h> // defines LCD // These are the A pins // A5 = SCL // A4 = SDA // constructor defines pins and the address of the device // in this case 'p' LCD disp(0x38); void setup() { } void loop() { // example of custom charatcers char custom0[]={4,10,21,4,4,4,4,4}; // up arrow char custom1[]={0,0,1,2,20,8,0,0}; // tick // example of defining above custom characters disp.lcd_defcust(0,custom0); disp.lcd_defcust(1,custom1); disp.lcd_cls(); // clear display disp.lcd_print("First Line"); disp.lcd_rowcol(1,0); disp.lcd_print("Second Line:"); disp.lcd_print(77); // prints a number disp.lcd_printcust(1); // print a tick delay(2000); // now go through some back light colours while(1) { disp.lcd_cls(); disp.lcd_bl(10,0,0); disp.lcd_print("Red"); delay(1500); disp.lcd_cls(); disp.lcd_bl(0,10,0); disp.lcd_print("Green"); delay(1500); disp.lcd_cls(); disp.lcd_bl(0,0,10); disp.lcd_print("Blue"); delay(1500); } }
Re: P018 I2C 16x2 LCD Arduino Code December 28, 2013 06:50PM |
Registered: 10 years ago Posts: 6 |
Re: P018 I2C 16x2 LCD Arduino Code December 28, 2013 09:47PM |
Registered: 10 years ago Posts: 6 |
Re: P018 I2C 16x2 LCD Arduino Code December 29, 2013 10:49AM |
Admin Registered: 11 years ago Posts: 351 |
Re: P018 I2C 16x2 LCD Arduino Code December 29, 2013 11:20AM |
Registered: 10 years ago Posts: 6 |
Re: P018 I2C 16x2 LCD Arduino Code December 29, 2013 02:21PM |
Admin Registered: 11 years ago Posts: 351 |