Solar tracker with bs2 & ds1302 & linear actuator
adobejoe
Posts: 17
I am trying to construct a solar tracker that will rotate panels based upon time of day. Basically activate in 8 forward steps and retract at midnight. Have edited the demo program by Chris Savage, but it needs some work. I think I am on the right track, but it needs a do loop or two? This is my first attempt in a long time from programming. Like BASIC and FORTRAN in the 1980's Andy
Comments
Welcome to the Parallax·Forum
You have a few problem with what you have
When you use the DS1302 Time Chip you·have to· [noparse]/noparse][color=red]WrBurst[/color][color=white]·[/color]or [color=white]·[/color][color=red]RdBurst[/color
with all of the all of the ·registers· [noparse]/noparse][color=red]secs, mins, hrs, date, month, day, year[/color
·SHIFTOUT DataIO, Clock, LSBFIRST, [noparse][[/noparse]WrBurst]
· SHIFTOUT DataIO, Clock, LSBFIRST, [noparse][[/noparse]secs, mins, hrs,
Or
·SHIFTOUT DataIO, Clock, LSBFIRST, [noparse][[/noparse]RdBurst]
· SHIFTIN DataIO, Clock, LSBPRE, [noparse][[/noparse]secs, mins, hrs, date, month, day, year]
·Now if you just want read one or two··registers· then you have to write it this way
·SHIFTOUT DataIO, Clock, LSBFIRST, [noparse][[/noparse]WrSecs, Wrmins Wrhrs]
·SHIFTOUT DataIO, Clock, LSBFIRST, [noparse][[/noparse]secs ,mins, hrs]
Or
SHIFTOUT DataIO, Clock, LSBFIRST, [noparse][[/noparse]RdSecs, Rdmins, Rdhrs]
· SHIFTOUT DataIO, Clock, LSBFIRST, [noparse][[/noparse]secs, min, hrs]
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 2/7/2010 12:29:10 AM GMT
·Revised somewhat. In your attached file DS1302-Demo.bs2 I show diferrent pin assignments for Data I/O =pin 6 and Clock =pin 7 from what I find on the Maxim pin configuration chart? I am trying to place my subroutines in the order they will be executed. 1)RTC_OUT (initializatino routine) 2)Set_Time (But I think there should be a DEBUG...something here to allow keyboard input?), 3)Get_Time (the first thing executed in the DO loop), then the comparators to time to If..THEN operate my solenoid).
Andy
Can you post some pic's and a schematic of your project when you get a chance ?
Rob7
I hope this helps
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
··Thanks for any··that you may have and all of your time finding them
·
·
·
·
Sam
Post Edited (sam_sam_sam) : 2/13/2010 4:18:37 PM GMT
Okay I modified my code, but when I try to run this the very first I/O line is highlighted and I get " Expected ':' or end-of-line." So, from my manual, it mentions colons are placed after labels. I know this is probably a very simple error, and I feel my intelligence is pretty narrow. The logic I can understand in programming; the syntax is killing me. Anyway, attached is a photo of what I am trying to accomplish. Anyone familiar with tracking solar (PV) will appreciate the advantages, particularly in a windy are, like Wyoming.
Any input appreciated.
Andy
However, If you have clouds, you will have falth signals.
Best to rotate by calculating sun location (for this is quite complex math involved and programming must be at high level of knowledge)
I like "adobejoe" idea. And I came to this idea also, and reviewing it as I am building mechanics for my Solar Tracker.