The LED is possibly the simplest actuator available. It’s a low power light source available in many colors. It lights up when powered from an Arduino pin.
Input: Arduino provides a maximum of 40 mA per pin; this is enough to light up the LED through thedigitalWrite() and analogWrite() functions.
Module description: This module features a 5mm Blue Light Emitting Diode, the standard TinkerKit 3pin connector and a green LED that signals that the module is correctly powered and a tiny yellow LED that shows the current brightness of the blue LED. A resistor provides the optimal amount of current when connected to an Arduino.
This module is an ACTUATOR therefore the connector is an INPUT that need to be connected to one of theOUTPUT connectors on the TinkerKit Shield.
/*
based on Blink, Arduino’s “Hello World!”
Turns on an LED on for one second, then off for one second, repeatedly.
The Tinkerkit Led Modules (T010110-7) is hooked up on O0
created in Dec 2011
by Federico Vanzati
This example code is in the public domain.
*/
// include the TinkerKit library
#include <TinkerKit.h>
// creating the object ‘led’ that belongs to the ‘TKLed’ class
// and giving the value to the desired output pin
TKLed led(O0);
void setup() {
// TinkerKit ‘object’ eliminate the need for pin declaration with pinMode()
}
void loop()
{
led.on(); // set the LED on
delay(1000); // wait for a second
led.off(); // set the LED off
delay(1000); // wait for a second
}
