Si consigues comprender que hace este programa que he hecho para mi calabaza de halloween con mi arduino te doy un pin.
int ledPin = 2;
long RND;
void setup() {
pinMode(ledPin, OUTPUT);
pinMode(3, OUTPUT);
pinMode(11, OUTPUT);
}
void loop() {
delay(random(10,50));
rnde();
analogWrite(11,RND);
digitalWrite(2, HIGH);
digitalWrite(4, HIGH);
delay(random(10,50));
analogWrite(ledPin, RND);
analogWrite(4, random(255));
}
void rnde() {
RND = random(255);
}
o este otro: (este es mas en plan party hard xDD)
int ledPin = 13;
int larr[5] = {00,11,8,10,12};
int hlarr[3] = {00, 2, 4};
int cmd[3] = {00, 6, 7};
void setup() {
/******PIN13 Led**********/
pinMode(ledPin, OUTPUT);
/******NON HLEDS*********/
pinMode(larr[1], OUTPUT);
pinMode(larr[2], OUTPUT);
pinMode(larr[3], OUTPUT);
pinMode(larr[4], OUTPUT);
/******HLEDS**********/
pinMode(hlarr[1], OUTPUT);
pinMode(hlarr[2], OUTPUT);
/******BUTTONS***********/
pinMode(cmd[1], INPUT);
pinMode(cmd[2], INPUT);
}
void loop() {
digitalWrite(hlarr[1], HIGH);
digitalWrite(larr[1], HIGH);
digitalWrite(larr[2], HIGH);
delay(45);
digitalWrite(hlarr[1], LOW);
digitalWrite(larr[1], LOW);
digitalWrite(larr[2], LOW);
digitalWrite(larr[3], HIGH);
digitalWrite(larr[4], HIGH);
digitalWrite(hlarr[2], HIGH);
delay(45);
digitalWrite(hlarr[2], LOW);
digitalWrite(larr[3], LOW);
digitalWrite(larr[4], LOW);
}
Flipado.