as per your suggestions...
I organized it up a bit. The blinky no worky, so I went back to the simple toggle. I aliased everything that I could. Looks better but works the same. Any suggestions?
'* Name : relay4.BAS
'* Author : lloyd778
'* Notice : Copyleft
'* : No Rights Reserved
'* Date : 7/12/2006
'* Version : 1.0.25(+/-)
'* Notes : for Olimex 4 relay board (PIC I/O) 16F628A
'* Relay board incantation #25 at least
' Use of chicken bones and water buffalo entrails show no
' substantial improvement so far.
pause 50
define OSC 20
CMCON = 7 ' digital I/O
TRISA = %00010000
TRISB = %00111001
LED var portb.5
Saw var porta.3
Light var porta.1
Feed var porta.2
Vac var porta.0
Switch var portb.0
counter var byte
counter1 var byte
loop:
toggle led 'Power LED shows cycle time
if switch = 1 then ' Switch is OFF
gosub sub1
else 'otherwise it's ON
gosub sub2
endif
Goto Loop
sub1:
low saw
gosub delay
low feed
gosub delay
low light
gosub delay
low vac
goto loop
sub2:
high vac
gosub delay
high light
gosub delay
high feed
gosub delay
high saw
goto loop
delay:
counter=32
repeat
pause 50
counter=counter-1
until counter=0
return
end
Glad you got it working !
Quote:
Originally Posted by lloyd778
' Use of chicken bones and water buffalo entrails show no
' substantial improvement so far.
You needed BLACK CAT BONES, and some HIGH JOHN THE CONQUERS ROOT AS WELL! OH AND A CHICKEN FOOT TOO! In liew of actual working code.
As a woodworker I say; Good Idea ! :-)
Edit: in retrospect, I think this device should be configured as a slave to the power tools magnetic power switch, Darn those sharp cutters, I think I would not trust a PIC with my fingers!
So the real question is . . .
Quote:
Originally Posted by niels
I'd trust a PIC- the real question is would you trust the code. A big red mechanical 'kill-power' button in series with the saw wouldn't be a bad idea.
It is not the pic or code per-se' I don't trust, it's power surges, stray capacitance, you name it . . . gremlins, I'm just saying when my fingers are near the moving parts, I want the isolation of an unpowered relay protecting them. I have more scars than Tim Allens Charactor Tim THE TOOLMAN, and still lucky enough to count to ten.
Now all that said I stayed up till 4:00 am making a program do exactly what he wanted as the whole thing intrigued the heck out of me! So the real question is :
Who's having fun out here?