7 Segment Serial
Overview
Overview
Parts
Arduino microcontroller and carrier board
LiPo battery
7-Segment Serial Display (User Manual, Schematic) Prepare the breadboard
Ground (black wire) to the pad marked "GND"
5v- supplied from Arduino (red wire) to the pad marked "Vcc".
Serial data- from pin D3 (green wire) to the pad marked "Rx"
Program the Microcontroller
/**
* @file: 4 character 7 segment LED displays example
* @date: 4/11/2011
*
* @DESCRIPTION
* modified from: http://www.arunet.co.uk/tkboyd/ec/ec1led4x7ser.htm
* Very, very simple "test" program for Sparkfun
* 4 character 7 segment LED displays, serially driven
* using just the "Rx" input on the module.
* See Sparkfun.com... product codes COM-09764 - COM-09767
*
**/
#include <NewSoftSerial.h>
#define SerInToArdu 2 // for the serial data into the Arduino
#define SerOutFrmArdu 3 // The pin that serial data
NewSoftSerial mySerialPort(SerInToArdu,SerOutFrmArdu);
// creates the serial channel we will use.
//--- Function: Setup ()
void setup()
{
pinMode(SerOutFrmArdu,OUTPUT);
pinMode(SerInToArdu,INPUT); //explicit about data direction over serial lines
mySerialPort.begin(9600);
mySerialPort.print("v"); // To reset display module
}
//--- Function: loop ()
void loop()
{
mySerialPort.print("1234");
delay(600);
mySerialPort.print("2340");
delay(600);
mySerialPort.print("3400");
delay(600);
mySerialPort.print("4000");
delay(600);
mySerialPort.print("0000");
delay(600);
mySerialPort.print("----");
delay(600);
mySerialPort.print("8888");
delay(600);
mySerialPort.print("HEL0");
delay(1800);
mySerialPort.print("xxxx"); //Send an "x" to turn a digit off
delay(1200);
}
ASCII Table and Description
ASCII Table and Description