Complete this code

int _________ = 5;
int _________ = 11;
int _________ = 3;
int _________ = 1;
int valorLuz;

void setup(){
pinMode(,);
pinMode(,);
pinMode(,);
Serial.begin(9600);
}

void loop(){
valorLuz = analogRead();
Serial.println(valorLuz);

if (valorLuz > 0 && valorLuz < 400){
digitalWrite(,);
digitalWrite(,);
digitalWrite(,);
}

if (valorLuz > 401 && valorLuz < 800){
digitalWrite(,);
digitalWrite(,);
digitalWrite(,);
}

if (valorLuz > 801 && valorLuz < 1024){
digitalWrite(,);
digitalWrite(,);
digitalWrite(,);
}

}

i need for tomorrow
thanks

the audacity

"complete this code". But no reason given, other than the assignment was due yesterday.

What form of payment are you offering? Some forum members accept Bitcoin.
You are welcome!

Do you use secret variables?

Complete this sentence:

If I do not study, I will ____ my class.

You forgot to include the exam question and the schematic, both of which would accompany the skeleton code and explain context. Although, I think there's a lack of sympathy in the forum today, so you're doomed; the lions will eat well.
C

Happens on all of the tech forums and groups I'm in. More often than not, another member takes up the challenge, and enables this sort of nonsense.

To be fair, the occasional poster figures it out, and improves rapidly. But you're right, most keep looking for the free handouts.

Most likely, valorLuz is Spanish for "light value". Hope that helps!

Here you go:

I'm not even going to bother to request that you read the forum guidelines.

"display"?

This does all the boring analog sensor readings for you. LEDs work in both directions, this is in the bios if you know where to look. It will invert the built in led (on an Uno only though) to take IN light values and do what this code is trying to do.
The teacher's going to be blown away, trust me.

// just leave these commented out, they're so unnecessary here
/*
int _________ = 5;
int _________ = 11;
int _________ = 3;
int _________ = 1;
int valorLuz;
*/

void setup() {
  Serial.begin(9600);
// you don't need the pinModes either.
  delay(1000);
}

void loop() {
  doge();
delay(1000);
}
  
