arrays and strings

For general Flowcode discussion that does not belong in the other sections.
Post Reply
WingNut
Posts: 254
http://meble-kuchenne.info.pl
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

arrays and strings

Post by WingNut »

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
Attachments
Untitled.png
Untitled.png (97.06 KiB) Viewed 926 times

mnfisher
Valued Contributor
Posts: 955
Joined: Wed Dec 09, 2020 9:37 pm
Has thanked: 104 times
Been thanked: 508 times

Re: arrays and strings

Post by mnfisher »

See viewtopic.php?f=3&t=1286&p=7220#p7220 - where this is some example of splitting a string into segments and also converting a hex string to an integer.

Martin

WingNut
Posts: 254
Joined: Tue Jul 13, 2021 1:53 pm
Has thanked: 33 times
Been thanked: 23 times

Re: arrays and strings

Post by WingNut »

Perfect!!
Thanks Martin thats saved me a lot of time

Post Reply