
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:Code:
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.
Project showcase is for a video/pics of a working robot (i.e. project)
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?