string to integer on android sysfs.

salim safran

Member
Licensed User
Longtime User
I have this string
"adc0:5
adc1:63
adc2:4095
adc3:1200
adc4:4095
adc5:4095"
the value for each adc (analog value) varies from 0 to 4095 the output is string value from a shell command , there will be a total of 400 samples , the command to generate the string is a shell command # cat /proc/adc* and the result as above mentioned, I need to write a code in b4a to convert that string to an array of 5 channels and do 400 shell command #cat /proc/adc* separated by 50milliscond and use the chart to draw the 5 channels on the chart from the saved arrays, then save arrays to a file , also an option to retrieve the arrays from a file and draw it back again on a chart. willing to pay for your help. let me know. i made a function to in b4a called readadc and get that string. I do not want u to do that part that I already done it by readying the great support from other members in this forum.

every of one the 6 adc shall have it it's own array for example adc0[400], adc1[400] and so on then I need to use your chart to display the values I select from the six analogue inputs there must be an option to show all the arrays, if i remember the chart can take up to 4 arrays only each with different color, all arrays shall be saved to text file, also to load them back from text file and draw the chart. o is zero voltage and 4095 shall be 3.3VDC, according to pcduino the max values for adc0 and adc1 is 63, but asked you to leave it 4095 so i can use generalize the code with others boards when needed.. the x axis will be the number of samples from 1 to 400 and the y axis is the actual value of the adc specific input. I appreciate your cooperation.
 
Top