недеља, 15. мај 2016.

Added Headlights to the toy car

Added Headlights to the toy car

This is a followup of my previous post.
The next post is this.

I have had some spare time, so I decided to add front headlights to the toy car. I have used white LEDs:



I have connected LEDs to two GPIO ports (GPIO 21 and GPIO 20) and added the following net protocol commands to turn them on/off:

  • FLL - forward left light on
  • FRL - forward right light on
  • FLL! - forward left light off
  • FRL! - forward right light off

The Python code that receives commads over net is this:

elif text == 'FLL':
  GPIO.output(PORT_FLL, 1)
elif text == 'FRL':
  GPIO.output(PORT_FRL, 1)
elif text == 'FLL!':
  GPIO.output(PORT_FLL, 0)
elif text == 'FRL!':
  GPIO.output(PORT_FRL, 0) 

Here is the movie in which I turn on/off lights:






Нема коментара:

Постави коментар

Напомена: Само члан овог блога може да постави коментар.