Thursday, March 4, 2010

Key words:

This section will be added to over time. It will be developed like a knowledge base for the arduino.

LED: A light-emitting diode is a semiconductor light source.

LDR: A photoresistor or light dependent resistor or cadmium sulfide (CdS) cell is a resistor whose resistance decreases with increasing incident light intensity. It can also be referenced as a photoconductor.

setup(): a function run once at the start of a program which can be used for initializing settings.

loop(): a function called repeatedly until the board is powered off.

analogRead(): Reads the value from the specified analog pin.

Serial.print(): Prints data to the serial port as human-readable ASCII text.

Serial.println(): Prints data to the serial port as human-readable ASCII text followed by a carriage return character (ASCII 13, or '\r') and a newline character (ASCII 10, or '\n'). This command takes the same forms as Serial.print().

pinMode(): Configures the specified pin to behave either as an input or an output. See the description of digital pins for details.

digitalRead(): Reads the value from a specified digital pin, either HIGH or LOW.

Arduino PWM: Pulse Width Modulation, or PWM, is a technique for getting analog results with digital means. Digital control is used to create a square wave, a signal switched between on and off. This on-off pattern can simulate voltages in between full on (5 Volts) and off (0 Volts) by changing the portion of the time the signal spends on versus the time that the signal spends off. The duration of "on time" is called the pulse width. To get varying analog values, you change, or modulate, that pulse width. If you repeat this on-off pattern fast enough with an LED for example, the result is as if the signal is a steady voltage between 0 and 5v controlling the brightness of the LED.

Interrupt: A way for the programmer or an internal ATMega328 component to interrupt what the chip is currently doing.
Types: External (triggered by something happening on a line into the system (easy)) and Internally (triggered by something going on within the system itself (hard)).

Interrupt Service Routines: ISRs interrupt the normal processing of the Arduino.
Call: attachInterrupt("line", "ISR_name", "mode");

"line" is the interrup number(0,1) not the pin number(2,3).
"mode" can be LOW, CHANGE, RISING or FALLING.

other Interrupt Management procedures include:

detachInterrupt() : removes the ISR from the interrupt line, so processing will no longer occur on that line.

no Interrupts() : prevents intrerupt processing from occuring altogether.

interrupts() : cancels the noInterrupts() call. This is the default.

Volatile: Variables that are used within an ISR must be declared volatile. Volatile variables are retrieved from RAM each time to keep them consistantant.

TBC

No comments:

Post a Comment