Welcome Anonymous
Fledgling
Fledgling
It is currently Fri Jun 23, 2017 6:15 pm

All times are



Post new topic Reply to topic  [ Array ]  Go to page 1, 2, 3  Next
Author Message
PostPosted: Thu Apr 22, 2010 1:50 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Jan 29, 2010 1:04 pm
Posts: 7452
Location: Northern Minnesota
I added this subforum under "Homebrew Help, Tips, Questions and Answers for those of you that dabble in programming Gary's SS board. Feel free to share your programs and discuss them here.

_________________
Homebrew Reference Site
My Calendar Store
My Land


"Wilderness to the people of America is a spiritual necessity, an antidote to the high pressure of modern life, a means of regaining serenity and equilibrium."
- Sigurd Olson


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 16, 2010 2:36 pm 
Offline
Galapagos
Galapagos

Joined: Sun Jan 31, 2010 9:02 pm
Posts: 114
Is there a way to tab the lines of code? I have tried tabs and spaces, cut and paste, etc and it always right justifies the code which makes it harder to read.

Thanks


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 16, 2010 2:56 pm 
Offline
Site Admin
Site Admin
User avatar

Joined: Fri Jan 29, 2010 1:04 pm
Posts: 7452
Location: Northern Minnesota
You could indent using '................' I suppose. Either that or you could take a screen shot of the code in an image file format and post it that way. You could also separate blocks of code with line spaces. Just some quick random thoughts that come to my simple little mind. Maybe others who have done it who have a better way, will chime in.

_________________
Homebrew Reference Site
My Calendar Store
My Land


"Wilderness to the people of America is a spiritual necessity, an antidote to the high pressure of modern life, a means of regaining serenity and equilibrium."
- Sigurd Olson


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 16, 2010 6:14 pm 
Offline
King
King
User avatar

Joined: Tue Feb 16, 2010 3:20 pm
Posts: 482
Just a test to see if it comes out right when posted...
Code:
'S40 fast hack Bowgod02 4_ 1_ 2010

low 0 'cam power button
low 1 'cam shutter
low 2 'walk test LED
low 4 'fast hack wire
disablebod 'this turns off brown out detection to save power
pause 5000


warmup:

high 4      'connect lens cover control
pause 100
high 2      'turn on led to indicate warm-up mode
pause 1000
high 0      'push camera power button
pause 500
low 0       'release power button
pause 8000  'camera on for 8 seconds to charge flash
low 4       'release lense cover control
pause 500
high 0      'push camera power button
pause 500
low 0       'release camera button
pause 1000
low 2       'warm-up led off
pause 3000


walk_test:

w0 = 300          '30 seconds
Do While w0 > 0   'walk test lasts till timer is timed out
If pin3 = 1 Then  'pin3 goes to the PIR, when PIR detects motion...then...
high 2            'light walk test LED to show detection
pause 1000        'keep LED on for 1 second
low 2             'turn walk test LED off
pause 100
w0 = 300          're-start timer from beginning if motion detected
pause 3000        'wait for PIR to settle
Else              'if no motion is seen this time, still count down the timer anyway
Low 2
End If
Pause 100
w0 = w0 - 1       'deducting from walk test time
Loop              'keep the walk test running till timed out
pause 100

high 2            'blink walk test LED to show walk test over
pause 1000        'LED on time
low 2             'turn LED off
pause 1000        'wait
high 2            'blink walk test LED to show walk test over
pause 1000        'LED on time
low 2             'turn LED off
pause 1000        'wait




standby:

W1=12000                           'refresh camera flash interval one hour
do while w1>0
if pin3 = 1 then goto take_picture 'pir triggered
Nap 4
W1 = W1 - 1
Loop
if w1=0 then refresh




refresh:

high 4          'connect lense cover control
pause 100
high 0          'push power button
pause 500
low 0           'release power button
pause 5000      'camera on to charge flash for 5 seconds
low 4           'release lense cover control
high 0          'push power button
pause 500
low 0           'camera off
W1 = 12000      'refresh interval 1 hour
pause 1000
goto standby



take_picture:

high 4
pause 100
high 0
pause 300
low 0 'release power button
pause 2000
high 1 'push shutter button
pause 500 'hold down shutter button
low 1 'release shutter button
W0 = 300 '30 seconds
pause 3000
Do While W0 > 0
If pin3 = 1 Then 'if the pir detects motion, then...
high 1 'push shutter button
pause 300 'hold shutter button down
low 1
W0 = 30 'restart timer because motion was detected
pause 3000 'wait for pir to settle

else

Pause 100
W0 = W0 - 1 'detucting from camera on time
endif

Loop 'keep running till timed out

low 4
pause 300
high 0 'hold power button
pause 500
low 0 'release power button camera off

W1 = 12000 'reset refresh timer

pause 1000

goto standby


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 16, 2010 6:16 pm 
Offline
King
King
User avatar

Joined: Tue Feb 16, 2010 3:20 pm
Posts: 482
Doesnt come out bad at all. I'm liking this new sub folder and I hope more guys will try it out. Buckshot.... go ahead and save that code if you'd like. Thats the one I used for my brew board for the fast hack.


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 16, 2010 6:30 pm 
Offline
Galapagos
Galapagos

Joined: Sun Jan 31, 2010 9:02 pm
Posts: 114
Which control board is that code for bowgod02?


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 16, 2010 7:07 pm 
Offline
King
King
User avatar

Joined: Tue Feb 16, 2010 3:20 pm
Posts: 482
It was for a board I made myself gkowen.

Image

Image


Top
 Profile  
Reply with quote  
PostPosted: Wed Jun 16, 2010 10:11 pm 
Offline
Galapagos
Galapagos

Joined: Sun Jan 31, 2010 9:02 pm
Posts: 114
Nice job. I am about to make my own control board as soon as I can find a good cheap PIR.


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 17, 2010 3:22 am 
Offline
King
King
User avatar

Joined: Tue Feb 16, 2010 3:20 pm
Posts: 482
I have these ones that I am going to trying on my next build. I have the board half done so I havent tested them out to see how they will do, but they should do fine.

http://cgi.ebay.com/4-pcs-Infrared-IR-P ... 1e5c84d125


Top
 Profile  
Reply with quote  
PostPosted: Thu Jun 17, 2010 1:16 pm 
Offline
Galapagos
Galapagos

Joined: Sun Jan 31, 2010 9:02 pm
Posts: 114
Thanks for the link. At that price, I had to buy.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ Array ]  Go to page 1, 2, 3  Next

All times are


Who is online


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group