-
Notifications
You must be signed in to change notification settings - Fork 0
Arduino Based diagnostic procedure
- Connect non-functioning Arduino to the computer Using a USB B to USB cable.
- Note, Arduino software can be downloaded via this link.
-
Once connected, open Arduino software.
-
Once opened, select File > Open Recent > "Food_hopper_pho"
-Should be located at C:\Common\repo\Food_hopper_pho
-Must be a folder with multiple files. For example, "Common.h"
-
Next, select Tools > Port > COMXX ArduinoXX
-
Select the common.h tab (a text file) and find the line starting with "#define IS_DIAGNOSTIC_MODE"
-
In that line, change "False" to "True", and save the file. Now, you will upload the debugging firmware. The debugging firmware is called "FoodHopperDebug.pde" and can be found here.
The .pde file is used by Processing, a Java-based IDE that the Arduino uses.
- To run the debugger, open the Processing App on your PC (download link found here) and open the FoodHopperDebug.pde file.
- Now, hit Run.
- If the Arduino is connected, a colorful GUI will appear if the Arduino is connected (INSERT IMAGE HERE). No recognized Arduino will show this image (INSERT HERE).
- Once it's open, you should see a colorful GUI with two water panels on the left and two food panels on the right.
-Our lab uses a 0 or 1 system for denoting water & food dispensers. 0 denotes the dispenser closer to the "origin" of the box (or the front), and 1 denotes the dispenser farther from the front, closer to the LabJack.
Now is a great time to test the Arduino's communication to the rest of the dispenser system.
- To control the food-related functions:
-
- Top Button (Repeated normal dispenses) - 4 out of the 5 buttons will cause the dispense to move forward, and one will cause the stepper motor to reverse.
-
- Bottom Button (Unjamming)- "Tick tock" feature goes back and forth, and simple reverse causes stepper to consistently spin backwards.
-
- Auto dispense toggle, dispenses every 5 sec.
- To control water functions:
-
- Open or close Solenoid by clicking on the Solenoid icon (will toggle to keep it permanently open or close).
-
- "Normal dispense" executes a normal 300 ms open/close of the Solenoid.
-
When finished, close debug software.
-
Return to Arduino code common.h
-
Find the line starting with #define IS_DIAGNOSTIC_MODE, and change "True" back to "False".
-
Save the file.
-
Upload firmware by clicking the upload button (INSERT IMAGE HERE)
-
Do NOT unplug Arduino while firmware uploads (while the upload button is yellow)
-
After upload, you may unplug the USB and reconnect Arduino to behavioral box.