Pseudo code for Arduino Mega

The following description outlines a flow chart of code 20 for Arduino Mega. The system is not limited to use Arduino Mega but any Arduino board such as Arduino Uno or a microchip could be used to store code and operate the machine. The replacement of the Arduino board with a microchip is desired to miniaturize the pill dispenser system. The input data such as motor ID, number of pills to be dispensed, and/or time interval from the Android application code 10 is received by Arduino Mega. At the desired and predefined time as read from a real-time clock linked to Arduino Mega, the Arduino code sends commands to turn on motor power and turn the motor driver for a specific degree of rotation to turn the wheel for a specific angle to receive a pill from the pill chamber above and rotate the motor back for the same degrees of rotation to bring the wheel to the prior position and drop the pill below to the pill receiving chamber. If more than one pill is desired, the motor will operate for the same number of times as the desired number of pills.

Leave a Comment

Your email address will not be published. Required fields are marked *