Skip to content

Instantly share code, notes, and snippets.

@vasmani
Created January 1, 2014 15:30
Show Gist options
  • Select an option

  • Save vasmani/8208850 to your computer and use it in GitHub Desktop.

Select an option

Save vasmani/8208850 to your computer and use it in GitHub Desktop.
Arduino 16진수로 변환
char temp[3];
unsigned int kmh;
void setup() {
// put your setup code here, to run once:
Serial.begin(38400);
temp[0] = 'C';
temp[1] = 'A';
}
void loop() {
// put your main code here, to run repeatedly:
kmh = (int)strtol(temp, NULL, 16);
Serial.println(kmh);
delay(1000);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment