Hello,
First, I'm new in programming ClassPad BASIC.Â
For a project I implemented a code into an AVR which emulates the ClassPad communication protocol. After that and some adc-code, the microcontroller puts out the voltage as an UART string every two seconds. The ClassPad receives this string without any problems but of course it's not possible to calculate with a string.
Is there a possibility to convert a string into a number to calculate with?
In C there exists atoi to do this.
I will go on trying some other ways (e.g. all calculations could be done by the AVR) but I think it's better if the calculations are done by ClassPad.
Maybe I have to switch to C++ to build a ClassPad Add-In but this should be the last way .
Thanks for answers
serverone
Convert String To Number
Started by
serverone
, Sep 16 2009 08:58 PM
2 replies to this topic
#1
Posted 16 September 2009 - 08:58 PM
#2
Posted 24 September 2009 - 07:55 PM
strToExp(
#3
Posted 28 September 2009 - 06:59 AM
Thanks DrCoyote,
I solved it another way:
"adc" contains the string to convert (only numbers); z ist the numerical order of "adc".
I wasn't sure, if "strToExp(" could handle this type but I'll try this command.
I solved it another way:
StrLen adc, l 1 => i 0 => z While i < l+1 ChrToNum adc, b, i 10*z+(b-48) => z i+1 => i WhileEnd
"adc" contains the string to convert (only numbers); z ist the numerical order of "adc".
I wasn't sure, if "strToExp(" could handle this type but I'll try this command.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users