Skip to content

Arduino Code for food and water dispense

Antwan-Green edited this page Aug 16, 2024 · 4 revisions

Common.h

This file defines commonly used commands by the Arduino, including:

  • Interface for editing and diagnostics
  • LabJack Interface
  • Parameters for food motor movement (direction, rotation in degrees, etc)
  • Parameters for solenoid opening/closing (duration open, how long to remain closed after opening, etc)
  • State of BeamBreak (clear or broken)
  • Time since the last BeamBreak change
  • Diagnostic Modes (constantly dispensing water or constantly rotating motors)

Diagnostics.h

This file encodes the various functions that allow lab members to examine the function of the motors and solenoids. Functions include the ability to:

  • Store data received from USB as a diagnostic value.
  • Use said value to either command rotation of each food motor individually, using different methods to unjam motors, or command solenoids to remain open for long periods to see if the solenoid is receiving signal.
  • At the end of diagnostic testing, print the state of the water and food beam break sensors.

Food_Dispenser.h

This file encodes the function of the stepper motors, outlining the parameters necessary for their function. Some parts of this code include the ability to:

  • Time dispenses based on prior activation.
  • Check the status of beam break sensors to ensure the latency period is followed.

Food_hopper_pho.ino

Clone this wiki locally