Arduino Serial: Serial Communication by Arduino
Background of Serial Communication:
There are three types of communication systems in serial communication
- Simplex ( only transmit data )
- Half duplex (Can transmit or receive data, but not simultaneously)
- Full Duplex (can transmit and receive data at the same time)
Programming Arduino for serial Communication:
Have look at the most important functions used in Rs232 communication.
Note: X is the baud rate, different devices have different requirement of baud rate mostly 9600 is used as a baud rate it define how fast data will sent or received. This function comes in void Setup().
This function checks whether serial data is available to receive or not if the return of this function is 0 its mean no serial data available to fetch and if it returns 1 its mean serial data available.
This function reads the data available in the buffer by default when you send data then its data type is char and when you read it will read its decimal value, for example you are sending 1 it will be read as 49 which is the decimal equivalent of char 1.
This function prints the data available in the x variable in the serial window of aurdinu IDE and sends it to the port.
This function will flush out all the garbage values in the serial buffers.
Example of serial port programming in Arduino:
Stay connected for more upcoming tutorials.
You Might Also Read:
- How to Program PIC18 Microcontroller. Step by Step Tutorial.
- MAX232: Construction, Operation, Types and Application.
- 10+ Design & Simulation Tools for Electrical/Electronics Engineers Online.
- 15 Must Have Android Apps for Electrical & Electronics Engineers & Students.
- Clap Switch Circuit Electronic Project Using 555 Timer.
- How to find The value of Burnt Resistor ( By three handy Methods ).
Free Circuit Design Software: learn to use Editor quickly and easily
Cheapest PCB: 10pcs 2-layers 10cm×10cm only $8.21, 3-day build time, 100% E-test