Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- String str1 = "on1";
- char matriz[4];
- char lamp[] = {1,2,3};
- int Id;
- String Str2;
- void setup()
- {
- Serial.begin(9600);
- }
- void loop()
- {
- str1.toCharArray(matriz, 4);
- Str2 = (matriz[2]);
- Id = Str2.toInt();
- Serial.println(lamp[Id-1],HEX);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement