Motor control
There is a stepper motor driving the Drinkmotizer table via a drive belt. With CNC applications, directly coupling a stepper motor to the drive shaft is never a good idea. Most stepper motors are not designed to handle lateral forces. Although this is only driving a small platform and a cup, there still is resistance.
The Arduino receives the serial drink protocol (Recipe) from the Raspberry Pi and controls the motor routine based on the recipe. We are using the Centipede shield to expand the I/O of the Arduino Uno. The Centipede Shield uses the Wire I2C interface on analog pins 4 and 5 of the Uno to provide 64 general purpose I/O pins. The program starts off with importing the libraries. The Centipede shield comes with a library that is imported along with Wire.h library in order to communicate with I2C devices. The SoftwareSerial.h Library is imported to allow serial communication from the Pi. We then setup all the variables and subroutines.