Show Posts
Pages: [1]
1  Using Arduino / Audio / Re: New library for PWM playback from SD cards: SimpleSDAudio on: January 03, 2013, 09:07:06 pm
Hi, I will try answer some of your questions:

@timberwolf9:
Why the argument -r 64000? If you use a 16 MHz Arduino, it should be 16 MHz / 256 = 62500. But anyway, the sound is just a little bit to slow then...

@bratan & timberwolf9:
I will tell you some internal details about my library: The library uses a ring buffer of 1024 bytes when no work buffer is set manually. As the buffer is filled in one sector blocks of 512 bytes each, the buffer became a ping-pong buffer in most cases. With 512 bytes, at 8-Bit/Mono/62.5kHz that is about 8ms time, because the data reading from sd-card also takes some time, your observation of 5ms max delay between worker()-calls is very realistic.


@Tuttut
"-r 64000" gives reasonably good audio on my arduino uno, it may be my setup that has gone wonk, but when converting using the rate you gave, the audio was always really high pitched and fast moving. So I played around with the terminal options for sox and found that to be a sweet spot where the audio tone and play speed are warm and spot on.

If I read the internals correctly, we could get away with performing micro task once the audio is playing. 704 is not a lot of RAM to play with, but for listening to the network and flashing a light, it may be enough. (704 is more than enough for flashing a light...I would think)

Also, Tuttut, I ran into the 49 error code on my card until I did a FAT format. Once that was done, everything else went smooth as butter.
2  Using Arduino / Audio / Re: New library for PWM playback from SD cards: SimpleSDAudio on: January 03, 2013, 07:48:10 pm
Hi

I'm exited about this library. I might have a troublesome SD Card module.
I keep getting an error code: 49. I cant find out what code 49 is.
If I use Arduino's standard SD example listfiles, I get a correct list of files on the SD card. The SdFat library from http://code.google.com/p/sdfatlib/ also read the SD Card with the same wiring. So the wiring must be correct. And I use SdPlay.setSDCSPin(10); as pin 10 is my CS pin.
Then I commented the line: SPSR |= (1 << SPI2X);
Same result.

My sd module is this one http://www.lipoly.de/index.php?main_page=product_info&products_id=213383

I really hope someone can with this problem.

EDIT ----
It was not the SD Card Module but the SD Card itself. I tried with another one. Now it works.

Just my two cents, I had this same error and was to fix it by reformatting the sd as FAT. You may be able to do the same with your sd, but don't use the quick format or the card will give the same error.
3  Using Arduino / Audio / Re: New library for PWM playback from SD cards: SimpleSDAudio on: January 02, 2013, 09:00:17 pm
Fantastic library, got it working within few minutes!  smiley
Is it possible to play Audio in parallel while Arduino does other things?  I wasn't able to figure out how. I wanted to see if I can dump WaveShield in favor of this library. WaveShield allows me to play Audio regardless of other things I'm doing, which is essential for my Alarm clock (shows time, blinking dots while playing alarm audio file).
I did some testing with SimpleSDAudio and it looks like if delay between calling SdPlay.worker() greater than 5 milliseconds, playback slows down and becomes choppy... Even calling Serial.println ("test") slows down playback noticeably. Here's example of code from loop:
Code:
void loop(void) {
  Serial.println ("running");
  //delay (5);
   if (!SdPlay.isPlaying() ) SdPlay.play();
  // Let the worker work until playback is finished
  SdPlay.worker();
 }
Let me know if there's a trick to it smiley
Maybe buffer can be auto-filled by Interrupt?


Don't quote me on this, but from looking at the code, I think you could do such given that you make a call to the SdPlay.worker() function often enough to keep the buffer filled. I'm not sure how much of the processor is left once playing audio, but it seems you could squeeze in a few other non time dependent things. (Like adding up time or checking for a button and updating its state...simple things)

From what I have gathered, the SdPlay.worker() function reads the next sector of the sdcard into a buffer. So if you call it often enough, you should be okay, just don't ask for anything that needs a ton of resources while playing audio.

Feel free to correct me if I'm wrong, but this is what I have gathered so far.

Edit: Just from playing with the serial I can see what you are saying, but I haven't come up with a solution.
Edit2: If you hear the skip when using serial at 9600, move it to a higher speed. I'm running at 115200 just to see, and there isn't a noticeable skip when using the serial commands in the demo.
4  Using Arduino / Audio / Re: New library for PWM playback from SD cards: SimpleSDAudio on: January 02, 2013, 07:37:56 pm
This is a really good lib. Been playing with it all morning, really should be doing work on my other project, and I've had no problem playing files converted with:
Code:
$ sox inputfile -b 8 -r 64000 -c 1 -t raw outputfile

Good work on getting all this together, I bought an arduino with a few projects in mind, but never thought
I'd be playing music off of the thing. Keep up the awesome progress!
5  Using Arduino / Networking, Protocols, and Devices / Re: Have finally fizzled out working with ethernet...in need of some help on: January 01, 2013, 02:46:42 pm
hmm, give me a bit to wrap my head around this, if i only clear that at the end of the loop, then it would contain the command, given that I possibly reconstruct the appended c part. Alright, given that, why does the LED toggle still?

I'm pretty new to this stuff, but I'm trying, still a few things I don't quiet have a grip on.
6  Using Arduino / Networking, Protocols, and Devices / Re: Have finally fizzled out working with ethernet...in need of some help on: January 01, 2013, 02:07:54 pm
There was a serial function showing the httpRequest, but for some reason it was using c as the string to print, just something I forgot to strip out.

So only set httpRequest to empty at the end of the code, right? I can understand that, but why is "http://myIP/?firmver" not returning 0.1.0 like it should, that part I'm not understanding...
7  Using Arduino / Networking, Protocols, and Devices / Re: Have finally fizzled out working with ethernet...in need of some help on: January 01, 2013, 01:28:00 pm
Code:
        //read char by char HTTP request
        if (httpRequest.length() < 80) {
 
        }
If the length of the request is less than 80, do nothing. Otherwise do nothing. OK, I see why the length matters. Not.

Where does httpRequest ever get assigned a value other than ""?

I set httpRequest back to nothing just making sure it is empty for the next request, but I guess that really doesn't matter....

I'm not sure what the length limit is for, the code I posted is a modified sketch from: http://pastebin.com/CZ6J62qJ for controlling an LED via ethernet. I'm trying to modify it to work for my project, and I'm finding a few rough edges along the way.
8  Using Arduino / Networking, Protocols, and Devices / Have finally fizzled out working with ethernet...in need of some help on: January 01, 2013, 01:17:04 pm
My dad and I are trying to automate the shop using the arduino Uno and the ethernet shield. I've been trying for two days now to figure out why I can't get a reply from "http://.../?firmver" when we request it from the arduino.

Most of the commands won't need to return a value back to the requesting browser, but the firmver and similar commands have places in our web interface that they need to return data. Can someone help and enlighten me as to why this isn't working when "/?firmver" is requested? I'm really new to using the ethernet networking with arduino, but have a few things under my belt, but this isn't quiet making sense to me. smiley-sad-blue

Code:
Code:
//base code from LED ethernet sketch

//modified code by BleedinSarge, customized for ShopMatic application
//NOTE: the web interface is hosted elsewhere due to flash size limits.
#include <SPI.h>
#include <Ethernet.h>
 
byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; //physical mac address
byte ip[] = { 192, 168, 1, 177 }; // ip in lan
byte gateway[] = { 192, 168, 1, 1 }; // internet access via router
byte subnet[] = { 255, 255, 255, 0 }; //subnet mask
EthernetServer server(80); //http server
 
String httpRequest;
 
//string used to parse command from a browser
 
void setup(){
 
  //am limited on IO due to the network card using 4, 10, 11, 12, and 13
 
  pinMode(2, OUTPUT); //this pin controls central air
  pinMode(3, OUTPUT); //this pin controls outside lights
  pinMode(5, OUTPUT); //this pin controls inside lights
  pinMode(6, OUTPUT); //this pin controls black lights
  pinMode(7, OUTPUT); //not used yet, goes to mood lights...speaking of, one needs to buy more halogen bulbs...
  pinMode(8, OUTPUT); //not used for now
  pinMode(9, OUTPUT); //not used for now
  //start Ethernet
  Ethernet.begin(mac, ip, gateway, subnet);
  server.begin();
  //the pin for the servo co
  //enable serial data print
  Serial.begin(9600);
  Serial.println("ShopMatic testing firmware");
  //need to know which arduino im using, since two are normally connected to my mech
}
 
void loop(){
  // Create a client connection
  EthernetClient client = server.available();
  if (client) {
    while (client.connected()) {
      if (client.available()) {
        char c = client.read();
 
        //read char by char HTTP request
        if (httpRequest.length() < 80) {
 
        }
 
        //if HTTP request has ended
        if (c == '\n') {
 
          ///////////////
          Serial.println(httpRequest); //print to serial monitor for debuging
 
          client.println("HTTP/1.1 200 OK"); //send new page, i keep this page blank for security reasons...no info, boring target to mess with
          client.println("Content-Type: text/html");
          client.println();
          client.println("<HTML>");
          client.println("<HEAD>");
          client.println("<TITLE></TITLE>");
          client.println("</HEAD>");
          client.println("<BODY>");
          client.println("<hr />");
          client.println("<br />");
          client.println("</BODY>");
          client.println("</HTML>");
 
          delay(2);
          client.stop();
          //give time for receiving..not like im sending alot

 
          ///////////////////// control arduino pin
          if(httpRequest.indexOf("?lighton") >0)//turn on outside lights
          {
            digitalWrite(3, HIGH);    //9, stand!
            httpRequest="";
          }
          else{
          if(httpRequest.indexOf("?lightoff") >0)//turn off outside lights
          {
            digitalWrite(3, LOW);    //9, duck!
            httpRequest="";
          }
          else{
          if(httpRequest.indexOf("?firmver") >0)//did we get a firmware version request?
          {
            client.connected(); //client gotta connect to get data, right?
          client.println("HTTP/1.1 200 OK"); //send new page, i keep this page blank for security reasons...no info, boring target to mess with
          client.println("Content-Type: text/html");
          client.println();
          client.println("<HTML>");
          client.println("<HEAD>");
          client.println("<TITLE></TITLE>");
          client.println("<h2> 0.1.0 </h2>");
          client.println("</HEAD>");
          client.println("<BODY>");
          client.println("<hr />");
          client.println("<br />");
          client.println("</BODY>");
          client.println("</HTML>");
            client.stop();
            httpRequest=""; //make sure to empty this string
          }
          }
          //clearing string for next read
          httpRequest="";

 
        }
      }
    }
  }
}
}
9  Using Arduino / Programming Questions / Re: Not understanding what is going on here, only using constants... on: July 01, 2012, 10:35:50 am
Thank you PeterO, that fixed alot of things. And I have a question, should I keep the "chained" tasking system I have in place, or should I make an attempt to move to task scheduler to ensure equal time for the code between sensors and modules? It's just a thought right now...

edit: the reason I'm asking about using a time scheduler is because it doesn't take but a fraction of a second to read the thermal sensors and pin states. So I could schedule jus a few ms to each of those task, store the value, and the return the remaining fraction of the second to the main code, which processes the data...like I said, it's all just a thought right now. Although, I did get a 6HP Tecumseh Powersport rebuilt yesterday, so part of the gokart is coming together smiley
10  Using Arduino / Programming Questions / Re: Not understanding what is going on here, only using constants... on: July 01, 2012, 12:20:56 am
Okay...so now I have run into another problem I am not understanding, I'm using the "if | else" scheme to do simple checks and status changes in my program, only the serial output ONLY show the information header and the "else" part of the dummy lights and EFI serial output data....any reason why?

I've attached the current code below. Yes, I know it is a bit of a train wreck, but it'll get better as a start to get parts in and can do real testing of the whole project. And because I know someone will be curious, yes this project is for building an EFI capable ECU for a racing gokart. Lol smiley Thanks to those who help out with this project smiley
Code:
/*  <Bo Lansdale and Charles Klein; PowerHound goKart ECU>
    Copyright (C) <2012>  <Bo Lansdale and Charles Klein>

    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
    the Free Software Foundation, either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU General Public License for more details.

    You should have received a copy of the GNU General Public License
    along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/


/* open source arduino engine control program. Written
 and debugged by Bo Lansdale. Made for a go kart being built
 and raced by Charles Klein. This version, v 1.0, is open
 source by the GPL v3 License.
 
 Copyright 2012 Bo Lansdale and Charles Klein*/

