![]() You need a slightly better description of what you want.Īnyway, I forgot to add, to actually send the ASCII character to the PC, you'd use 'Serial.print(c) ' ![]() ![]() You could do a search on "state machine" and "button debounce" to learn more. Really, you need a SPST switch to select the sound, then a pushbutton to send the selection. That would require recording the switch state, then decoding if it changes. You could possibly just decode or use the resulting character once if the switch changes states. Of course, this will continuously return one or the other of the values. We'll use 'A' and 'B' as the two ASCII codes, with an 'A' selected if the switch pin is high:- char c I guess that's what you mean by Ascii 2 code letter or number. I hope you only want a choice of two ASCII values to convert to. So in effect you want to take a binary value from the switch, a 0 or a 1, and convert it to an ASCII value? Arduino then reads the circuit is closed and converts it into an Ascii 2 code letter or number. A circuit is closed (using a button push or conductive ink ect.), Im guessing just a couple of pins on a breadboard?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |