88mph and el wire coding

I am trying to figure out the coding of 2 digit 7 segment and el wire neon. I am trying to make 2 digit start at [blank][0] to [8][8] but el wire turn on by [7][0] coding until it reach 88 then repeat back to 0 and turn off el wire.

You have provided us with very little information that we can use to help you. What have you tried? What were the results? What hardware are you using?

Read the how to use this forum sticky to see how to post code and some advice on how to get the most from the forum. See #7 & 11 especially.

To use 7-segment display, you can use the following library SevenSeg. Some basic info is available here together with a user manual in the 'extras' directory.

Using el wire with arduino is a little more tricky. You can find tutorials on the net. The arduino is used to control a relay that powers the el wire. So for your code, you just need to make 2 nested loops, and when the outer loop reaches 7 turn the relay on.

This is what I come up with

Arduino project coding

1.) input sync
2.) output 7 wire segments
3.) one output el wire controller

Coding


#include "SevSeg.h"

SevSeg sevseg; //Instantiate a seven segment controller object

void setup() {
byte numDigits = 2;
byte digitPins[] = {2, 3};
byte segmentPins[] = {4, 5, 6, 7, 8, 9, 10};

sevseg.begin(COMMON_ANODE, numDigits, digitPins, segmentPins);
sevseg.setBrightness(90);
}

void loop() {
static unsigned long timer = millis();
static int deciSeconds = 0;

if (millis() - timer >= 100UL)
{
deciSeconds++;

if (deciSeconds > 880) // Reset to 0 after counting for 1000 seconds.
{
deciSeconds = 0;
}

sevseg.setNumber(deciSeconds, 1);
timer += 100;
}

sevseg.refreshDisplay(); // Must run repeatedly
}

/// END ///

What does the code actually do? How is that different from what you want the code to do?

Read the how to use this forum sticky to see how to post code

It's not easy to help because you didn't explain what you want. I see here that you use the example from the SevSeg library. I don't have this kind of display so it's not easy to know exactly what it does, but I understand that you want to increase a counter from 00 up to 88 : how often does it change? Each second, tenth of a second, other period?
You also didn't say if you want the second digit to go from 0 to 8 or up to 9.

Here is what I would do :

#include "SevSeg.h"
SevSeg sevseg; //Instantiate a seven segment controller object
unsigned long timer = 0;
int counter = 0;
#define period 100ul    // increase counter each "period" milliseconds
#define maxCounter 88   // maximum value of counter
#define elTime 70

void setup() {
  byte numDigits = 2;
  byte digitPins[] = {2, 3};
  byte segmentPins[] = {4, 5, 6, 7, 8, 9, 10};

  sevseg.begin(COMMON_ANODE, numDigits, digitPins, segmentPins);
  sevseg.setBrightness(90);
  timer = millis(); // init timer
}

void loop() {
  while (counter <= maxCounter) {
    if (millis() - timer >= period) {
      timer = millis();
      counter++;
      sevseg.setNumber(counter, 0);
    }
    sevseg.refreshDisplay(); // Must run repeatedly
    if (counter > elTime) {
      // put here the instructions to switch the el wire on
    }
  } // end of while loop
  // Reset to 0 after counting for maxTime * period milliseconds
  counter = 0;
  // put here the instructions to switch the el wire off
}
/// END ///

It compiles ok, but I don't know if it works and if it's what you want...

Are you building a time machine out of a Chevy?

A Chevy will get you there, a Ford will get you back, too.

groundFungus:
A Chevy will get you there, a Ford will get you back, too.

Is that a specific US joke, only understood by US citizens?

I guess it called 'urban wisdom'...