Hello,
I'm using the serin commando to recieve 4 karakters like "2560"
now i need to convert this four karakters to the decimal value 2560
has any body a idee.
SERIN2 is no option!!!
Printable View
Hello,
I'm using the serin commando to recieve 4 karakters like "2560"
now i need to convert this four karakters to the decimal value 2560
has any body a idee.
SERIN2 is no option!!!
Hello NL2TTL,
N>>I'm using the serin commando to recieve 4 karakters like "2560"
now i need to convert this four karakters to the decimal value 2560
has any body a idee.<<
since is is always a 4 character situation... use the dig command.
PSUEDO code:
Decimal var word 'byte is no good, because you are using 4 digits
counter var byte
Decimal=0
For counter= 3 to 0 Step -1
Number=Data Dig counter
Decimal=Decimal + (Number *(10^counter))
Next counter
SerOut Decimal (a decimal representation of your 4 numbers.)
I am at work, so I cannot give you the exact working code. but the above is very very close.
DWayne
PBP already handle it for you
SERIN2 Serpin, Baudrate,[DEC4 MyVar]