I'm building a midi controller with Arduino. In order to send messages I use commands like Serial.print(char(0x01)); As you can see, although the message itself is a hex value, it has to be sent in the char format. With toggle switches that only know two states it was easy to do (only 0x01 or 0x7F - two values), but I haven't figured out how I can convert an analog value that I've read into a int variable with a potentiometer (127 different values possible).
I can do "Serial.print(hex(pot_value))", but it won't give me the result I need as it's in the wrong format. I also tried "Serial.print(char(hex(pot_value)))" which didn't work either. How do I cast a int value that I have into pure characters, so that I get it to do Serial.print(char(0xPot_hex_value_as_char))?