Arduino Lab 2 0

3,317 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
3,317
On SlideShare
0
From Embeds
0
Number of Embeds
1,196
Actions
Shares
0
Downloads
51
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Arduino Lab 2 0

  1. 1. Arduino Lab 2.0 Interfacing Computer
  2. 2. Pre-requisite Arduino Lab 1.X Same material, installation Understanding of - setup, - loop, - output, - delay - digitalWrite,pinMode - High, Low
  3. 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. 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. 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. 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. 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. 8. Contact Me Have more ideas, queries, suggestions? Contact me at - Vinay Chaddha email : vinay@joy-n-freedom.com SMS : 9811074026

×