LCD (I2C) as an serial monitor.


goodday all,

i have question little project i'm making school.
i'm starting user, , ive got little background programming , building cerquit boards.

what project?:
i want put output of optical senor (i can read out on serial monitor) on lcd i2c chip.

this code ive got far.


code: [select]

#include <wire.h>
#include <liquidcrystal_i2c.h>
liquidcrystal_i2c lcd(0x27,16,2);

const int led = 13;
int tcrt;

void setup(){
   // set lcd's number of columns , rows:
 lcd.init();
 lcd.backlight();
 // initialize serial communications:
 serial.begin(9600);
 pinmode (led, output);
}

void loop(){
 tcrt = analogread(a0);
 serial.println(tcrt);
 analogwrite(led, tcrt/4);
 // when characters arrive on serial port...
 if (serial.available()) {
   // wait bit entire message arrive
   delay(100);
   // clear screen
   lcd.clear();
   // read available characters
   while (serial.available() > 0) {
     // display each character lcd
     lcd.write(serial.read());
   }
 }
}




i hope guys can me.

tnks,

jeffrey

hi jeffrey

first of all, please change quote tags code tags in post.  makes easier people read , understand code :)  code tags "#" button above row of smileys.

quote
i can read out on serial monitor


your program doing expect when output serial monitor, right?

quote
this code ive got far.


tell need.  code compile ok?  if so, happens when runs, , how different need?

all best

ray





Arduino Forum > Using Arduino > Programming Questions > LCD (I2C) as an serial monitor.


arduino

Comments

Popular posts from this blog

opencv3, tbb and rasp pi 2 - Raspberry Pi Forums

small ethernet problem - Raspberry Pi Forums

Multithumb configuration params not working? - Joomla! Forum - community, help and support