/* please keep in mind that this program/software is NOT built to be fit for any purpose, it is just
 a trial-and-error to see if such could even be done with an Arduino. The software was orignally
 built for a fully custom goKart making use of a 13HP four-stroke gasoline engine. While you can
 use this software for your own projects, we take NO responsibility for what may or will happen.
 
 The software is buggy and may crash or hang without warning, causing anything from, but not limited to,
 flooding or overheating of the engine.*/
 
//I'm using a few outside libraries for various functions of the ECU
#include <MemoryFree.h>

//computer needs direct line to battery, else starter current will reset it, lost variables...can be fixed via a
//330uF capacitor and diode circuit to power the computer for a few seconds during starting...

//state our starting variables; variables can be added and taken as needed, if listed here, they are unviersal to
//ALL functions.
int rpm = 0; //is this engine even running yet? doesn't really matter what you set it to, it'll be overwritten
//soon as the engine is running.
int oiltemp = 0; //haven't read oil temp yet; treated same as rpm reading
int airtemp = 0; //have we even figured out the oil temp?; treated same as rpm reading
int volt = 0; //haven't read voltage yet, read every 10 or so routine run throughs
int system_MaxRPM = 400; //this isn't read as actual RPM, but rather as a volt reference...
int system_MaxOilTemp = 325; //again, not actual, but read as a volt reference...
int system_MaxVoltage = 800; // again, not actual, but read as a volt reference...
int ftime = 10; //ms value for injector timing; should be 10ms during hot weather, or 20ms for cold weather
int testDone_lights = 0; //used for the loop function, if test has already been done, DON'T do it again
int testDone_serialInfo = 0; //should we display the info header from boot? only need to once
int RunTime_started = 0; //this part of the software is reserved for a computer interface...don't know if it'll ever be written
int engineStarted = 0; //have we started the engine, this will be set to 1 if the rpm is picked up over 380 rpm

// state our inputs for the board
int FueloffSet_neg = 4; //used to take f ms from the fuel injector ON (HIGH) time.
int FueloffSet_pos = 5; //used to add 5 ms to the fuel injector ON (HIGH) time.
/* adjusting the fuel injector timing this way can help tweak your engine performance to squeeze
 out just a hair more power. Or it can semi-help in the case that the RPM sensor is giving a slightly
 offset value. */
int oilTemp = A2; //custom thermosistor module placed in the oil resivor for the engine.
int airTemp = A3; //thermosistor module place inside the intake for collecting air temp and adjusting fuel timing.
int rpmSensor = A4; //will be a inductance coil used for timing fuel.
int throttlePosition = A0; //will measure a variable resistor.
int sysVoltage = A1; //need anolog input to read voltage.
//all inputs for this board have been stated

/*mellow people I luffles my lil big pup and have fun with the program.*/
/*aye babygal, loves you too, and I'm sure they will*/

//state our outputs for the board
int injectorOut = 6; //needs to be on PWM pin for better control control
int fanState = 7; //used to turn the oil cooling fan on or off
int ignitionShort = 8; /* used to ground out the firing coil if the engine
 exceeds the operating temp threshold. This will effectively stop the
 engine from running while overheated. */
int oilTL = 9; //light for engine overheat warning.
//pulses for possible alert, stays on when condtion reached.
int lowVL = 10; //low voltage light, comes on at 10.4 volts
int overRPML = 11; //comes on when engine RPM becomes too high
int accEnableL = 12; //show when the acc device is enabled, not really needed right now

//begin the serial com port for information to be sent to the port reader

void setup() {
  //set inputs
  pinMode(oilTemp, INPUT);
  pinMode(airTemp, INPUT);

  //set outputs
  pinMode(injectorOut, OUTPUT);
  pinMode(fanState, OUTPUT);
  pinMode(ignitionShort, OUTPUT);
  pinMode(oilTL, OUTPUT);
  pinMode(lowVL, OUTPUT);
  pinMode(overRPML, OUTPUT);
  Serial.begin(9600);
  Serial.print("ECU+INFO= PowerHound Version 1.1: The goKart ECU/EFI system\r\n");
  Serial.print("Built by Bo Lansdale, debugged by Charles Klein!\r\n");
  Serial.print("LN+ Starting system routines...we will output data\r\n");
  Serial.print("to the serial port containing system values as the\r\n");
  Serial.print("engine is running. Values you see automatically update\r\n");
  Serial.print("and are readable as LN+, RT+, or ECU+ command reports.\r\n");
 
  /* as versions change and are updated, the serial protocol will always remain as 9600 baud, but the
  commands may change or new one added. the DI (Device Interface) system will NOT be added to this micro
  version. We will be producing two versions of the PowerHound Open Source ECU. A micro version using
  just the bare bones to manage the engine, and a full version packed with the DI.
  */
}

