ZiBaT => Peter Levinsky => IoT=> exercise

PWM & Joystick with Raspbery Pi

Updated : 2017-02-01


Pulse-Width Modulation & KY-023 XY-axis joystick module

Idea: To have the raspberries running and be able to control the LED light using PWM and reading the joystick, especially back, forth, left, right

Background: Previous exercise Startup.htm & Slides : ( pdf | pptx )  

Hint to find the RaspBerryPi - use PiFinder : https://github.com/adafruit/Adafruit-Pi-Finder


Step 1 : Set up experiment

Set up the R-Pi to use the LED light (see Controlling a RGB led with your Raspberry Pi), Try it agian to see it works.

 

Step 2 : Use the Pulse-Width Modulation for the LED

Program the R-Pi to use PWM for the LED light - see http://raspi.tv/2013/rpi-gpio-0-5-2a-now-has-software-pwm-how-to-use-it

Experiment with different values for Frequence and Duty.

 

Step 3 : Set Up the R-Pi to use the Joystick / Game-controller

For information of the Joystick see

 

Step 4: Make a Python program

Program the R-Pi to read the sensors from Joystick, Back, Forth, Left, Right and print out the states.

Extra: setup and read the push part of the button