Introduction: Control of Servos With WF32
Remotely control servos connected to the WF32 via a website with login credentials.
Step 1: Load Files Into SD Card
Download the attached file and copy and paste files into a micro SD card that can be inserted into the WF32. These files must be placed into the SD card individually, not as a folder (except for the Images folder). The files inside the folder that is called "Content" are the files for the SD card.
Step 2: Connect Servos to Motor Shield
Obtain a Digilent motor shield (made for the UC32) and connect it to the WF32. The UC32 and the WF32 have the same pin configuration, the only major difference is the wifi chip on the WF32. This program is made to control two regular servos and one continuous rotation servo. The non-continuous rotation servos should be plugged into J16 and J17 while the continuous rotation servo should be plugged into J18 on the motor shield. Be sure to plug the servos in the correct way so that the signal, ground, and Vcc pins on the board correspond to the wires on the servo.
Step 3: Upload Code to Board
Download the attached code. Use MPIDE to edit the code. In the HTTPServerConfig.h tab, find the string where the ssid should be inserted and place the correct ID there. Do the same for the passphrase in its correct location in the code. Plug the board into your computer and upload the code. Once uploaded, open the serial monitor of MPIDE and wait until the WF32 establishes a connection. Once a connection is established, the IP address of the WF32 will be printed to the serial monitor. Ensure that your computer is connected to the same network as the WF32 is. Copy the IP address for the WF32 and paste it into a Chrome browser. The home page should now be displayed.
Step 4: Control the Servos!
Once the home page is loaded, click on the link for controlling the mount. You will be taken to a pins page that shows the state of various pins on the microcontroller. As the code is written, the left and right arrows control the servo on J17. The up and down arrow keys control the servo on J16, and the up and down arrows on the number pad (8 and 2) control the servo on J18. This code was originally written for controller an iPad mount that had pan, tilt, and height adjustments.
Note: pressing the buttons too quickly will overload the stack of the WF32 and cause the connection to fail. Thus press the keys slowly to control the servos. This bug will be fixed in the future.