I am using the example written by Anthony Buckton with the mpr121 breakout board. I have heavily modified the example and have setup the mbed to only recognize buttons zero through four. I am using button zero to cancel and return to a main menu screen, button one decrements a value displayed on a screen, button two increments a value displayed on a screen, and button three confirms the value that is chosen by a user.
I set up a variable lets call it, int pumpspeed=0;. When I increment(press and release button two) the value of "pumpspeed" the variable will increase by one and the sequence of numbers looks normal until I reach anything past nine; after that every value displayed is represented as A-F until reaching 10. The same behavior is exhibited after values 19, 29,39,... as well.
I recognize that the #include <string> directive is there, so, I am wondering what is the best way to convert these strings to ints or rather how to eliminate the A-F values from showing up before reaching the next sequential number? I have picked the three files apart and I have no idea why the int variables contain hex values.
I am using the example written by Anthony Buckton with the mpr121 breakout board. I have heavily modified the example and have setup the mbed to only recognize buttons zero through four. I am using button zero to cancel and return to a main menu screen, button one decrements a value displayed on a screen, button two increments a value displayed on a screen, and button three confirms the value that is chosen by a user.
I set up a variable lets call it, int pumpspeed=0;. When I increment(press and release button two) the value of "pumpspeed" the variable will increase by one and the sequence of numbers looks normal until I reach anything past nine; after that every value displayed is represented as A-F until reaching 10. The same behavior is exhibited after values 19, 29,39,... as well.
I recognize that the #include <string> directive is there, so, I am wondering what is the best way to convert these strings to ints or rather how to eliminate the A-F values from showing up before reaching the next sequential number? I have picked the three files apart and I have no idea why the int variables contain hex values.