larryatheist
Member
I expected this code to beep every couple of SECONDS, but it took 10 MINUTES.
Any comments on what was going on ? See attachment.
Any comments on what was going on ? See attachment.
#com /dev/tty.usbserial-00001004
#picaxe 14m2
symbol wd_larry = w0
symbol wd_num2 = w1
symbol wd_num3 = w2
init_x:
call bip
wd_larry = 0
wd_num2 = 0
wd_num3 = 0
do
inc wd_larry
loop while wd_larry < 63000
do
inc wd_num2
loop while wd_num2 < 63000
do
inc wd_num3
loop while wd_num3 < 63000
goto init_x
''''
bip:
high b.2
pause 50
low b.2
return
'PIC16F1825 Version
Sub IR_WatchSub
Do
For Current = 1 to Scan
PulseOut Clk, 1 uS 'Clock the 4017
Wait SettleTime uS 'SettleTime defined as 35
If Det1=0 Then
Let OutputTime=Time_Length
Set_DetectSub
End If
If Det2=0 Then
Let OutputTime=Time_Length
Set_DetectSub
End If
If OutputTime > 0 Then
Let OutputTime=OutputTime-1
End If
If OutputTime=1 Then
Clear_DetectSub
End If
Next
PulseOut Rset, 1 uS 'Reset the 4017
Loop
End Sub
'PicAxe 14M2 Version
IR_Watch:
Do
For Current=1 to Scan
High Clk 'Clock the 4017
Low Clk 'Finish the clock pulse
If Det1=0 Then
Let OutputTime=Time_Length
'Set Detect Signal
GoSub Set_DetectSub
EndIf
If Det2=0 Then
Let OutputTime=Time_Length
'Set Detect Signal
GoSub Set_DetectSub
EndIf
If OutputTime > 0 Then
Dec OutputTime
EndIf
If OutputTime=1 Then
'Clear Detect signal
GoSub Clear_DetectSub
EndIf
Next Current
High Rset 'Reset the 4017
Low Rset 'Remove the reset
Loop
Return