Tim DangCedric Honnet
Published © CC BY-NC-SA

Hypnotoad

Arduino powered hypnotising wooden art.

Full instructions provided2,119
Hypnotoad

Story

Read more

Code

hypnotoad.ino

C/C++
hypnotoad.ino
// All glory to the Hypnotoad

const int LED_NUM = 3;
const int LEDa[LED_NUM] = {13, 12, 11};
const int LEDb[LED_NUM] = {7,  6,  5 };

void setup() {
  for (i=0; i<LED_NUM; i++)
  {
    pinMode(LEDa[i], OUTPUT);   // set output
    digitalWrite(LEDa[i], LOW); // LED off
    pinMode(LEDb[i], OUTPUT);   // set output
    digitalWrite(LEDb[i], LOW); // LED off
  }
}

void loop()
{
  const int MS = 90;
  static int i = 0;

  if (i == LED_NUM) i = 0;
  digitalWrite(LEDa[i], HIGH);   // LED on
  digitalWrite(LEDb[i], HIGH);   // LED on
  delay(MS);                     // wait
  digitalWrite(LEDa[i], LOW);    // LED off
  digitalWrite(LEDb[i], LOW);    // LED off
  ++i;
}

Credits

Tim Dang

Tim Dang

4 projects • 6 followers
3D Hacker, Music Hacker, Photo Hacker...
Cedric Honnet

Cedric Honnet

23 projects • 57 followers
Interhacktivist and Artech addict, Enginerd in Embedded Systems...
Thanks to Tim and Cedric.

Comments