The OpenSegment Serial Display - 20mm (Green) is a versatile and easy-to-use seven-segment LED display module designed for displaying numeric and certain alphanumeric characters. Its bright green LEDs ensure good visibility in a variety of lighting conditions. This display is commonly used in digital clocks, timers, counters, and other projects where numerical data needs to be presented to the user.
Pin Number | Name | Description |
---|---|---|
1 | VCC | Power supply (3.3V to 7V) |
2 | GND | Ground connection |
3 | RX | Serial receive pin |
4 | TX | Serial transmit pin (not used) |
#include <SoftwareSerial.h>
// Create a software serial port on pins 10 (RX) and 11 (TX)
SoftwareSerial openSegmentSerial(10, 11); // RX, TX
void setup() {
// Start the software serial port at the baud rate of the display
openSegmentSerial.begin(9600);
}
void loop() {
// Send a command to clear the display
openSegmentSerial.write(0x76); // Clear display command
// Display a number with a decimal point
openSegmentSerial.print("12.34");
// Wait for 5 seconds
delay(5000);
// Display a different number
openSegmentSerial.print("5678");
// Wait for another 5 seconds
delay(5000);
}
Note: The above code assumes that the display is set to the default baud rate of 9600 bps. If the baud rate has been changed, update the openSegmentSerial.begin(9600);
line with the correct baud rate.
Q: Can I use this display with a 3.3V microcontroller? A: Yes, the display can be powered with 3.3V, making it compatible with 3.3V microcontrollers.
Q: How do I change the baud rate of the display? A: The baud rate can typically be changed through a series of commands sent to the display. Refer to the manufacturer's datasheet for the specific commands.
Q: Can I display letters as well as numbers? A: Yes, the display can show certain alphanumeric characters. Refer to the character set in the manufacturer's datasheet for supported characters.