void loop() {
  testLights();
}


void testLights() {
  //test lights
  if (testDone_lights = 0)
  {
    Serial.print("Initializing Dummy Lights....\r\n");
    digitalWrite(oilTL, HIGH);
    digitalWrite(lowVL, HIGH);
    digitalWrite(overRPML, HIGH);
    delay(2500);
    //2.5 second test period for testing dummy lights
    digitalWrite(oilTL, LOW);
    digitalWrite(lowVL, LOW);
    digitalWrite(overRPML, LOW);
    testDone_lights = 1;
    Serial.print("Passed.....\r\n");
    RunTime();
  }
  else {
    RunTime();
  }
}

void RunTime() {
  if (RunTime_started = 0) {
    Serial.print("Starting RunTime......\r\n");
    //OMG We finally added stuff to the runtime!!! let us show the free memory for the ECU
    Serial.print("freeMemory()=");
    Serial.println(freeMemory());
    EFI();
  }
  else
  {
    EFI();
  }
}
void EFI() {
  if (engineStarted = 0) {
    int rpm = 0;
    int ftime = 10;
    digitalWrite(injectorOut, HIGH);
    delay(ftime);
    Serial.print("ECU+fTime= " + ftime);
    digitalWrite(injectorOut, LOW);

  }
  else
  {

    delay(ftime);
    Serial.print("Checking and adjusting fuel injection.....\r\n");
    pinMode(rpmSensor, INPUT); 
    LightsModule();
  }
}

void LightsModule() {
  Serial.print("Checking statuses for dummy lights....\r\n");
  int Reading_oiltemp = 0;
  Reading_oiltemp = analogRead(oilTemp);
  if (Reading_oiltemp >= system_MaxOilTemp)
  {
    digitalWrite(oilTL, HIGH);
  }
  else
  {
    digitalWrite(oilTL, LOW);
  }
  int Reading_rpmSensor = 0;
  Reading_rpmSensor = analogRead(rpm);
  if (Reading_rpmSensor > system_MaxRPM) {
    digitalWrite(overRPML, HIGH);
  }
  else
  {
    digitalWrite(overRPML, LOW);
  }
}
11  Using Arduino / Programming Questions / Re: Not understanding what is going on here, only using constants... on: June 25, 2012, 11:05:15 am
how would you put the board start code into a function. I need those pin name usable throughout the code.
You should go through the beginning examples to see how the code is organized and put into the proper function.

I'll go ahead and do that, the blink example seems rather simple.

Edit: thank you Arrch, here is the fixed code. Obviously I'm just starting out on Arduino, but this should make things a bit easier knowing how to declare functions.

New and Fixed code:
Code:
/* open source arduino engine control program. Written
 and debugged by Bo (las name left out). Made for a go kart being built
 and raced by Charles (las name left out). This version, v 1.0, is open
 source by the GPL v3 License. */
 
// state our inputs for the board
int oilTemp = A2;
int airTemp = A3;
int rpmSensor = 4; //will be a inductance coil used for timing fuel
int throttlePosition = A0; //will measure a variable resistor
int sysVoltage = A1; //need anolog input to read voltage
//all inputs for this board have been stated

//state our outputs for the board
int injectorOut = 6; //needs to be on PWM pin for fine grain control
int fanState = 7; //used to turn the oil cooling fan on or off
int ignitionShort = 8; /* used to ground out the firing coil if the engine
 exceeds the operating temp threshold. This will effectively stop the
 engine from running while overheated. */
int oilTL = 9; //light for engine overheat warning.
//pulses for possible alert, stays on when condtion reached.
int lowVL = 10; //low voltage light, comes on at 10.4 volts
int overRPML = 11; //comes on when engine RPM becomes too high
// int CoilOff = 12 later: brownout state for injector coil
void setup() {
//set inputs
pinMode(oilTemp, INPUT);
pinMode(airTemp, INPUT);

//set outputs
pinMode(injectorOut, OUTPUT);
pinMode(fanState, OUTPUT);
pinMode(ignitionShort, OUTPUT);
pinMode(oilTL, OUTPUT);
pinMode(lowVL, OUTPUT);
pinMode(overRPML, OUTPUT);
}

