# Arduino Files for HomeScope's Z axis In HomeScope the Arduinos (Z and also XY) work as a **2-State automata** which has two states: (i) `listening`, (ii) `actuating`. In the case of Arduino Z, `actuating` state means to move the Stepper Motor by means of an EasyDriver controller. When the Arduisno is in the `listening` state, it waits for commands from the user via push down buttons and/or the GUI program running on the Raspberry Pi and listenining to it via its GPIOs. ## Z control but with No ranges and no GUI The most basic version of the code only listens to the the user via two push-down buttons. This version corresponds to the file: > `Arduino_Z_no_GUI_noRanges.ino` ## Z control with ranges but no GUI An important add on to the frame is to have Range breakers to make sure the the Z range of movement stays within a fixed interval and the Stage does not collide with the bottom and top of the frame. This is done by adding range sensors which ground pins upon contact and break the circuit. > `Arduino_Z_no_GUI.ino` ## Z control with ranges and with GUI messages via GPIOs Finally, to control the focussing from the Raspberry Pi computer, we can send messages via the Arduino's GPIOs via a GUI opn the Pi. The pins of the Pi, need to be grounded and logic level conversion must be used. The full code then is: > `Arduino_Z.ino` To understand the codes listed here visit [Arduino Z hacks](https://git.xinstitute.org.cn/Biology_Laboratory/Arduino_Z_Hacks)