Wednesday, January 26, 2011

Toy Hacking

In programing the toy,  I first built a circuit suitable for a LDR and a motor port controlled by the LDR.  The system had a Darlington system so it could supply enough power through out the whole circuit.  The motor with the LDR work in a way that as light befalls the toy it remains motionless and when the child gets close enough, the toy moves its mouth. 


























In the programming....
main:
         readadc 4,b0
         ;debug
         if b0>120 then top
         if b0<70 then bot
         low 1
         low 2
goto main
top:
         high 1
         low 2
goto main
bot:
        high 2
        low 1

......I created a loop system where if the LDR reads above 120 the toy is motionless and if it drops below 70 the toy's mouth moves.  I did it this way so the child can react to the toy when face to face.

No comments:

Post a Comment