Feeling like a real idiot here...
How would I make these two things work?
#define A 75
const int b = 100;
Serial.begin(9600);
Serial.println("Cool number is " . A);
Serial.println(Cooler number is " . b);
Thanks so much!
Feeling like a real idiot here...
How would I make these two things work?
#define A 75
const int b = 100;
Serial.begin(9600);
Serial.println("Cool number is " . A);
Serial.println(Cooler number is " . b);
Thanks so much!
#define A 75
const int b = 100;
Serial.begin(9600);
Serial.print( A );
Serial.println("Cool number is ");
Serial.print( B );
Serial.println(Cooler number is ");
Thanks! I figured out that I could do that, but it gets a little messy when I have to print a lot if defines in a single line... Is there no way to cast the define or something?
A define is simply a macro; you can apply casts if you like.
, though I don't see how it helps you achieve what you want.
A full implementation of sprintf is a bit OTT for the Arduino.
Somewhere there is an implementation of the more C++ like iostream, I'll see if I can find a link (on a train ATM)
I use CodingBadly's approach, but put all the prints for one line of text in a single line of code.
Its not so bad.
Serial.print( A ); Serial.println("Cool number is ");
Serial.print( B ); Serial.println(Cooler number is ");
Debugging without a compiler:
Serial.println([glow]"[/glow]Cooler number is ");
-Fletcher