Hello, I'm new to Arduino. I have done a little C in the past but I'm rusty. I understand the meaning of the data types but when I try to put them to use I struggle to get the results I expect. For example. I would like to read in a byte from the serial port and based on the value generate a string. I am expecting values from 1 to 200 and I want to convert as follows: if( mybyte == 1) mystring = "song1.mp3"; if( mybyte == 2) mystring = "song2.mp3; and so on.
First off does it even make sense to say mybyte == 1? Is that even correct? Should it be mybyte == B00000001?
Second what type is mystring? Should I use an array of char? Or a string object?
Third I'm confused about how to write results to the serial monitor to debug my code. The code could be correct but serial monitor could be interpreting what I send it in a way I don't expect. I think I read somewhere the monitor gives different results depending on weather you said Serial.print() vs Serial.write()
I understand word vs byte and signed vs unsigned and two's complement and all that jazz. I guess I'm just struggling with syntax and how the compiler interprets things.