void doge(){
Serial.println("               7 77IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII??????+++?+++++++++?????++++??7777   ");
Serial.println("                7IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII?????++=+?+?+++++++?++???++++++?777   ");
Serial.println("               7IIIIIIIIIIII?++++?IIIIIIIIIIIIIIIIIIIIIIIIIII????+==+??I????????+++++++++++++77   ");
Serial.println("               7IIIIIIIIIIII=~====?IIIIIIIIIIIIIIIIIIIIIIIIII????===+????????????++++++++++++?7   ");
Serial.println("               IIIIIIIIIIII+~:~===++?IIIIIIIIIIIIIIIIIIIIIIII??+====++?IIII???????+???++++++++I   ");
Serial.println("               IIIIIIIIIIII=~~~===+=+?IIIIIIIIIIIIIIIIIIIIIIII?=====++??????????I??????????++++   ");
Serial.println("               IIIIIIIIIII?~~~=======++?IIIIIIIIIIIIIIIIIIIII?+===~=++?????????????????????????   ");
Serial.println("               IIIIIIIIIII+~~~~~~~===~~++?IIIIIIIIIIIIIIII??+====~=+=++?????????????????III????   ");
Serial.println("               IIIIIIIIIII+~=~~~~~====~===?III?????+??+++++++++++++===+++++++++?????????????III   ");
Serial.println("               IIIIIIIIIII=~=~~::~~~~==:~=====++++++++++++++++++++++++++=============+++++?????   ");
Serial.println("               IIIIIIIIIII=~~=~:,,::~==~:~==~++=++++++++++===++++++????+++==================+++   ");
Serial.println("               IIIIIIIIIII+~~=~:,,:~====~~~~+++=+++++++++=====++++????????++===================   ");
Serial.println("               IIIIIIIIIII?====~:,,:~~=~~~=++++++++==++++++====+++???????????++++==============   ");
Serial.println("               IIIIIIIIIIII=====~::,,~==~=++++++++++++++++++====++??????+????????+=+===========   ");
Serial.println("               IIIIIIIIIIII+~====~:,,,~=+++++++++=++++++++++=+==++?????????????????+++=========   ");
Serial.println("               IIIIIIIIIII?+=~,===~~~=++++++++++==++++????++====+++????????????????+++++=======   ");
Serial.println("               IIIIIIIIII??+=========++++++++++====+++?+????+=====++??++=~~+?????????+++++++===   ");
Serial.println("               IIIIIIIII??+=~~~===++++++++++=====+++++?+????+++==++++?=,:.+==??II??????????++++   ");
Serial.println("               IIIIIIIII?++=~~~==++++++++++++===+++++=++????++++++?+++=,,.,,+?II7II???I????????   ");
Serial.println("               IIIIIIII?+++=~~==++++++++++++++++==:...~,:=+++++??+???++=,::~~?III7II?????II????   ");
Serial.println("               IIIIIIII?++==~~==+++++++++++++++=~,.,,,:?~,:~==++?????++?+=~=+???I7III??????????   ");
Serial.println("               IIIIIIIII++=====++++++++++++++++++:,,...~+:,:~=++???????+????+???IIIIII?????????   ");
Serial.println("               IIIIIIII?++====++++?++?????????????~,,,,=,,:===++??????????????+?IIIIII?????????   ");
Serial.println("               IIIIIIII?+==+=+++++???????????????++?+===++++++++???????+?????IIIIIIIIII????????   ");
Serial.println("               IIIIIIII?++++++++????????+????????++++++++++++++????????++=~====+IIIIIII????????   ");
Serial.println("               IIIIIII?++++++++???????????????????+++++++??+??????????=:::~:,,,,,IIIIII??++????   ");
Serial.println("               IIIIIII?+++++++?????????I??I??????????????????????III?+,,,...,.,.,?III?II????+=~   ");
Serial.println("               IIIIII?+++++=++++?????????????????????????????????????=,,,....,,,++III?II??++=~~   ");
Serial.println("               IIIIII?+++++==++++????????????????????I???????????????+:,..,.,.,,,+IIIIII??+?+++   ");
Serial.println("               IIII??++++++===+++++++++?????????????????????++?????+=+=~:,,,,.,,~=???II????++??   ");
Serial.println("               IIII??++++++====++++++++++???????????????????++++++?+?++~::,,,,::~=+??III??++++?   ");
Serial.println("               IIII??+++==+====+++?????++++???++++?????????++++++++?+++=::::~:~~~=+??III???++++   ");
Serial.println("               IIII?++++=======+++++??????+++++++++++?+?+++=+=++++++=+~::~:....,~+???III??+++++   ");
Serial.println("               IIII??++===+++===++?????????+++???++++++++++====++++++=~....,,,:::?I???II??+++++   ");
Serial.println("               III?++++=========+++????????????+???++++++++=~::,,,,:.,,:,,:,,::=+???IIIIIIIIIII   ");
Serial.println("               II??++++=========+++++???????????????+++++?++=~~~~::::::~~~::~~=+???IIIIIIIIIIII   ");
Serial.println("               II?++++=========+++++++??+++???????+++++++++++++=======++===~=+?????IIIIIIIIIIII   ");
Serial.println("               II?++++===~========+++++++???????+++++++++++++++++++++++++++++???????IIIIIIIIIII   ");
Serial.println("               II?++==+=============+++++++????????++++++++++++++++++++++????????????IIIIIIIIII   ");
Serial.println("               I??+++=============+==+++++??++???????+++++++++++++++++????????????????IIIIIIIII   ");
Serial.println("               I??+++=======~~~=====+++++++++?+???????++++++++++++++++??+++???????????IIIIIIIII   ");
Serial.println("               I??++++++++========+++++++++++++????????++++++++++++++++++++???????????IIIIIIIII   ");
Serial.println("               II???+++++++========++++++++++++++??+++?++++++++++++++++++++????+???????IIIIII?I   ");
Serial.println("               II??++++++++++=====+++++++++?++++++++++++++++++++++++++++++?+++++???????IIII????   ");
Serial.println("               II?????????+++++++++++++++++++??++++==++++++++++++++++++++++++++?????????II????I   ");
Serial.println("               II???????????????+===++++?++?+++++++++==++=++=++==++++++++++++?????????II??????I   ");
Serial.println("               II?++??????????????++++?+++++++?????+++++================++++?????????III?????I7   ");
Serial.println("               7I?+?+?????????????????++++?++++?++?????++++=====++++=++++++++??????IIIII?????77   ");
Serial.println("               77I++?????????????????????????+++?++++?+???++++++++++++++++++??????IIIIII???777    ");
Serial.println("               7777???????????????????????++++?????+???++++++++++=++++++++++???????IIIII?I7777    ");
Serial.println("               777 777I???????????????????+?????+?+?+??????++++++++++++++++????????III7777   7    ");
                                                                 
}

