Working with TX output and SparkFun 7-Seg Serial Display [SOLVED - wiring issue]

I recently purchased a serial 7-seg display from SparkFun.

The code I’m working with is below:

int cycles = 0;

void setup() {
    pinMode(TX, OUTPUT);
    Serial1.begin(9600);
    Serial1.write('v');
}

void loop() {
    cycles++;
    char tempString[10];
    sprintf(tempString, "%4d", cycles);
    Serial1.write(tempString);
    
    delay(2000);
}

It’s probably extremely obvious what I’m doing wrong, but I for the life of me can’t figure this out.

I have my VIN connected to the 7-Seg’s VCC, my GND connected to the 7-Seg’s GND, and my TX connected to the 7-Seg’s RX.

In the Arduino world, there is a big difference between Serial1.write() which sends a single character and Serial1.print() which sends the whole string. I think you want Serial1.print(tempString); instead of write().

Can you try changing that?

I did, and it still doesn’t make a difference. The 7-seg display is still showing all zeroes.

OK have you tried something like the Sparkfun example, skipping all the other stuff for now?

Serial1.print("-HI-"); 

It still doesn’t do anything. Just all zeroes on the display.

Got it working, my pins weren’t making a secure connection.

1 Like