3. Serial Interface Fundas
Computer can send/received data
serially thru RS232 port.
Popular devices on RS232 port are
Mouse, Modem, printer, another
computer (devices are not very popular now a days)
Hyperterminal in windows is the
popular prodgram to send/received
data. Need to define bit rate and serial
port number.
4. Setup
Serial.begin is a single line command to
define that serial port is used. The
parameter in paranthesis is the baud
rate.
Remember to set same baud rate in
computer
void setup()
{
Serial.begin(9600);
}
5. Loop
Serial.println command will send the
data on serial port of arduino. The data is
defined as parameter.
void loop()
{
Serial.println("Hello World");
delay(1000);
}
This just send string Hello World once
every second.
6. Logic
In setup, define that serial port is
required, set the baud rate.
In loop, send some data to serial port.
Data is given within quotes.
Delay is given before data is send again
7. Variations
Serial.print - just send the data
Serial.println - send data and then add
line feed and move to beginneing of line.
To print value of variable use
Serial.print(Variable,DEC).
8. Contact Me
Have more ideas, queries, suggestions?
Contact me at -
Vinay Chaddha
email : vinay@joy-n-freedom.com
SMS : 9811074026