Friday, 17 July 2015

Arduino Code Reference

What is Arduino?
Ardiuno is open source computer hardware and Software Company, user and project community that designs & manufactures kits for building digital devices & interactive objects that can sense & control the physical world.

The project is belongs to family of microcontroller board designs manufactured primarily by smart projects & also by several other vendors.

Have you ever read a book and come upon a word you didn’t understand? Sometimes you can also infer the meaning from its context, but what about when no such context exists?

Likely, you used a search engine to find the appropriate definition. The definition told you what the word meant, whether it was a verb or adjective, it gave some examples of how to use the word, and may be even the etymology. The arduino reference manual Code Reference is the same thing. It is the “dictionary” for all the variable, structures and functions that you can use when programming sketch. So let’s jump into an Arduino Code Reference Page.

You will note at the top of the reference index page, there are three columns; Structure, functions and variables. This is the first level of organization in the reference. So if you are looking for a variable, you must know which column to start looking in.

Each of the hyperlinked items on this index page will take you to the individual entries references page. What’s great about the individual references pages is that they are organized in a similar manner from one to the next, so you should know what to expect exactly. They are also terse, so don’t think you are going to have to scour through someone dissertation.


http://www.netsoup.net/docs/list/arduino-reference


Each page has major headings. We will walk through the main ones and then talk about some less common.
Set Pin 13 to the same value as Pin 7, declared as an input.

int led Pin = 13;
int inPin = 7;
int val= 0;
Void Setup ()
{
Pinmode (ledPin, OUTPUT);
Pinmode (inpin, INPUT);
}
Void loop ()
{
Val= digitalRead (inpin);
Digitalwrite(ledpin, val);
}

Description

All entries will have a description and details. Pretty straight forward this is going to be a simple explanation of what the item does. It commonly uses language that is basic.

Syntax

Most of the entries have“syntax” headings and they are more prevalent for functions. The syntax explains and shows how the function should write when you use it in your sketch.

Digital Write (pin, value)

 The word in the parerntheses is telling you what type of value should be passed to the functions. If we want to use this function than it will require two things, first is the pin number and the value to write to the pin.
  
Parameters

Only structures and functions will have the “Parameters” heading.

Parameters

Pin: the pin number

Value: High or Low

Returns

This will tell you what value to expect functions to give you back. When you use the square root function, you expect to get back the square root accordngly. But which data type will the square root be- an integer, a double or float? The “Return” heading will tell you.

Sqrt (X)

Description: Calculates the square root of a number.

Parameters: X the number, any data type

Returns: double, the number’s square root.

Arduino Code Reference makes programming embedded devices more accessible to lot of people.  If you know Java then it will be more beneficial.

For More Information c programming reference sheet Visit us..

No comments:

Post a Comment