fingerstyle86
New Member
Hi guys does anyone know how to make your pins count in BINARY or BCD?By using the output pins 0 - 3 (Example : 0011 - 3low 2low 1high 0high)
Thanks guys!Cheers!
Thanks guys!Cheers!
#Picaxe 18x
b0 = 0
Do
Pins = b0
Pause 300 'display for 0.3 seconds
If b0 = $99 Then 'That's really BCD 99
b0 = 0 'Reset to 0
ElseIf bit0 = 1 and bit3 = 1 Then 'Ie If lower nibble of b0 = %1001 = 9
b0 = b0 + 7 '9 + 7 = 16 = %10000 = BCD 10
Else
Inc b0
EndIf
Loop