Hi. Hope this is allowed. :o
I'm looking to commission someone to design the circuit and write the code for a programmable shift light.
The rpm signal will come from a non latching hall effect sensor mounted on the engine pulley.
I nead to switch on 3 banks of different coloured led's at 3 different rpm values. If possible I would like to be able to set those values using push buttons at say 100 rpm intervals.
I hope that makes sense and if anyone is interested or has already done this please get in touch via here or at carboncopiesltd@yahoo.co.uk.
The full code is like this:
// define values here: #define a 600000 // 1000000us * 60 s/m /100rpm #define b 300000 // 1000000 * 60/200 #define c 200000 // 1000000 * 60/300 #define pin 5 // the digital pin to read pulse duration #define GREENLED 10 // Digital pin nomber #define YELLOWLED 11 // Digital pin nomber #define REDLED 12 // Digital pin nomber
// custom project variables:
unsigned long duration;///< pulse duration, the length of the pulse (in microseconds) or 0 if no pulse is completed before the timeout (unsigned long)
// the setup function runs once when you press reset or power the board
void setup() {
// initialize digital pin LED_BUILTIN as an output.
pinMode(GREENLED, OUTPUT);
pinMode(YELLOWLED, OUTPUT);
pinMode(REDLED, OUTPUT);
// serial port init
Serial.begin(115200);//115200 baud!!!
}
// the loop function runs over and over again forever
void loop()
{
Dmitron 1036 thanks for the new code.
I'm trying to adapt it to my needs and below is where the problems start.
I'm totally new to this so please be gentle