Go Down

Topic: Serial.println (Read 727 times) previous topic - next topic


Hi guys this my first post in this forum. i am a totally a newbie just starting out into the world of electronics. i had bought a arduino board couple of days back and was testing various functionalities...
well here is the problem...
I want to give a value to the arduino then  try to print that value in the serial monitor from the board(just trying... :)) here is the code i wrote...

int a;
void setup()
void loop()
   {  a=Serial.read();

well everything works fine.... but whenever i give value in serial monitor , its ASCII value is being displayed... :-? i knw its ASCII value is the one to be displayed... but say if want it to print the same data i give in the same format... like if i give 1 it should show 1 and not 49...
and also say i gave a string "Arduino" it should print that...
can anyone plz tell me how i can do this???
Thanx in advance....



Try this:

Serial.println(a, BYTE);



thanx mate it works....  :)

Go Up