Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Parallel Port Trigger
#9
Function DecToBin
Code:
Copy      Help
;/
function i str&sBin

;Converts from decimal (base-10) number to binary (base-2) number, eg 5 to "101".
;Although there are 32 bits, leading 0 bits are trimmed.

;EXAMPLE
;str s
;DecToBin 5 s
;out s


sBin.all(32)
itoa i sBin 2
sBin.fix

Function DecFromBin
Code:
Copy      Help
;/
function# $sBin

;Converts from binary (base-2) number to decimal (base-10) number, eg "101" to 5.

;EXAMPLE
;int i=DecFromBin("101")
;out i


if(!sBin) ret
ret strtoul(sBin 0 2)

-------------

I don't know how parallel port works more than i can read in http://logix4u.net/Legacy_Ports/Paralle ... acing.html


Messages In This Thread

Forum Jump:


Users browsing this thread: 1 Guest(s)