chipKIT® Development Platform

Inspired by Arduino™

Software Serial example

Created Sat, 14 Sep 2013 21:15:30 +0000 by guymc


guymc

Sat, 14 Sep 2013 21:15:30 +0000

I picked up a cool 4 digit serial display from SparkFun recently:

https://www.sparkfun.com/products/11441

It was remarkably easy to set up and use. Here's some code to drive the display from any chipKIT pin:

#include <SoftwareSerial.h>

// assign pins for RX, TX
#define SERIAL_IN 14
#define SERIAL_OUT 0

// define a soft serial port (RX, TX)
SoftwareSerial mySerial =  SoftwareSerial(SERIAL_IN, SERIAL_OUT);

// ...and so on

// Put this statement in setup()
  mySerial.begin(9600);  // set the data rate

// Print a 4 digit number
  char tempString[10];
  unsigned int frequency;
 
  sprintf(tempString, "%4d", frequency); 
  mySerial.print('v');  // clear the display
  mySerial.print(tempString);

Jacob Christ

Sat, 26 Oct 2013 10:14:15 +0000

Which display?

Jacob


guymc

Wed, 30 Oct 2013 22:14:51 +0000

I just edited the original post to include a link to the display (and to clarify the code slightly.)

Thanks, Jacob!