Go Down

Topic: to many arguments to function (Read 1 time) previous topic - next topic

billroy

#5
Jan 29, 2013, 04:12 pm Last Edit: Jan 29, 2013, 04:14 pm by billroy Reason: 1
I don't know if this is your bug or not, but attempting to reassign a system-provided define like ON or OFF like this is creative but not going to work:
Code: [Select]

void common_cathode(boolean cathode){
 if(cathode==true){
   ON=HIGH;
   OFF=LOW;
 }
 else{
   ON=LOW;
   OFF=HIGH;
 }
}


-br

Edit: Never mind.  I was mistaken in assuming the ON and OFF were system defines.  My bad.

AWOL

I'd suggest the code you posted is not the code you're trying to compile.
Here's the error message I got:
Quote
Binary sketch size: 2436 bytes (of a 14336 byte maximum)


(compiled for 168 on IDE 1.0)
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

AWOL

Quote
but attempting to reassign a system-provided define like ON or OFF like this is creative but not going to work:

Why not?
"Pete, it's a fool looks for logic in the chambers of the human heart." Ulysses Everett McGill.
Do not send technical questions via personal messaging - they will be ignored.

billroy

I had myself confused that ON was a #define.  More coffee...

-br

HazardsMind

You dont need to have,
Quote
digitalWrite(pin_a, OFF);
 digitalWrite(pin_b, OFF);
 digitalWrite(pin_c, OFF);
 digitalWrite(pin_d, OFF);
 digitalWrite(pin_e, OFF);
 digitalWrite(pin_f, OFF);
 digitalWrite(pin_g, OFF);
there is an easier way to get your LEDs to light up, but if it compiles like that and thats what you want to use, then go for it.

Alternative:
just use an array,
0b00000000 = all off
0b00101010  = something on
0b00010101 = something else on
.
.
0b11111111 = all on
Created Libraries:
TFT_Extension, OneWireKeypad, SerialServo, (UPD)WiiClassicController, VWID

Go Up