devil6600
Full Member level 5
![Full Member level 5](/styles/images/ranks/flevel2.gif)
hi everyone,
i am using picbasic to read pulse from a pin.
i am able to read pulse but this pulse is in the form of character, now i want to convert this character to a numeric value, how to do it? for example in the below code if i get b0 variable value as 'D' (letter D) then how to convert it to number. As you can see i am using # sign to convert it to number for serial output, but i need to know this number before outputting.
thanks
i am using picbasic to read pulse from a pin.
i am able to read pulse but this pulse is in the form of character, now i want to convert this character to a numeric value, how to do it? for example in the below code if i get b0 variable value as 'D' (letter D) then how to convert it to number. As you can see i am using # sign to convert it to number for serial output, but i need to know this number before outputting.
Code:
INCLUDE "modedefs.bas"
b0 var byte
main:
pulsin portb.6, 1, b0
SEROUT portb.4,N9600,[#b0,10]
GOTO main
thanks