Move pin setting to start of setup()

This corrects problems with the coils firing randomly upon startup
This commit is contained in:
Josh Stewart 2013-09-24 23:30:45 +10:00
parent 7c1d02209d
commit 534747c245
1 changed files with 5 additions and 0 deletions

View File

@ -59,6 +59,10 @@ int loopCount;
void setup()
{
pinMode(pinCoil, OUTPUT);
digitalWrite(pinCoil, LOW);
//Setup the dummy fuel and ignition tables
//dummyFuelTable(&fuelTable);
//dummyIgnitionTable(&ignitionTable);
@ -77,6 +81,7 @@ void setup()
int triggerInterrupt = 0; // By default, use the first interrupt. The user should always have set things up (Or even better, use the recommended pinouts)
currentStatus.RPM = 0;
currentStatus.hasSync = true;
currentStatus.hasSync = false;
switch (pinTrigger) {
//Arduino Mega 2560 mapping (Uncomment to use)