Wednesday, January 26, 2011

The toy project, still!!!

so the main focus again in class was working on our toy project but to do so we had to learn a bit more about transistors and the micro controller so we did another experiment with our bread board.
we had to use a 2N3904 transistor to light a 200 mA incandescent bulb.
we cannot light the bulb directly since it would cause the processor to overload and consequently shut down.  But still the 2N3904 transistor cannot handle high mA currents required to light the bulb and it gets hot so instead we used a TIP41 which handles currents up to 6mA.
the codethat i used to light the bulb was
main:
         high 1
         pause 500
         low 1
         pause 500
goto main

(sorry my dear fans but i forgot to take a picture)
then i messed with my toy some more and i got the motors under my control.
and with this code:
main:
         high 1
         pause 100
         low 1
         pause 100
goto main

here's what it does:

No comments:

Post a Comment