arrays and strings
Posted: Wed Jul 06, 2022 8:50 pm
Evening all. I'm stuck on a prob with an array read from an sd card. The string is a series of numbers 100601111.
This number represents - 10 a number used as a "timer", 060 as an integer for a calculation, and 1111 as 4 analogue inputs the 1 representing an on and 0 as off.The leading 0 of 060 is as a 'place holder' as this number could have 3 digits and i'd rather not program a lot of adjusting to the array size or individual character placement. The 1111 is 4 bits either on (1) or off (0)
I can read in the array correctly but I'm struggling with how to get the 10 as an integer and the 060 the same but separately. If i can get these 2 sorted i'll figure the four 1's
The 10 is being interpreted as 'a' which of course is 10 as hex
I'm not sure if i have understood the string manipulation on the wiki.
Any help would be appreciated as my head is pickled this time
This number represents - 10 a number used as a "timer", 060 as an integer for a calculation, and 1111 as 4 analogue inputs the 1 representing an on and 0 as off.The leading 0 of 060 is as a 'place holder' as this number could have 3 digits and i'd rather not program a lot of adjusting to the array size or individual character placement. The 1111 is 4 bits either on (1) or off (0)
I can read in the array correctly but I'm struggling with how to get the 10 as an integer and the 060 the same but separately. If i can get these 2 sorted i'll figure the four 1's
The 10 is being interpreted as 'a' which of course is 10 as hex
I'm not sure if i have understood the string manipulation on the wiki.
Any help would be appreciated as my head is pickled this time