
Creativita
I am well on the way in the programming of my security camera. Camera servo tracking is enabled for the two servos- the horizontal and vertical axis. When one of the two servos moves to follow movement the alarm will be activated, starting both the Alert and Snapshot scripts. Here are the scripts I have written for the camera:
System On Script
ControlCommand("Security Script 1", ScriptStart)
ControlCommand("Security Script 2", ScriptStart)
ControlCommand("Camera", PauseOff)
Security Script 1*
Servo(D1, 35)
Sleep(1)
Say(Security System Active)
WaitForServoMove(D1)
ControlCommand("Security Script 2", ScriptStop)
ControlCommand("Movement Detected Script", ScriptStart)
*Horizontal axis
Security Script 2*
Servo(D2 ,35)
Sleep(1)
WaitForServoMove(D2)
ControlCommand("Security Script 1", ScriptStop)
ControlCommand("Movement Detected Script", ScriptStart)
*Vertical axis
Movement Detected Script
ControlCommand("Alert Script", ScriptStart)
ControlCommand("Snapshot Script", ScriptStart)
Alert Script
ControlCommand("Alert Script", ScriptStop)
ControlCommand("Snapshot Script", ScriptStop)
ControlCommand("Camera Snapshot", PauseOn)
Say(Security System Off)
Snapshot Script
ControlCommand("Camera Snapshot", PauseOff)
Sleep(2001)
ControlCommand("Camera Snapshot", PauseOn)
Stop Script
ControlCommand("Alert Script", ScriptStop)
ControlCommand("Snapshot Script", ScriptStop)
ControlCommand("Camera Snapshot", PauseOn)
Say(Security System Off)
Continuous Scan Script
ServoSpeed(D1, 35)
: Start
Sleep(100)
Servo(D1, 1)
Sleep(3000)
Servo(D1, 70)
Sleep(3000)
Goto(Start)
Scan Left Script
ServoSpeed(D1, 35)
Servo(D1, 1)
Scan Right Script
ServoSpeed(D1, 35)
Servo(D1, 70)
Scan Stop Script
ControlCommand("Scan Script", ScriptStop)
Servo(D1, 35)
ServoSpeed(D1, 25)
NB: I am unsure what speed the values in the ServoSpeed command represent. The current values are merely estimates
There are all the scripts neccessary for the camera functionality. There are others but they are simply for the joystick and other components.
After a while I decided that I would use a joystick to start and stop certain scripts, toggle the pause on the camera and camera snapshots and also to rotate the two servos. But because of the commands I have used in the Security Script when I overide the camera servo tracking it activates the alarm. I could just stop the script every time I wanted to rotate it but I will wait until DJ includes the Motion Found and Lost functions of the Camera.
Here is the file for my camera, Security Camera (Updated).EZB
I'd like to take a look at this maybe tonight
Thanks
I had the idea of mounting the camera and servos on tracks. I plan to abandon the scan left and right scripts and replace them with pan left and right. Where would I purchase these tracks and what would be most effective method of moving the camera along them?
Tracks? Like a train?
I see it more like a single rail
Ah I see. Hmmmmmmmmm
A single rail that would have teeth? And then a gear that will move. You can do it that way.
Or, attach it to a rubber band with a pulley on oneside, and a servo on the other.
How long would the rail be?
I think the pulley concept would be easier. I was planning to make the rail one to three metres in length. I would like to have it circular in shape but I think that would be more difficult with the rubber band. Perhaps I could use guides