Data Sheet
Core Spartan Documentation Modern Robotics, Inc
Version 3.0.3 Page 2
Contents
1. Document Control ................................................................................................................. 4
2. Description ............................................................................................................................. 5
3. Express Installation via Ardublockly for Spartan ............................................................... 6
3.1. Installation of Ardublockly for Spartan (Windows Only) .................................. 6
4. Manual Installation of Core Spartan Resources .................................................................. 7
4.1. Installation of Library via .zip ............................................................................... 7
4.2. Installation of the Board via Arduino Board Manager ....................................... 9
4.3. Testing Installation of Library and Board ......................................................... 12
4.4. Using your Spartan .............................................................................................. 14
5. Modern Robotics Spartan Coding Methods ....................................................................... 15
5.1. Modern Robotics Header .................................................................................... 16
5.2. Include Statements .............................................................................................. 17
5.3. Object Declarations ............................................................................................. 17
5.4. Setup ..................................................................................................................... 18
5.5. Loop ...................................................................................................................... 19
5.6. Add your own functions ...................................................................................... 20
6. Core Spartan Controller (45-2000) ................................................................................... 21
6.1. Core Spartan Controller Information ................................................................. 22
6.2. Servos ................................................................................................................... 24
6.3. Motors ................................................................................................................... 26
6.4. Core Reset............................................................................................................. 28
6.5. Core LED ............................................................................................................... 28
6.6. I2C Address .......................................................................................................... 28
7. Serial Communication ......................................................................................................... 29
8. Three Wire Analog & Digital Sensors ................................................................................ 30
8.1. Program Control Button (45-2002) ................................................................... 31
8.2. Rate Gyro (45-2004) ........................................................................................... 33
8.3. Optical Distance Sensor (45-2006) .................................................................... 34
8.4. Touch Sensor (45-2007) ..................................................................................... 35
8.5. Light Sensor (45-2015) ....................................................................................... 36
8.6. Magnet Sensor (45-2020) ................................................................................... 37
9. Four Wire Digital I2C Sensors ............................................................................................ 38
9.1. I2C Class ............................................................................................................... 39










