Created
December 17, 2017 11:42
-
-
Save smetronic/1f5fc4e0871d08cb73f254a2a5eb78cf to your computer and use it in GitHub Desktop.
ATMega 328p: Convert string hex to int
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
void setup() { | |
Serial.begin(9600); | |
String hexstring = "FB"; | |
int number = (int) strtol( &hexstring[0], NULL, 16); | |
Serial.println(number); | |
} | |
void loop() { | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment