For a while now I’ve been running a megajolt v3 ignition system. You can read about what it is and what it does for yourself: https://wiki.autosportlabs.com/MJLJ_V3_vehicle_installation_guide
Important terms to take from that are:
EDIS – Ford’s coil driver and toothed wheel interpreter black box thing
PIP – signal sent from the EDIS when it wants a SAW
SAW – signal communicating how much advance to give
The megajolt has been great, and there’s nothing really wrong with it, but lately I’ve been wanting to tweak the maps a little. That would be trivial if I still had a windows laptop to run the windows only bespoke tuning software, but I don’t any more. I tried using a VM on my linux machine with the MJ powered up on the desk, but couldn’t get it to communicate through the infamously flaky ‘Prolific’ serial/USB adapter thing and it was proving a hassle to work out what was at fault. Was it the VM not having the right drivers? The host machine not having the right drivers? The USB-serial thing being flaky and crap? The VM not seeing the COM port? The MJ not being powered up properly? Too much to troubleshoot all at once.
Anyway, after being loyal to the PIC uc for a number of years, I have recently discovered the fun you can have with arduinos and WS2812 LED strips, so at the same time I had a solution looking for a problem.
I figured it’d be nice to have a system that I can tweak and map and look after from my phone, so set about throwing something together. If you want to do something similar, don’t copy this but do learn from the mistakes. If you really want to copy it… I guess… creative commons non-commercial.
Obviously, the first thing to do was to get one of them pretending to be the EDIS system, so I wrote some code for that, and then set about hooking up a second one and getting it to respond appropriately.

