I bought a pair of PIR detectors 'tother week, however have been pretty busy recently.
This afternoon i got them on board!
So the PIR sensors are mounted on a box, pointing at 90degrees to each other. They are effectivley covering a "left quadrent" and a "right quadrent".
i have arranged the code so that if the Left PIR sensor is activated, the Horizontal constrains are rewritten as "centre, to "rightmost limit". If the Right PIR sensor is activated, the constraints are rewritten at "centre, to left-most"
So in summary, the laser now wiggles in one of two boxes, one on the left or one on the right: the one the cat ISNT in.
it works with me wandering around the room, so now i need to go and find a cat.....
(im quite tempted to solder this project up on veroboard as a "shield" :) im pretty pleased with it.
though if i soldered it up, i wouldnt be able to "add features" as easily anymore)
**************** ^ ^ Update ^ ^ ******************
Having run the batteries down on a cheapo laser pen, i decided to break it up and pinch the laser diode. The cat LOVES (Hates) it.
So i took a Model sized servo, and onto the Arm, glued a mini servo, which i got with my Oomlout ARDX kit. Onto the mini servos arm, i attatched the Laser LED.
Now i have a two axis pointer thingy! It has gone through many itterations, and ive learnt alot! starting off just getting it to move! moving onto:
- "random" movement
- variable speed movement (rather than as fast as the servo can)
- adding "constraints" to the motion within the program
- referenceing potentiometer values for the constrains
- adding an Xbox thumbstick controller to move the pointer
- modifying the thumbstick code, so that rather than returning to centre upon stick release, it stays where it is (like a FPS game)
- Toggle between two modes using button (thumbstick) press
Now it starts at centre, static. Clicking the stick toggles to "constrain mode (1)". In this mode, you draw a box (using the thumb stick), and then clicking the stick, returns it to "random movement cat annoyance mode (0)", which makes random movements, at random speeds with random delays, while staying within the constrains defined in mode 1.
I reccomend this as a good beginner project, as getting it going is easy, but every addition makes it more and more complex!
also, unlike the rover, it doesnt require any batteries to be constantly charged and recharged, or space to drive around on.