Arduino Diecimila - Blink - analog
int ledPin = 13; // LED connected to digital pin 13int h=1;
int h = 1;
int h2=0;
void setup() // run once, when the sketch starts
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}
void loop() // run over and over again
{
digitalWrite(ledPin, HIGH); // sets the LED on
h2 = 1000-h;
while(h2>0){
h2--;
}
digitalWrite(ledPin, LOW); // sets the LED off
h2 = (h*8);
while(h2 >0){
h2--;
}
h=h+1;
if (h>1000)
{
h=1;
}
}
Arduino Diecimila - Blink - analog
int ledPin = 13; // LED connected to digital pin 13int h=1;
int h = 1;
int h2=0;
void setup() // run once, when the sketch starts
{
pinMode(ledPin, OUTPUT); // sets the digital pin as output
}
void loop() // run over and over again
{
digitalWrite(ledPin, HIGH); // sets the LED on
h2 = 1000-h;
while(h2>0){
h2--;
}
digitalWrite(ledPin, LOW); // sets the LED off
h2 = (h*8);
while(h2 >0){
h2--;
}
h=h+1;
if (h>1000)
{
h=1;
}
}