//Jeremy Saglimbeni - http://thecustomgeek.com // Breadboard example sketch - basic blinky int i; int led = 11; // LED pin int pot = 18; // pot input pin int potv; // pot value int del; // delay value void setup() { pinMode(led, OUTPUT); pinMode(pot, INPUT); } void loop() { for(i = 0 ; i <= 255; i+=1) { // do this 255 times analogWrite(led, i); // analogWrite i to the LED checkpot(); // read the pot and map the delay value delayMicroseconds(del); // delay accordingly } for(i = 255; i >=0; i-=1) { analogWrite(led, i); checkpot(); delayMicroseconds(del); } } void checkpot() { potv = analogRead(pot); // read the pot value del = map(potv, 0, 1023, 250, 3000); // map the value on a scale from 250 to 3000 }