i got the install done and the engine runs smooth and starts very fast
it revs good but rich for now. i have the kart powering the UNO by the USB.
if i have the UNO powered by the laptop and try to start the kart by that, it does not start
i think i need to power it by the round 12V plug
pretty stocked so far
i notice when the laptop is powering the UNO it will read teh TPS voltage but does not add up the pulse time
it will only add in the first adder but not the rest
byte Hall = 2; // Digital Input pin for rotation sensor, one pulse per revolution
byte injector = 6; // Digital Output Pin for turning on the injector solenoid
byte TPS = A0; // Analog Input Pin for the throttle
int pulse_time; // Duration of injector pulse
int analog_voltage;
void setup() {
Serial.begin(9600);
pinMode(Hall, INPUT_PULLUP);
pinMode(TPS, INPUT);
pinMode(injector, OUTPUT);
delay (100); // wait for fuel pressure
digitalWrite(injector,HIGH); // start primer
delay (10);
digitalWrite(injector,LOW); // end primer
}
void loop() {
while (digitalRead(Hall)==LOW) {} // Do nothing until the sensor goes high
analog_voltage=analogRead(TPS); // engine load by throttle positioning
pulse_time=6; // idle ms
if (analog_voltage>= 150) pulse_time+=4; // adding up fuel by throttle position
else if (analog_voltage>= 250) pulse_time+=4;
else if (analog_voltage>= 350) pulse_time+=3;
else if (analog_voltage>= 450) pulse_time+=2;
else if (analog_voltage>= 550) pulse_time+=1;
else if (analog_voltage>= 650) pulse_time+=1;
else if (analog_voltage>= 750) pulse_time+=1;
else if (analog_voltage>= 850) pulse_time+=1;
else if (analog_voltage>= 950) pulse_time+=1;
Serial.println(pulse_time); // bunch of jibberish to ponder
Serial.println(analog_voltage);
digitalWrite(injector,HIGH); // Turn the injector on
delay(pulse_time); // Amount of time to leave the injector on
digitalWrite(injector,LOW); // Turn the injector off
while (digitalRead(Hall)==HIGH){} // Wait for LOW
} // End of loop()