CE432 2020 Fall
Tutorial 4
John Hitti

jdhitti@fortlewis.edu

Tutorial 5 - Joystick/Stepper Motor
Introduction
In this tutorial

Task 1. Joystick Test
In this task we will test the functionality of the joystick using an Arduino and the example code provided. First the joystick is connected to the Arduino using the configuration shown below.


Once the joystick has been connected and the code loaded onto the Arduino we can use the serial monitor to check the status of the joystick.

The reading below shows the default readings.


The reading below shows the button on the joystick has been pressed


The reading below shows both the x and y directions are maxed out as the joystick has been pushed.


The reading below shows both the x and y directions are maxed out in the opposite direction as the joystick has been pushed.


Task 2. The Open Smart 2.4GHz Transceiver
In this task we will use the Open Smart 2.4GHz wireless transciever to enable two Arduino boards to communicate with each other wirelessly. Our boards will be connected following the below schematic.


Below is an image of the finished connections.


Once the connections have been made we can load the example code onto both the transmitting and receiving Arduino and observe the com port to verify that we are transmitting data.

The data is only being received one character at a time. If we wish to fix this we can use the "concat()" function to concatenate each received character until a specified termination character is received. Using this method in the example code we can receive the full values of the joystick position.



Task 3. Use the received command to control the NEMA17 stepper motor
In this task we take the concepts from both previous tasks and combine them into one. We will be using two Arduinos connected to two Open Smart 2.4GHz wireless transcievers to control a NEMA17 Stepper motor using a joystick. Using the example code provided we are able to add the stepper motor to our current configuration using the A4988 Motor driver.

Using three Li-Po cells to power the driver board we can then control the stepper motor as expected.


Discussion

Overall this tutorial is an excellent introduction into the capabilities of using wireless modules with microcontrollers as well as the function of joysticks. This tutorial also provides a lot of enlightenment into how many modern day joystick controllers may function.