Ejemplo n.º 1
0
bool InitDisarmFSM ( uint8_t Priority )
{
  ES_Event ThisEvent;
	
	PortFunctionInit(); //initialize pins PA2-5, PB2-3, PD7, PF0 as GPIO
	initTapeSensors();  //initialize tape sensor
	initPhototransistor(); //initialize phototransisor
	initMotors();				//initialize motors
	initializeServos(); //initialize servo motors
	LEDShiftRegInit();  //initialize LED shift register
	LCDInit();					//initialize LCD display
	InitAdafruitAudioPortLines();	//initialize audio 
	initArmedLine();
	
  MyPriority = Priority;
  CurrentState = Armed;
  ThisEvent.EventType = ES_INIT;
  if (ES_PostToService( MyPriority, ThisEvent) == true)
  {
      return true;
  }else
	// if initialization failed
  {
      return false;
  }
}
Ejemplo n.º 2
0
task main(){

  initializeServos();

  //waitForStart(); //enable for Samantha

  do{

	  getJoystickSettings(joystick); //gathers joystick input

	  processWheelMovement();

	  processDispenserMovement();

	  processScoringMovement();

	}while(true); //This loop never ends
}