In the photo the arduino on the left is sending out PIP pulses, slowly ramping up and down between RPM values, and reporting what SAW width it’s receiving and therefore the advance value the EDIS would provide.
The one on the right is receiving the PIP, calculating RPM, measuring throttle position (the pot on my kiddies’ electronics kit is playing the part of the throttle position sensor here), looking up the advance value from a table, sending a SAW pulse, and driving a strip of RGB LEDs (not shown) using FastLED. There are option switches to flick between 2 maps, and also to change the function of the LED strip from regular shift lights to showing TPS position and other diagnostic info.
In the code there is provision for a rev limiter; a pin is driven low when a set limit is exceeded. (The EDIS doesn’t do that so we need some more circuitry. For the megajolt I made a close copy (with permission) of this: https://wiki.autosportlabs.com/Hard_rev_limiter_1.2.0 and will include something functionally similar on this project. More on this later.)
A lot of coding went by with more than a few facepalms before I got to what I would call working code. Pretty much the usual development process that takes the bulk of the work but isn’t very interesting and so is glossed over here. Imagine a long montage of coding errors and successes. That got me as far as this example output from the simulator/monitor shown here:

This is showing RPM being ramped up and down, corresponding width of PIP pulse, Advance degrees corresponding to the received SAW pulse, delay between PIP edge and SAW edge (μs), rev lim status (1 => coil power is on) and a few other obscure debug diagnostics.
There are diagnostics in there telling me how long (in μS) it’s spending sending the LEDs data and writing to the serial port. I was a little concerned at first that it wouldn’t have the clock cycles spare between PIP events to do all that, but it seems fine. I put the important job in an ISR so, notwithstanding the secrets of FastLED library, it should always do the #1 job. Even if it misses a few events it’s no big deal since the EDIS “remembers” the last SAW width for some time.
All seemed ok so I moved on to hardware.
I decided early on to stay compatible with the megajolt so I can freely swap between the two (in case the smoke gets out of mine or whatever, not that I don’t have confidence…). This put some awkward constraints on pinouts etc, but I worked around that to produce the circuit diagram and board layout below. I used Fritzing because it looked like it’d be easy to learn. It’s easy to learn but a giant pain in the arse to use. Stuff just won’t stay where you left it and anything it doesn’t have a footprint for (like the molex connector the MJ uses) causes no end of grief. Anyway, I battled through and got this:
There’s some extra copper where the coil pack current needs to flow, or big thick wire leading to the off-board power resistor. Making copper flood work properly is another thing that turned out to be impossible in fritzing. It just did random shit and made me angry so I drew a copper rectangle. Shoulda learned kicad. Wide tracks are also impossible so I kept them short and laid some thick solder down over the very-slightly-wider ones that it calls extra-wide.
The big 10W resistor might be overkill but the rev limiter works by placing a resistor in series with the coil pack power feed, so it could see most of 12 V for a few seconds. In normal operation it’s shorted out by the FETs, but when activated they turn off and the coil doesn’t get enough current to fire. Importantly it isn’t abruptly open-circuited since that could cause a spark at a bad time. FETs is plural there for no great reason. Just seemed safer to run 2 in parallel even though each is good for a lot of current (75 A). Only ever need ~10 but we don’t want anything getting warm.
This board has many bodges on it. Do not copy this board.
I made up the board and quickly discovered I’d made the molex connector’s footprint wrong. Predictable, since fritzing’s part editor is such a PoS and you have to make everything by hand as SVG. But it’s only the mounting holes so we’ll just not use those.
With everything populated I connected to the car and switched the LEDs to TPS mode. After calibrating the max/min values given over serial, I got to here:
Next I tried firing it up. Nothing. No power to the coil. (No 10 V zener at this point). After metering everything I pulled the arduino out in desperation and got power. I tried 5v and 0v on the rev lim pin and nothing. Floating, fine, works. It took some headscratching to remember that the MJ switched everything with 12 V, so 5 V was keeping the 2907A conducting and I could never un-limit the rpms. Very annoyed that I overlooked that. A colleague suggested the remarkably simple workaround of putting a zener in series, so I pulled the 100 k resistor and made a 100 k/10 V “zenristor” (just visible in photo) to go in its place. Now the base of the 2907 can cope with the line voltage as high as 15V before it will start to conduct against our wishes, and the arduino can drop it to 10 V to activate the limiter. I might change this for an 11 V zener at some point, just in case the alternator ever decides to put out >15 V (Edit: I did).
After thinking about what comes next I threw in some code to read a toggle switch input pin and add some advance, just to make the mapping and tweaking an experimenting a little easier. Then I figured 2 is better than 1, so now I have +2° and +5° switches available. Being able to add 2, 5 or 7 degrees should help in the tweaking phase. I can change those values, or even the function of those switches, in software later if needed.
At this point it was time to think about a case, so I designed this:
I printed that switch panel in 2 pieces. The first 2mm, with the lettering on, is a separate piece. Not only did that mean that all the failed prints where the lettering came out crap went by a lot quicker, but also that if I ever decide to change what the switches are for I only need to reprint the faceplate. It’s just held on by the nuts that retain the switches.
I used some fancy switches that need to be pulled out to toggle. Makes sure I can’t knock them by accident and cause engine destruction.
It’s at this point that feature creep set in and I decided having a voltmeter might be quite nice. It’s really as simple as 2 resistors dividing onto one of the ADC pins, so would be silly not to have it. I drilled a few extra holes in the board and added 10k and 30k resistors dividing the 12V input by 4. When in TPS/diagnostic mode the reading is displayed as a single yellow LED, mapped to read from 10-18 V. With my 20 LEDs that should give a good enough indication of whether everything’s nominal.
Also in this mode, the current advance in degrees is displayed as a single blue dot, mapped to read from 5 to 45. Just for interest. These are superposed on a background of throttle position shown as green-red fill.
The boring code bit can wait until later. It’s down the bottom if you’re interested. Here’s the (not quite) red-line clip you’ve all been waiting for:
So first, a quick explanation of what it needs to do.
Priority #1, most important job, is to get a SAW pulse out as soon as PIP transitions low. For this reason all that business happens in an ISR, with the PIP pin set to interrupt on change. The first thing that happens if it’s gone low is the SAW pin immediately goes high. Thenwe use a delay, inside an ISR, despite all the documentation saying not to, because I don’t care about the timing of anything but this, so this needs to be accurate and it needs to happen NOW and nothing else really matters so everything else can wait.
Just after the SAW pulse we know we have a bit of time to work out vital parameters before the next one, so some of the timing values needed to work out RPM are stored then too. (RPM is PIPs/minute divided by 2).
After PIP goes high, we know we have a half PIP cycle before the action starts, so this is a good time to get the ADC to read throttle position.
Everything else can sort of happen any time. The main loop calculates the SAW width and keeps it stored ready, and does the maths to work out the RPM.
It checks positions of the add advance and map select switches, and checks we’re not above the rev limit. Those are fairly important jobs not to get behind on.
The rest is just calling stuff once in a while. Those things are:
Serial output – send diagnostics down the serial line. Once a second is plenty.
Get battery voltage – This is a mixed bag. It happens when PIP is high because that means there’s a bit of free time, but only if it’s not been done in a while. No need to check on that too often.
Update LEDs – send data to the WS2812, whatsoever that data may be. This happens every 64ms so it’s nice and smooth to the eye. 16 fps is plenty when you should have your eyes on the road. In the routine for that is a check to see where the option switch is. If it’s set to RPM the LEDs work as shift lights, left to right lighting green to red as revs close in to the limit.
If set to TPS the LEDs fill L-R green to red to show throttle position, and superposed on that is a static blue LED showing advance in degrees and a yellow one showing current battery voltage.
The only significant other stuff is the part that triggers the ADC reads when the engine’s not running (they happen on PIP going high normally, remember), and some panic lights in case everything goes wrong.
That’s basically it. It could be tidier, but it works. More tweaks will probably follow as I play with it and do some mapping.
Oh, and my LEDs are numbered backwards – it’s just the way they have to sit in my car. The wire needs to come out on the right. Sorry if that’s confusing.
#include “FastLED.h”
#define SAW_PIN 2
#define PIP_PIN 3
#define REV_LIM_PIN 5
#define ADD_2_DEG_PIN 9 //add 2 degrees if low
#define ADD_5_DEG_PIN 10 //add 5 degrees if low
#define map_select_pin 7 //==1 (pullup) for map 1, 0 for map 2
#define TPS_PIN A3 //needs to be an analog pin. check this.
#define BATTV_PIN A6 //needs to be an analog pin. check this.
#define LED_FUNC_PIN 11 //==1 for rev counter, ==0 for TPS display
#define LED_PIN 8
#define NUM_LEDS 20
#define BRIGHTNESS 230
#define LED_TYPE WS2811
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#define NUM_REDS 3 //how many are solid red at the top end
const byte greenhue=90;
const int redhue=0;
const byte hue_increment=(greenhue-redhue)/(NUM_LEDS-NUM_REDS);
//const int hue_increment=(greenhue-redhue)/num_rpm_bins-1;
volatile byte ledhue[NUM_LEDS];
//volatile byte ledhue2[NUM_LEDS];
const byte num_rpms_to_average = 5; //average 5 timings to get rpm
int pipcount; //how many pips have passed
const byte pips_per_led_update=10;
//const int rev_limit=3000;
//const int rev_firstlight=800;
const int rev_limit=5800;
const int rev_firstlight=3000;
const int tps_minv=110;
const int tps_maxv=780;
const byte adv_offset=5; //add a fixed offset
bool rl_active=false,add2deg=false,add5deg=false,errormode=false;
byte active_map=1; //==1 (pullup) for map 1, 0 for map 2
byte adv_led,batt_led; //led that’s lit to indicate advance, voltage
volatile int rpms_index=0;
volatile unsigned long lag,rpm, rpm_micros_total, half_rev_time_usec,previous_half_rev, interrupttime, lasttime, rpmarray[num_rpms_to_average];
volatile int tps_volts, throttle_pos, saw_width_usec,tps_volts_constrained, missedpulses=0, batt_volts;
float floatvolts;
int advance; //current advance in deg
byte idx_j,idx_k; //index of tps,rpm bins
unsigned long ledtime,serialtime,serialstart;
volatile unsigned long nextTPSupdate=64,nextBattupdate=512,nextLEDupdate=92,nextSerialupdate=1024;
const int num_rpm_bins=15;
int leds_lit;
const byte tpsbins[20]={5,10,15,20,25,30,35,40,45,50,55,60,65,70,75,80,85,90,95,101};
const String serialheader=”RPM\tT(%,V)\tADV\tlost\tt_led\tt_ser\t12V:”;
byte seriallines=0;
const int rpmbins[num_rpm_bins]={
600,800,1200,1500,1900,2300,2700,3100,3500,4000,4500,5000,5500,6000,6500};
const byte ignition_map_one [20] [15] = {
//Pinto 3D base 6k
{5,15,13,20,32,33,35,37,39,41,43,44,44,44,44},
{5,15,14,24,32,33,35,37,39,41,43,44,44,44,44},
{5,15,17,27,32,33,35,36,39,40,43,44,44,44,44},
{5,15,19,29,31,32,34,35,38,39,42,43,43,43,43},
{5,15,19,29,30,31,32,33,36,37,40,41,41,41,41},
{5,15,19,28,28,29,30,31,34,34,38,39,39,39,39},
{5,15,19,27,27,28,29,30,32,32,38,39,39,39,39},
{5,15,19,25,26,27,28,28,30,30,38,38,38,38,38},
{5,15,19,25,26,27,27,28,30,30,38,38,38,38,38},
{5,15,19,24,25,26,26,27,29,29,37,37,37,37,37},
{5,15,19,23,25,26,26,27,29,29,36,36,36,36,36},
{5,15,19,21,24,25,26,27,28,29,35,35,35,35,35},
{5,15,18,21,24,25,26,27,28,29,34,34,34,34,34},
{5,15,17,20,24,25,25,26,28,28,33,33,33,33,33},
{5,15,16,19,24,25,25,26,28,28,32,32,32,32,32},
{5,15,15,18,24,24,25,25,27,28,30,30,30,30,30},
{5,15,15,18,24,24,25,25,27,28,30,30,30,30,30},
{5,15,15,17,24,24,24,25,27,28,30,30,30,30,30},
{5,15,15,17,24,24,24,25,27,28,30,30,30,30,30},
{5,15,15,17,24,24,24,25,27,28,29,29,29,29,29},
};
const byte ignition_map_two [20] [15] = {
//tiger2lt Pinto 6k-dyno3D
{5,12,13,14,20,22,24,26,29,32,34,35,36,37,38},
{5,12,21,27,29,30,29,32,36,37,40,41,42,43,44},
{5,12,21,26,27,28,28,30,34,35,38,39,40,41,42},
{5,12,20,26,26,26,27,29,32,32,36,37,38,39,40},
{5,12,20,25,25,25,26,28,30,30,36,36,37,38,39},
{5,12,19,24,24,24,25,27,28,29,36,36,37,38,39},
{5,12,19,23,23,24,24,26,28,28,35,36,37,38,39},
{5,12,18,22,22,23,24,25,27,28,35,35,36,37,38},
{5,12,18,22,22,23,24,25,27,27,35,35,36,37,38},
{5,12,17,20,22,24,24,25,26,27,34,34,35,36,37},
{5,12,17,19,22,25,24,25,26,27,33,33,34,35,36},
{5,12,16,18,22,24,24,25,25,26,32,32,33,34,35},
{5,12,16,18,22,24,24,25,25,26,31,31,32,33,34},
{5,12,16,17,22,23,24,25,26,26,31,31,32,33,34},
{5,12,15,16,21,22,24,25,26,26,31,31,32,33,34},
{5,12,15,14,21,22,24,25,27,26,31,31,32,33,34},
{5,12,15,14,21,23,24,25,27,27,31,31,31,32,33},
{5,12,15,13,21,24,25,26,28,29,31,31,30,30,30},
{5,12,15,13,21,23,23,25,26,27,29,29,30,30,30},
{5,12,15,13,21,22,22,23,25,26,27,27,29,29,29},
};
void setup() {
// put your setup code here, to run once:
Serial.begin(115200);
pinMode(SAW_PIN, OUTPUT);
pinMode(13, OUTPUT);
pinMode(REV_LIM_PIN, OUTPUT);
pinMode(PIP_PIN, INPUT_PULLUP);
pinMode(LED_FUNC_PIN, INPUT_PULLUP);
pinMode(map_select_pin, INPUT_PULLUP);
pinMode(ADD_2_DEG_PIN, INPUT_PULLUP);
pinMode(ADD_5_DEG_PIN, INPUT_PULLUP);
attachInterrupt (digitalPinToInterrupt(PIP_PIN), pip_ISR, CHANGE);
digitalWrite(REV_LIM_PIN,HIGH);
for (int i = 0; i < num_rpms_to_average; i++){
rpmarray[i]=500000; //initialise at 60 rpm for cranking
rpm_micros_total = rpm_micros_total + rpmarray[i];
}
//work out a SAW to start off
calculate_saw();
FastLED.addLeds<NEOPIXEL, LED_PIN>(leds, NUM_LEDS);
FastLED.setBrightness( BRIGHTNESS );
for(int b=0;b<NUM_LEDS;b++) { //power up chase light
leds[b] = CHSV(20*b,255,255);
FastLED.show();
delay(10);
}
for(int b=0;b<NUM_LEDS;b++) { //power up chase light
leds[b] = CRGB::Black;
FastLED.show();
delay(10);
}
Serial.println(“RESET”);
//set up all the hues and stuff here
for(int b=0;b<NUM_LEDS;b++) {
ledhue[b] = greenhue-hue_increment*b;
// ledhue2[b] = -100+(120/(NUM_LEDS-NUM_REDS))*b;
}
ledhue[NUM_LEDS-1]=redhue;
ledhue[NUM_LEDS-2]=redhue;
ledhue[NUM_LEDS-3]=redhue;
}
void loop() {
// put your main code here, to run repeatedly:
//important stuff we can do any time:
calc_rpm();
calculate_saw();
if (rpm == 60 && millis() > nextTPSupdate){ //haven’t started yet
get_throttle_pos();
nextTPSupdate=millis()+72;
}
if (rpm == 60 && millis() > nextBattupdate){ //haven’t started yet
get_batt_volts();
nextBattupdate=millis()+1024;
}
if (rpm > rev_limit){
digitalWrite(REV_LIM_PIN,LOW);
rl_active=true;
} else {
digitalWrite(REV_LIM_PIN,HIGH);
rl_active=false;
};
if (digitalRead(map_select_pin)==1){
active_map=1; // map1
} else {
active_map=0; //map2
}
// if (millis() % 64 == 0){ //16 times a sec should be enough
if (millis() > nextLEDupdate){
unsigned long ledstart=micros();
set_LED_params();
unsigned long ledend=micros();
ledtime=ledend-ledstart;
nextLEDupdate=millis()+64;
}
if (digitalRead(ADD_2_DEG_PIN)==0){
add2deg=true;
} else {
add2deg=false;
}
if (digitalRead(ADD_5_DEG_PIN)==0){
add5deg=true;
} else {
add5deg=false;
}
if (millis() > nextSerialupdate) { //once per sec but try not to clash with LEDs
sendserial();
}
//ERROR MODE STUFF
unsigned long lasttimestable=lasttime;
unsigned long now=micros();
lag=now-lasttimestable;
if (lag > 1000000 && rpm > 650){ //not seen a PIP for >1 sec and didn’t spin down
//missing a lot of PIPs now
//go into error mode
errormode=true;
rpm=800;
rpm_micros_total = 0;
for (int i = 0; i < num_rpms_to_average; i++){
rpmarray[i]=40000; //initialise at 800 rpm for safety
rpm_micros_total = rpm_micros_total + rpmarray[i];
}
}
}//end loop()
void pip_ISR () {
if (digitalRead(PIP_PIN) == LOW){ //replace with a PORT read when pins known!!!!!
//PIP has just fallen
//get numbers we need to work out rpm first
interrupttime = micros();
// need to get the SAW pulse out ASAP
//digitalWrite(SAW_PIN, HIGH); //replace with a PORT write when pins known!!!!!
PORTD = PORTD | B00000100; //set pin 2 high
delayMicroseconds(saw_width_usec);
//digitalWrite(SAW_PIN, LOW); //replace with a PORT write when pins known!!!!!
PORTD = PORTD & B11111011; //set pin 2 low
//now carry on with the rpm timing
previous_half_rev=half_rev_time_usec;
half_rev_time_usec=interrupttime-lasttime;
//check we haven’t missed one
//if time is bigger than 1.5 * last, or smaller by 0.5, probably missed some events
if (half_rev_time_usec > 3 * previous_half_rev/2 ||half_rev_time_usec < previous_half_rev/2){
missedpulses++;
} else {
//update the historic rpm averager array
rpm_micros_total=rpm_micros_total-rpmarray[rpms_index];
rpmarray[rpms_index]=half_rev_time_usec;
rpm_micros_total=rpm_micros_total+rpmarray[rpms_index];
rpms_index++;
if (rpms_index >= num_rpms_to_average) {rpms_index=0;};
}
lasttime=interrupttime;
errormode=false; //got a PIP so clear error flag
} else {
//PIP has just risen
//got some time to spare now
//do the adc reads while we have time
get_throttle_pos();
if (millis() > nextBattupdate){
get_batt_volts();
nextBattupdate=millis()+1024;
}
pipcount++;
}
}
void get_throttle_pos() {
//get a throttle position
tps_volts = analogRead(TPS_PIN);
tps_volts_constrained=constrain(tps_volts,tps_minv+1,tps_maxv-1);
throttle_pos = map(tps_volts_constrained,tps_minv,tps_maxv,0,100);
}
void get_batt_volts() {
//get a line voltage
//divided 12V line by 10k/10+30k, so x4 for true voltage
//but here just treat it as 1023 on the ADC =20V so it can stay an int
//0.01953125 volts per ADC unit
//51.2 ADC units per volt
batt_volts = analogRead(BATTV_PIN);
floatvolts=batt_volts*20.0/1024.0;
batt_led=map(constrain(batt_volts,512,920),512,920,0,NUM_LEDS-1);
//this in theory gives 10V to 18V
//good enough to monitor it and spot radical changes
}
void calculate_saw() {
byte j=0; //index of throttle pos
byte k=0; //index of rpm
while (throttle_pos > tpsbins[j]){
j++;
}
while (rpm > rpmbins[k] && k <= num_rpm_bins-1){
k++;
}
if (k>num_rpm_bins-1){k=num_rpm_bins-1;};
idx_j=j;
idx_k=k;
if (active_map==1){
advance=ignition_map_one[j][k];
} else {
advance=ignition_map_two[j][k];
}
advance=advance+adv_offset;
if (add2deg==true){
advance=advance+2;
}
if (add5deg==true){
advance=advance+5;
}
if (rpm > rev_limit – 200) {advance=adv_offset;};//set advance to 0 approaching rev lim
saw_width_usec= constrain(1536 – (25.6 * advance),64,1792);
}
void calc_rpm(){
//work out rpm (rolling average of last few)
unsigned long avg=0;
avg = rpm_micros_total/num_rpms_to_average;
//remember time is for half a revolution
rpm = 30000000/avg;
// rpm = 30000000/half_rev_time_usec;
// return(rpm);
}
void set_LED_params(){
for(int c=0;c<NUM_LEDS;c++){
leds[c]=CRGB(0,0,0);
}
// if (PINB & B00001000){
if (digitalRead(LED_FUNC_PIN) == HIGH) {
digitalWrite(13,LOW);
int rpm_constrained=constrain(rpm,rev_firstlight,rev_limit-200);
leds_lit=map(rpm_constrained,rev_firstlight,rev_limit-200,0,NUM_LEDS-1);
for(int c=0;c<leds_lit;c++) {
leds[NUM_LEDS-1-c]= CHSV(ledhue[c],255,255);
}
} else { // —–comment to force TPS mode for debug
digitalWrite(13,HIGH);
leds_lit=map(throttle_pos,0,100,0,NUM_LEDS);
for(int c=0;c<leds_lit;c++) {
// leds[c]= CHSV(ledhue[c],255,255);
leds[NUM_LEDS-1-c]= CHSV(ledhue[c],255,255);
}
leds[NUM_LEDS-1-batt_led]= CRGB::Yellow;
adv_led=map(constrain(advance,5,45),5,50,0,NUM_LEDS-1);
leds[NUM_LEDS-1-adv_led]= CRGB::Blue;
}
if (rl_active){
leds[NUM_LEDS-1]= CRGB::Red;
leds[NUM_LEDS-2]= CRGB::Red;
leds[NUM_LEDS-3]= CRGB::Red;
}
if (errormode==true){
for(int c=0;c<NUM_LEDS-1;c++) {
if(c%2){
leds[c]= CRGB::Black;
} else {
leds[c]= CRGB::DarkOrange;
}
}
}
// leds[0]= CRGB::Yellow;
// leds[NUM_LEDS]= CRGB::Red;
//
FastLED.show();
// Serial.println(“LED set”);
}
void sendserial(){
serialstart=micros();
//const String serialheader=”RPM\tT(%,V)\tADV\tlost\tt_led\tt_ser\t12V:”;
String data=””;
data+=rpm;
data+=”\t”;
data+=throttle_pos;
data+=”,”;
data+=tps_volts;
data+=”\t”;
data+=advance-adv_offset;
data+=”\t”;
data+=missedpulses-2;
data+=”\t”;
data+=ledtime;
data+=”\t”;
data+=serialtime;
data+=”\t”;
data+=floatvolts;
data+=”,”;
data+=batt_volts;
if (seriallines %10==0){
Serial.println(serialheader);
}
Serial.println(data);
serialtime=micros()-serialstart;
nextSerialupdate=millis()+1024;
seriallines=seriallines+1;
}
And for anyone trying to replicate this project, (maybe this will save somebody some time someday) here’s my code for the EDIS simulator: