Tuesday, March 28, 2017

Arduino and C programming

What is Arduino?

Arduino is an open-source electronics platform. It’s very easy-to-use combination of hardware and software. Arduino circuit boards are able to read the inputs from various sensors. Output of the board can be used for activating a motor, turning LED on/off and publishing something on network.

For more details about Arduino visit: https://www.arduino.cc


Arduino and C programming

Arduino programs can be divided in three main parts: structure, values (variables and constants), and functions. Most of the syntax of structure, variable/constants and functions is very similar to syntax of C programming language. Study few sample syntax of Arduino given below which is very similar to C syntax:

Control Structures

if, if...else, for, switch case, while, do... while, break, continue, return, goto

Arithmetic Operators

= (assignment operator), +  (addition), - (subtraction), * (multiplication), / (division), % (modulo)

Comparison Operators

== (equal to), != (not equal to), < (less than), > (greater than), <= (less than or equal to), >= (greater than or equal to)

Boolean Operators

&& (and), || (or), ! (not)

Compound Operators

++ (increment), -- (decrement), += (compound addition), -= (compound subtraction), *= (compound multiplication), /= (compound division)

Data Types

void, boolean, char, unsigned char, byte, int, unsigned int, long, float, double

No comments:

Post a Comment