void loop() {
 RunTime();
}

void RunTime() {
  testLights();
}

void testLights() {
//test lights
digitalWrite(oilTL, HIGH);
digitalWrite(lowVL, HIGH);
digitalWrite(overRPML, HIGH);
delay(2500);
//2.5 second test period for testing dummy lights
digitalWrite(oilTL, LOW);
digitalWrite(lowVL, LOW);
digitalWrite(overRPML, LOW);
}
12  Using Arduino / Programming Questions / Re: Not understanding what is going on here, only using constants... on: June 25, 2012, 10:57:41 am
how would you put the board start code into a function. I need those pin name usable throughout the code.

edit: never mind, answer my own question....brain is not functioning yet, sigh, but C/C++ is nothing like basic. But I did go through the reference and figured out most of what I'm doing wrong. Have to use digitalWrite to set pins, not jus high or low. Thanks to those who helped.
13  Using Arduino / Programming Questions / Re: Not understanding what is going on here, only using constants... on: June 25, 2012, 10:54:55 am
I'm very new to C/C++ and come from using basic. But yes you are right....oops
14  Using Arduino / Programming Questions / Not understanding what is going on here, only using constants... on: June 25, 2012, 10:49:15 am
Okay, a friend and I are using the Arduino Uno as an ECU for a racing gokart that we are adding electronic fuel injection to, and as of right now only a few things like constants and pinMode have been written, I clicked verify to make sure I have messed up and this is what the compiler returned:
Code:
gokart_EFI:26: error: expected constructor, destructor, or type conversion before '(' token
gokart_EFI:27: error: expected constructor, destructor, or type conversion before '(' token
gokart_EFI:31: error: expected unqualified-id before numeric constant
gokart_EFI:32: error: expected unqualified-id before numeric constant
gokart_EFI:33: error: expected unqualified-id before numeric constant
gokart_EFI:34: error: expected unqualified-id before numeric constant
gokart_EFI:35: error: expected unqualified-id before numeric constant
gokart_EFI:37: error: expected unqualified-id before numeric constant
gokart_EFI:38: error: expected unqualified-id before numeric constant
gokart_EFI:39: error: expected unqualified-id before numeric constant
gokart_EFI:40: error: expected constructor, destructor, or type conversion before '(' token
gokart_EFI:42: error: expected unqualified-id before numeric constant
gokart_EFI:43: error: expected unqualified-id before numeric constant
gokart_EFI:44: error: expected unqualified-id before numeric constant

I have a feeling this is due to me not using pinMode throughout the entire program, but correct me if I'm wrong.

Here is my program:
Code:
/* open source arduino engine control program. Written
 and debugged by Bo (las name left out). Made for a go kart being built
 and raced by Charles (las name left out). This software is open
 source by the GPL v3 License. */

// state our inputs for the board
int oilTemp = A2;
int airTemp = A3;
int rpmSensor = 4; //will be a inductance coil used for timing fuel
int throttlePosition = A0; //will measure a variable resistor
int sysVoltage = A1; //need anolog input to read voltage
//all inputs for this board have been stated

//state our outputs for the board
int injectorOut = 6; //needs to be on PWM pin for fine grain control
int fanState = 7; //used to turn the oil cooling fan on or off
int ignitionShort = 8; /* used to ground out the firing coil if the engine
 exceeds the operating temp threshold. This will effectively stop the
 engine from running while overheated. */
int oilTL = 9; //light for engine overheat warning.
//pulses for possible alert, stays on when condtion reached.
int lowVL = 10; //low voltage light, comes on at 10.4 volts
int overRPML = 11; //comes on when engine RPM becomes too high
// int CoilOff = 12 later: brownout state for injector coil

//set inputs
pinMode(oilTemp, INPUT);
pinMode(airTemp,INPUT):

//set outputs
OUTPUT injectorOut;
OUTPUT fanState;
OUTPUT ignitionShort;
OUTPUT oilTL;
OUTPUT lowVL;
OUTPUT overRPM;
//test lights
HIGH oilTL;
HIGH lowVL;
HIGH overRPML;
delay(2500);
//2.5 second test period for testing dummy lights
LOW oilTL;
LOW lowVL;
LOW overRPML;
Pages: [1]