Skip to content

Commit

Permalink
Reverting to the latest working version
Browse files Browse the repository at this point in the history
All commits after this use the SevSeg library to control the display and
do not work with the display at the moment. As these displays are
beginning to go live, I'd like a working version only of the code to be
hosted here.
  • Loading branch information
Jim Lindblom committed Oct 31, 2012
1 parent 04a9283 commit 517d2f2
Show file tree
Hide file tree
Showing 7 changed files with 523 additions and 597 deletions.
File renamed without changes.
File renamed without changes.
@@ -0,0 +1,55 @@
/*
9-23-2012
Spark Fun Electronics
Nathan Seidle
This code is public domain but you buy me a beer if you use this and we meet someday (Beerware license).
Serial7Segment is an open source seven segment display.
This is example code that shows how to display basic numbers on the display.
To get this code to work, attached an Serial7Segment to an Arduino Uno using the following pins:
Pin 7 on Uno (software serial RX) to TX on Serial7Segment
Pin 8 on Uno to RX on Serial7Segment
VIN to PWR
GND to GND
*/

#include <SoftwareSerial.h>

SoftwareSerial Serial7Segment(7, 8); //RX pin, TX pin

int cycles = 0;

void setup() {

Serial.begin(9600);
Serial.println("OpenSegment Example Code");

Serial7Segment.begin(9600); //Talk to the Serial7Segment at 9600 bps

//Reset the display
Serial7Segment.write('v'); //This forces the cursor to return to the beginning of the display
}

void loop() {
Serial.print("Cycle: ");
Serial.println(cycles++);

char tempString[10]; //Used for sprintf
sprintf(tempString, "%4d", cycles); //Convert deciSecond into a string that is right adjusted
//sprintf(tempString, "%d", cycles); //Convert deciSecond into a string that is left adjusted (requires digit 1 command)
//sprintf(tempString, "%04d", cycles); //Convert deciSecond into a string with leading zeros
//sprintf(tempString, "%4X", cycles); //Count in HEX, right adjusted
//int negativeCycles = cycles * -1;
//sprintf(tempString, "%4d", negativeCycles); //Shows a negative sign infront of right adjusted number

Serial7Segment.print(tempString);

// delay(1);
}



0 comments on commit 517d2f2

Please sign in to comment.