Library NewSoftSerial and use USB Serial


hi, have scott edwards lcd backpack. have had use newsoftserial library se backpack uses inverted signals.

i new arduino , cant work out how send data , throw via usb serial @ same time.

the programme using below , can see has declared pin 2 , 3 rx , tx. why cant send data serial monitor?

can tell me how use serial monitor via usb while using programme.

thanks
simon
code: [select]

#include <newsoftserial.h>

#define rxpin 2          // unused, necessary create 'lcd' object
#define txpin 3

#define inverted true    // impossible standard software serial library

newsoftserial lcd(rxpin, txpin,inverted);  // set new inverted serial port on pins 2 , 3

void setup() {

 pinmode(rxpin, input);    // define pin modes tx, rx:
 pinmode(txpin, output);
 lcd.begin(9600);

 delay(100);               // necessary wait after powering up

 lcd.print(254,byte);      // 254 command prefix
 lcd.print(1,byte);        // 1 display clear command
 delay(10);                // command takes long time

 lcd.print(254,byte);      // unknown reasons is
 lcd.print(1,byte);        // necessary repeat 2x
 delay(10);

 lcd.print(254,byte);      // 254 command prefix
 lcd.print(2 ,byte);       // 2 home command
 delay(10);

 lcd.print("hello, world!");
}

void loop() {
 lcd.print(254,byte);
 lcd.print(192,byte);        // set cursor column 0, line 1

 lcd.print(millis()/1000);   // print number of seconds since reset:

}

quote
scott edwards lcd backpack

do have url datasheet?

to print serial monitor of arduino ide 1 can use :

serial.begin(9600);
serial.println("hello world");

see: - http://arduino.cc/en/reference/serial details


Arduino Forum > Forum 2005-2010 (read only) > Software > Syntax & Programs > Library NewSoftSerial and use USB Serial


arduino

Comments

Popular posts from this blog

CAN'T INSTALL MAMBELFISH 1.5 FROM DIRECTORY - Joomla! Forum - community, help and support

error: expected initializer before 'void'

CPU load monitoring using GPIO and leds - Raspberry Pi Forums