From e10ab07515b65a21f24117b7aaffa6ed1fb9fb14 Mon Sep 17 00:00:00 2001 From: Josh Stewart Date: Mon, 4 Feb 2013 17:43:15 +1100 Subject: [PATCH] Initial creation of repo --- kartduino.ino | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 47 insertions(+) create mode 100644 kartduino.ino diff --git a/kartduino.ino b/kartduino.ino new file mode 100644 index 0000000..9e9f639 --- /dev/null +++ b/kartduino.ino @@ -0,0 +1,47 @@ + +//************************************************************************************************** +// Config section +//this section is where all the user set stuff is. This will eventually be replaced by a config file + +/* +Need to calculate the req_fuel figure here, preferably in pre-processor macro +*/ +#define engineCapacity 100 // In cc +#define engineCylinders 1 // May support more than 1 cyl later. Always will assume 1 injector per cylinder. +#define engineInjectorSize 100 // In cc/min +#define engineStoich 14.7 // Stoichiometric ratio of fuel used +//************************************************************************************************** + +int req_fuel = ((engineCapacity / engineInjectorSize) / engineCylinders / engineStoich) * 100; // This doesn't seem quite correct, but I can't find why. + +// Setup section +int triggerPin = 5; +int triggerTeeth = 12; +int triggerMissingTeeth = 1; +int triggerOffset = 120; + + + +void setup() { + int thisPin; + // the array elements are numbered from 0 to (pinCount - 1). + // use a for loop to initialize each pin as an output: + for (int thisPin = 0; thisPin < pinCount; thisPin++) { + pinMode(ledPins[thisPin], OUTPUT); + } + + +} + +void loop() { + // loop from the lowest pin to the highest: + for (int thisPin = 0; thisPin < pinCount; thisPin++) { + // turn the pin on: + digitalWrite(ledPins[thisPin], HIGH); + delay(timer); + // turn the pin off: + digitalWrite(ledPins[thisPin], LOW); + + } + +