Thursday, 19 January 2012



The code below represents the code used to start programming.
You can cut and pasted coding into the ARDUINO programming window directly
from the Arduino home page.

Text in purple is a definition of elements I dont really understand...
anyway


Go to reference, and find required function. 
In this case it is +analogRead()
int analogPin = 0;
the 0 is the number of the analog pin used on the breadboard.
Analog reads from high to low
int stands for interger which is a whole number
int val = 0;
val is the value of the number from the sensor
void setup()
Setup is a function. 
A setup is a block of code that performs a function.
when text changes colour from black to orange it means that particular part of the programme has been recognised.
therefore, when setup is called the code that is housed by {} is the function that will take place.
{
  Serial.begin(9600);
9600 is the speed of communication per second.
}
void loop()
{
  val = analogRead(analogPin);
variable is number of the value of the sensor. It 
can be a number or a word
  Serial.println(val);
}

No comments:

Post a Comment