Created
January 14, 2023 23:48
-
-
Save reefwing/c3a6c051bed94432304160ac402ccb17 to your computer and use it in GitHub Desktop.
Code snippet to show reading and displaying the potentiometer value
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. float pot = (((float)analogRead(VPOT) + 0.5) / 1024.0) * 100.0; | |
2. | |
3. itoa((int)pot, throttleAsChar, DECIMAL); // itoa = Int to ASCII | |
4. u8x8.drawString(1, 4, "THROTTLE: "); | |
5. u8x8.drawString(10, 4, throttleAsChar); | |
6. u8x8.drawString(14, 4, "%"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment