I am trying to code where 5 leds to go back and forth with two buttons being pressed and a photoresistor to control the speed. The problem is I am not good at coding and need some help. Here is what I have so far for coding. i know i dont have any void setup and void loop but i need a idea of where to start cause I am lost
photo.ino (274 Bytes)
What code are You running? The .ino file has both setup() and loop().
sorry the code is this int x = 0;
int y = 0;
int leda = 9;
int ledb = 8;
int ledc = 7;
int ledd = 6;
int leda = 5;
int button1= 11;
int button2= 12;
void setup() {
pinMode(x,INPUT);
pinMode(y,OUTPUT);
pinMode(9, OUTPUT);
pinMode(8, OUTPUT);
pinMode(7, OUTPUT);
pinMode(6, OUTPUT);
pinMode(5, OUTPUT);
}
void loop() {
}
You supply a link to some code but You are not using it. Why?
Your loop contains nothing. What result can come out from code doing nothing? Just nothing.
that is what i am asking for a idea of where to go because i have to use a photoresistor to determine speed and I have no idea so i was asking for a idea of where to start.
Using photoresistors…. That's ok. Just connect the photoresistor to a matched resistor. One end connects to GND and the other end to Vcc and the middle point to an analog input of Your unknown controller. Then use analog read from that input.
so does it need to be identified with the code?
You beed to have the code inside controller, not "anyware else.
Sorry, I just don't understand Your last email post.