esp8266 software serial & serial seven segment display

Hello,

I am trying to add a seven segment display to an existing project using serial communication. I am not sure if the issue is hardware or software, but I have checked that the display gets 3.3v. If I tap the rx pin with my meter, I can get the display to show zeros (think that is the display interpreting noise).

here is a picture of my set up. I have gnd going to gnd, 3.3v going to vcc and then pin 16(I believe that is pin 16) going to rx on the display.

picture

Here is my code (standard example code)

/* Serial 7-Segment Display Example Code
    Serial Mode Stopwatch
   by: Jim Lindblom
     SparkFun Electronics
   date: November 27, 2012
   license: This code is public domain.

   This example code shows how you could use software serial
   Arduino library to interface with a Serial 7-Segment Display.

   There are example functions for setting the display's
   brightness, decimals and clearing the display.

   The print function is used with the SoftwareSerial library
   to send display data to the S7S.

   Circuit:
   Arduino -------------- Serial 7-Segment
     5V   --------------------  VCC
     GND  --------------------  GND
      8   --------------------  RX
*/
#include <SoftwareSerial.h>

// These are the Arduino pins required to create a software seiral
//  instance. We'll actually only use the TX pin.
const int softwareTx = 16;
const int softwareRx = 7;

SoftwareSerial s7s(softwareRx, softwareTx);

unsigned int counter = 0;  // This variable will count up to 65k
char tempString[10];  // Will be used with sprintf to create strings

void setup()
{
  // Must begin s7s software serial at the correct baud rate.
  //  The default of the s7s is 9600.
  s7s.begin(9600);

  // Clear the display, and then turn on all segments and decimals
  clearDisplay();  // Clears display, resets cursor
  s7s.print("-HI-");  // Displays -HI- on all digits
  setDecimals(0b111111);  // Turn on all decimals, colon, apos

  // Flash brightness values at the beginning
  setBrightness(0);  // Lowest brightness
  delay(1500);
  setBrightness(127);  // Medium brightness
  delay(1500);
  setBrightness(255);  // High brightness
  delay(1500);

  // Clear the display before jumping into loop
  clearDisplay();  
}

void loop()
{
  // Magical sprintf creates a string for us to send to the s7s.
  //  The %4d option creates a 4-digit integer.
  sprintf(tempString, "%4d", counter);

  // This will output the tempString to the S7S
  s7s.print(tempString);
  setDecimals(0b00000100);  // Sets digit 3 decimal on

  counter++;  // Increment the counter
  delay(100);  // This will make the display update at 10Hz.
}

// Send the clear display command (0x76)
//  This will clear the display and reset the cursor
void clearDisplay()
{
  s7s.write(0x76);  // Clear display command
}

// Set the displays brightness. Should receive byte with the value
//  to set the brightness to
//  dimmest------------->brightest
//     0--------127--------255
void setBrightness(byte value)
{
  s7s.write(0x7A);  // Set brightness command byte
  s7s.write(value);  // brightness data byte
}

// Turn on any, none, or all of the decimals.
//  The six lowest bits in the decimals parameter sets a decimal 
//  (or colon, or apostrophe) on or off. A 1 indicates on, 0 off.
//  [MSB] (X)(X)(Apos)(Colon)(Digit 4)(Digit 3)(Digit2)(Digit1)
void setDecimals(byte decimals)
{
  s7s.write(0x77);
  s7s.write(decimals);
}

Here is a link to the product information for the display:

https://learn.sparkfun.com/tutorials/using-the-serial-7-segment-display/introduction

any help would be appreciated.

I could post a schematic for the existing board if that helps, but i’m sure nothing is connected to the pin i soldered to.

and then pin 16(I believe that is pin 16)

Is that Arduino pin 16 or the chip pin 16 ?

Does the example program work on standard Arduino hardware ?

   Circuit:
   Arduino -------------- Serial 7-Segment
     5V   --------------------  VCC
     GND  --------------------  GND
      8   --------------------  RX
*/
#include <SoftwareSerial.h>

// These are the Arduino pins required to create a software seiral
//  instance. We'll actually only use the TX pin.
const int softwareTx = 16;
const int softwareRx = 7;

The comments say to connect pin 8 to the 7 segment display. The code says pin 7.

Which pin are you really connecting to the 7 segment display?

the rx pin is not used in the code.

the rx pin refered to in the example code is on the display, not on the mcu. Yes, the display works on a mega.

the only wire aside from vcc and gnd is:

esp pin 16 ~> display rx pin

I think it is pin 16, but sometimes the Arduino ide swaps esp pins around...

sometimes the Arduino ide swaps esp pins around...

Does it ? The Arduino pin numbers rarely if ever match the actual chip pin numbers but they are consistent for a particular board type.

Yes, that is correct. That pin on some datasheets is gpio16, pin 0 on others it's pin 16.

I'm tried both 0 and 16 but it didn't work either way.