Tab #7 Setup
void setup()
{
/*
* Template for state/container BITs is as follows:
* xxStartBIT
* xxInitializeBIT
* xxInProcessBIT
* xxCompleteBIT
* wwFaultBIT
*
* The FADEC states/containers are as follows:
*
* 0 - Ready
* 1 - Purge
* 2 - Start
* 3 - Idle
* 4 - Accel
* 5 - Run
* 6 - Decel
* 7 - Coastdown
* 8 - Stop
*/
// put your setup code here, to run once:
Serial.begin(9600);
/****************************************************
pinMode(FADECstartPB_pin, INPUT);
pinMode(FADECinitializePB_pin, INPUT);
//We tie these inputs true and pressing the button brings them false.
digitalWrite(FADECstartPB_pin, true);
digitalWrite(FADECinitializePB_pin, true);
//At machine startup, all containers are initialized and in their home positions.
digitalWrite(ReadyInitializeBIT, true);
digitalWrite(PurgeInitializeBIT, true);
digitalWrite(StartInitializeBIT, true);
digitalWrite(IdleInitializeBIT, true);
digitalWrite(AccelInitializeBIT, true);
digitalWrite(RunInitializeBIT, true);
digitalWrite(DecelInitializeBIT, true);
digitalWrite(CoastdownInitializeBIT, true);
//digitalWrite(StopInitializeBIT, true)
***********************************************************/
pinMode(FADECwhite_pin, OUTPUT);
pinMode(FADECorange_pin, OUTPUT);
pinMode(FADECgreen_pin, OUTPUT);
pinMode(escsigout_pin, OUTPUT);
pinMode(startswled_pin, OUTPUT);
pinMode(startswsig_pin, INPUT);
pinMode(estopsig_pin, INPUT); //TR - added since it was missed in KU code
pinMode(oilokay_pin, INPUT);
pinMode(ignctl_pin, OUTPUT);
pinMode(startfuelsol_pin,OUTPUT);
pinMode(startengsol_pin, OUTPUT); //Set engine sarter solnoid pin as output
//pinMode(genrlyctl_1_pin, OUTPUT);
//pinMode(genrlyctl_2_pin, OUTPUT);
pinMode(throttlein_pin, INPUT); // Read fuel pump speed/value
pinMode(fuelpwmout_pin, OUTPUT); // Change fuel pump speed/value
digitalWrite(FADECgreen_pin, false);
//STARTER.attach(escsigout_pin); //Starter interrupt is this set in <Servo.h>?
//STARTER.write(85);
/*The number of 85 indicates a contiuously rotating servo motor with the speedd set at 0
when the motor is full speed in one directina and at 180 if the roation is in the opposite direction.
The speed is 90 when the motor is at rest.*/
Serial3.begin(9600);
Serial2.begin(9600);
Serial1.begin(9600);
delay(500);
Serial.println("CONNECTED");
ambienttempoil = int(Athermocouple.readFarenheit());
ambienttempegt = int(Bthermocouple.readFarenheit());
if((ambienttempoil || ambienttempegt ) > 110) //
?
{
ambienttempoil = 80;
ambienttempegt = 80;
}
delay(5000);
temperatureegt = int(Bthermocouple.readFarenheit());
//State/Container funcetion prototypes
void Ready (); //Ready function prototype
void Purge (); //Purge function prototype
void Start (); //Start function prototype
void Idle (); //Idle function prototype
void Accel (); //Accel function prototype
void Run (); //Run function prototype
void Decel (); //Decel function prototype
void Coastdown (); //Coastdown function prototype
void Stop (); //Stop function prototype
//Other functions
void gasfuelvalve(); //TR
void oilread();
}
Thanks, Ron