Data Sheet

Core Spartan Documentation Modern Robotics, Inc
Version 3.0.3 Page 32
int delayedStart(void)
If delayedStart() is called and the button is not connect to D2, the function
returns -1, otherwise it returns 0. When the delayedStart() function is called,
Core Spartan Controller will wait inside that function until the PCB is pressed. At
this point the button acts as a start button and the LED will be blinking. Once the
button is pushed the program will start the next line of code after the
delayedStart() call. The LED is now off and the button acts as an immediate stop
and reset button. When the button is triggered The Core Spartan Controller will
reset the onboard chips and the program returns to the delayedStart() function
after resetting the board. This function is all that is needed to make the PCB
work as the program control button.
PCB.delayedStart();
* delayedStart() must be called first in the setup before any initializations*
char read(void)
This allows the user to read the current state of the button by returning a
character to the user. DO NOT change the I/O status of the port. The button can
be used on any digital port as long as delayedStart() is not being used on that
sensor.
unsigned char value;
value = PCB.read();
…or…
Serial.print(PCB.read());
void writeLED(int value)
This allows the user to easily write to the LED on the PCB sensor. The variable
value takes the type of an integer and it is either a 0 or a 1. DO NOT change the
I/O status of the port. The button can be used on any digital port as long as
delayedStart() is not being used.
PCB.writeLED(OFF);
…or…
PCB.writeLED(ON);