Current sensor: Sparkfun ACS712

This example is for Wiring version 0027+. If you have a previous version, use the examples included with your software. If you see any errors or have comments, please let us know.

RGB LED by BARRAGAN

Demonstrates the use of PWM pins (analog output) to change the color of an RGB LED.


int RED = 37;    // RED pin of the LED to PWM pin 37 
int GREEN = 36;  // GREEN pin of the LED to PWM pin 36
int BLUE = 35;   // BLUE pin of the LED to PWM pin 35

void setup()
{
  pinMode(35, OUTPUT); 
  pinMode(36, OUTPUT); 
  pinMode(37, OUTPUT); 
}

void loop()
{
  for(int r = 0; r < 1024; r+=5) {
    for(int g = 0; g < 1024; g+=5) {
      for(int b = 0; b < 1024; b+=5) {
        analogWrite(RED, r);
        analogWrite(GREEN, g);
        analogWrite(BLUE, b);
        delay(30);
      }
    }
  }
}