Any questions, no problem I'm here all evening.

Code uses too much memory. Consider using the F macro. :smile:

You mean mine? Yes, you are correct, I must have forgotten to do that. Egg on my face. Hopefully OP through this sees what collaboration through a forum such as this does to help accomplish one's goals.
You get out what you put in, I think is fair to say.
Cheers on the code optimization, groundFungus. Your ongoing contribution here is certainly appreciated by me and no doubt countless others. I can't believe I forgot to do that! So embarrassing, if I'm honest.

Like Gandalf to the balrog, "You shall not pass"

tumblr_n0tvszgv2Q1t8dx8uo1_400

1 Like

As per the righteous suggestion of @groundFungus , here is the bios function with the F macro. (I still can't believe I forgot! - I've been at this 8 or 9 years and I really ought to know better!) Just replace the original void doge() function with this or it will never compile.
Good luck!

void doge(){
  
Serial.println(F("               7 77IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII??????+++?+++++++++?????++++??7777   "));
Serial.println(F("                7IIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIIII?????++=+?+?+++++++?++???++++++?777   "));
Serial.println(F("               7IIIIIIIIIIII?++++?IIIIIIIIIIIIIIIIIIIIIIIIIII????+==+??I????????+++++++++++++77   "));
Serial.println(F("               7IIIIIIIIIIII=~====?IIIIIIIIIIIIIIIIIIIIIIIIII????===+????????????++++++++++++?7   "));
Serial.println(F("               IIIIIIIIIIII+~:~===++?IIIIIIIIIIIIIIIIIIIIIIII??+====++?IIII???????+???++++++++I   "));
Serial.println(F("               IIIIIIIIIIII=~~~===+=+?IIIIIIIIIIIIIIIIIIIIIIII?=====++??????????I??????????++++   "));
Serial.println(F("               IIIIIIIIIII?~~~=======++?IIIIIIIIIIIIIIIIIIIII?+===~=++?????????????????????????   "));
Serial.println(F("               IIIIIIIIIII+~~~~~~~===~~++?IIIIIIIIIIIIIIII??+====~=+=++?????????????????III????   "));
Serial.println(F("               IIIIIIIIIII+~=~~~~~====~===?III?????+??+++++++++++++===+++++++++?????????????III   "));
Serial.println(F("               IIIIIIIIIII=~=~~::~~~~==:~=====++++++++++++++++++++++++++=============+++++?????   "));
Serial.println(F("               IIIIIIIIIII=~~=~:,,::~==~:~==~++=++++++++++===++++++????+++==================+++   "));
Serial.println(F("               IIIIIIIIIII+~~=~:,,:~====~~~~+++=+++++++++=====++++????????++===================   "));
Serial.println(F("               IIIIIIIIIII?====~:,,:~~=~~~=++++++++==++++++====+++???????????++++==============   "));
Serial.println(F("               IIIIIIIIIIII=====~::,,~==~=++++++++++++++++++====++??????+????????+=+===========   "));
Serial.println(F("               IIIIIIIIIIII+~====~:,,,~=+++++++++=++++++++++=+==++?????????????????+++=========   "));
Serial.println(F("               IIIIIIIIIII?+=~,===~~~=++++++++++==++++????++====+++????????????????+++++=======   "));
Serial.println(F("               IIIIIIIIII??+=========++++++++++====+++?+????+=====++??++=~~+?????????+++++++===   "));
Serial.println(F("               IIIIIIIII??+=~~~===++++++++++=====+++++?+????+++==++++?=,:.+==??II??????????++++   "));
Serial.println(F("               IIIIIIIII?++=~~~==++++++++++++===+++++=++????++++++?+++=,,.,,+?II7II???I????????   "));
Serial.println(F("               IIIIIIII?+++=~~==++++++++++++++++==:...~,:=+++++??+???++=,::~~?III7II?????II????   "));
Serial.println(F("               IIIIIIII?++==~~==+++++++++++++++=~,.,,,:?~,:~==++?????++?+=~=+???I7III??????????   "));
Serial.println(F("               IIIIIIIII++=====++++++++++++++++++:,,...~+:,:~=++???????+????+???IIIIII?????????   "));
Serial.println(F("               IIIIIIII?++====++++?++?????????????~,,,,=,,:===++??????????????+?IIIIII?????????   "));
Serial.println(F("               IIIIIIII?+==+=+++++???????????????++?+===++++++++???????+?????IIIIIIIIII????????   "));
Serial.println(F("               IIIIIIII?++++++++????????+????????++++++++++++++????????++=~====+IIIIIII????????   "));
Serial.println(F("               IIIIIII?++++++++???????????????????+++++++??+??????????=:::~:,,,,,IIIIII??++????   "));
Serial.println(F("               IIIIIII?+++++++?????????I??I??????????????????????III?+,,,...,.,.,?III?II????+=~   "));
Serial.println(F("               IIIIII?+++++=++++?????????????????????????????????????=,,,....,,,++III?II??++=~~   "));
Serial.println(F("               IIIIII?+++++==++++????????????????????I???????????????+:,..,.,.,,,+IIIIII??+?+++   "));
Serial.println(F("               IIII??++++++===+++++++++?????????????????????++?????+=+=~:,,,,.,,~=???II????++??   "));
Serial.println(F("               IIII??++++++====++++++++++???????????????????++++++?+?++~::,,,,::~=+??III??++++?   "));
Serial.println(F("               IIII??+++==+====+++?????++++???++++?????????++++++++?+++=::::~:~~~=+??III???++++   "));
Serial.println(F("               IIII?++++=======+++++??????+++++++++++?+?+++=+=++++++=+~::~:....,~+???III??+++++   "));
Serial.println(F("               IIII??++===+++===++?????????+++???++++++++++====++++++=~....,,,:::?I???II??+++++   "));
Serial.println(F("               III?++++=========+++????????????+???++++++++=~::,,,,:.,,:,,:,,::=+???IIIIIIIIIII   "));
Serial.println(F("               II??++++=========+++++???????????????+++++?++=~~~~::::::~~~::~~=+???IIIIIIIIIIII   "));
Serial.println(F("               II?++++=========+++++++??+++???????+++++++++++++=======++===~=+?????IIIIIIIIIIII   "));
Serial.println(F("               II?++++===~========+++++++???????+++++++++++++++++++++++++++++???????IIIIIIIIIII   "));
Serial.println(F("               II?++==+=============+++++++????????++++++++++++++++++++++????????????IIIIIIIIII   "));
Serial.println(F("               I??+++=============+==+++++??++???????+++++++++++++++++????????????????IIIIIIIII   "));
Serial.println(F("               I??+++=======~~~=====+++++++++?+???????++++++++++++++++??+++???????????IIIIIIIII   "));
Serial.println(F("               I??++++++++========+++++++++++++????????++++++++++++++++++++???????????IIIIIIIII   "));
Serial.println(F("               II???+++++++========++++++++++++++??+++?++++++++++++++++++++????+???????IIIIII?I   "));
Serial.println(F("               II??++++++++++=====+++++++++?++++++++++++++++++++++++++++++?+++++???????IIII????   "));
Serial.println(F("               II?????????+++++++++++++++++++??++++==++++++++++++++++++++++++++?????????II????I   "));
Serial.println(F("               II???????????????+===++++?++?+++++++++==++=++=++==++++++++++++?????????II??????I   "));
Serial.println(F("               II?++??????????????++++?+++++++?????+++++================++++?????????III?????I7   "));
Serial.println(F("               7I?+?+?????????????????++++?++++?++?????++++=====++++=++++++++??????IIIII?????77   "));
Serial.println(F("               77I++?????????????????????????+++?++++?+???++++++++++++++++++??????IIIIII???777    "));
Serial.println(F("               7777???????????????????????++++?????+???++++++++++=++++++++++???????IIIII?I7777    "));
Serial.println(F("               777 777I???????????????????+?????+?+?+??????++++++++++++++++????????III7777   7    "));
                                                                 
}

@hallowed31 I hope that you will not think of me as a "nit picker" but I would recommend that you post the whole code if you make changes. Having the members piecing the code together from 2 or more posts, in order to run it, is just asking for errors to creep in. Post all of the code at once and that is not possible.

Another good call, my friend. Coming right up!