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
Ability to Fly:
Hurling yourself towards the ground, and missing.
Engineers that Contribute to flying:
Both optimists and pessimists contribute to the society. The optimist invents the aeroplane, the pessimist the parachute
Pilots that are Flying:
Those who know their limitations, and respect the green side of the grass...
Bookmarks