Git Product home page Git Product logo

rgbdigit's Introduction

This project is licensed under Creatice Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

RGBDigit

Arduino library for http://rgbdigit.com/

The purpose of this library is to provide a simple and intuitive interface to programming an RGBDigit.

Note that it is a work in progress. Not all functionality (like reading temerature values) is covered yet.

Installation instructions

  • Download the zip file
  • Extract it to your Arduino library folder
  • Rename the RGBDigit-master folder to RGBDigit

You also have to download and install the following libraries:

Use the sketches in the Examples directory to test the library!

Segments per digit and choice of NeoPixel type

You can ignore this section if you are working with the standard RGBDigit module.

If you have made your own RGBDigit then you can use this section to set the library up for your digit.

Segments per digit

The standard 7-segment display has 8 segments (7 for the digit and a decimal point). If your display has only the 7 (ie no decimal point) then you need to call the constructor specifying that there are 7 segments per digit as opposed to the default 8.

RGBDigit rgbDigit(nDigits, 6); in the examples becomes RGBDigit rgbDigit(nDigits, 6, NEO_GRB + NEO_KHZ800, 7);

Choice of NeoPixel type

The standard RGBDigit module uses the type NEO_GRB + NEO_KHZ800 but if you've made your own this might be different. This may cause incorrect colours to display for example. You can set the type of NeoPixel to use in the constructor:

RGBDigit rgbDigit(nDigits, 6); in the examples becomes RGBDigit rgbDigit(nDigits, 6, NEO_GRB + NEO_KHZ800); (simply use the appropriate definition from the documentation of the Arduino_NeoPixel library. If the option is omitted it defaults to NEO_GRB + NEO_KHZ800.

Class methods

Note that for all digit parameters, the first digit has index 0, the second digit has index 1, etc.

Where segmentsPerDigit is not specified in the constructor call, or is set to 8; the segment parameters can be values from 0 to 7, every number corresponding to the following positions:

   0
5     1
   6
4     2
   3      7

Where segmentsPerDigit is set to 7 the segment parameters can be values from 0 to 6 (no decimal point) and correspond to the following positions:

   0
5     1
   6
4     2
   3
RGBDigit(int nDigits, int pin = 12, neoPixelType t=NEO_GRB + NEO_KHZ800, int segmentsPerDigit = 8);

The constructor of the RGBDigit class. nDigits is the number of digits. pin is the pin number, which defaults to pin 12 if this parameter is omitted. Provision is made to change the type of NeoPixel using the types defined in the Adafruit_NeoPixel library. This defaults to NEO_GRB + NEO_KHZ800 the type used in the RGBDigit. Further more the option is given to set the number of segments per digit to 7 or 8 depending on whether a decimal point is present on the display (see above for details).

void begin();

Initialises the RGBDigit.

void clearAll();

Clear all digits.

void setDigit(int number, int digit, byte red, byte green, byte blue);

Show number (from 0 - 9) on digit in color rgb(red,green,blue).

void setDigit(char character, int digit, byte red, byte green, byte blue);

Show character on digit in color rgb(red,green,blue). Valid characters are letters (case insensitive) from a to z, the dot (.), dash (-), underscore (_), brackets ( ( ) { } [ ] ) and space . Use an asterisk (*) for the degree sign.

void clearDigit(int digit);

Clear digit.

void showDot(int digit, byte red, byte green, byte blue);

Show dot on digit in color rgb(red,green,blue). This does nothing when segmentsPerDigit is set to 7.

void clearDot(int digit);

Clear dot on digit. This does nothing when segmentsPerDigit is set to 7.

void segmentOn(int digit, byte segment, byte red, byte green, byte blue);

Show segment on digit in color rgb(red,green,blue).

void segmentOff(int digit, byte segment);

Clear segment on digit.

bool isSegmentOn(int digit, byte segment);

Returns True if segment on digit is on. Otherwise, returns False.

void setColor(byte red, byte green, byte blue);

Set the color of all digits to color rgb(red,green,blue).

void setColor(int digit, byte red, byte green, byte blue);

Set the color of digit to color rgb(red,green,blue).

void setBrightness(byte brightness);

Set the brightness of the strip to a value from 0 to 255.

byte getBrightness();

Returns the brightness of the strip.

rgbdigit's People

Contributors

ralphcrutzen avatar samscam avatar yknivag avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

rgbdigit's Issues

Set digit resets dot

If you turn on the dot with setDot and then set a digit using setDigit the dot is turned off.
Would it be possible to don't reset this value. If I set it afterwards you will notice flickering with fast changing numbers

Foutmeldingen

Hi Ralph,

Deze foutmeldingen krijg ik:

Arduino: 1.6.5 (Mac OS X), Board:"Arduino Micro"

In file included from /Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:10:0:
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:18:18: error: variable 'monthStr1' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr1[] PROGMEM = "January";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:19:18: error: variable 'monthStr2' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr2[] PROGMEM = "February";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:20:18: error: variable 'monthStr3' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr3[] PROGMEM = "March";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:21:18: error: variable 'monthStr4' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr4[] PROGMEM = "April";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:22:18: error: variable 'monthStr5' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr5[] PROGMEM = "May";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:23:18: error: variable 'monthStr6' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr6[] PROGMEM = "June";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:24:18: error: variable 'monthStr7' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr7[] PROGMEM = "July";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:25:18: error: variable 'monthStr8' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr8[] PROGMEM = "August";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:26:18: error: variable 'monthStr9' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr9[] PROGMEM = "September";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:27:19: error: variable 'monthStr10' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr10[] PROGMEM = "October";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:28:19: error: variable 'monthStr11' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr11[] PROGMEM = "November";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:29:19: error: variable 'monthStr12' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthStr12[] PROGMEM = "December";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:31:22: error: variable 'monthNames_P' must be const in order to be put into read-only section by means of 'attribute((progmem))'
PGM_P monthNames_P[] PROGMEM =
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:37:26: error: variable 'monthShortNames_P' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char monthShortNames_P[] PROGMEM = "ErrJanFebMarAprMayJunJulAugSepOctNovDec";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:39:16: error: variable 'dayStr0' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char dayStr0[] PROGMEM = "Err";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:40:16: error: variable 'dayStr1' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char dayStr1[] PROGMEM = "Sunday";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:41:16: error: variable 'dayStr2' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char dayStr2[] PROGMEM = "Monday";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:42:16: error: variable 'dayStr3' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char dayStr3[] PROGMEM = "Tuesday";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:43:16: error: variable 'dayStr4' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char dayStr4[] PROGMEM = "Wednesday";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:44:16: error: variable 'dayStr5' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char dayStr5[] PROGMEM = "Thursday";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:45:16: error: variable 'dayStr6' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char dayStr6[] PROGMEM = "Friday";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:46:16: error: variable 'dayStr7' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char dayStr7[] PROGMEM = "Saturday";
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:48:20: error: variable 'dayNames_P' must be const in order to be put into read-only section by means of 'attribute((progmem))'
PGM_P dayNames_P[] PROGMEM = { dayStr0,dayStr1,dayStr2,dayStr3,dayStr4,dayStr5,dayStr6,dayStr7};
^
/Users/arjan/Documents/Arduino/libraries/Time/DateStrings.cpp:49:24: error: variable 'dayShortNames_P' must be const in order to be put into read-only section by means of 'attribute((progmem))'
char dayShortNames_P[] PROGMEM = "ErrSunMonTueWedThrFriSat";
^
Multiple libraries were found for "IRremote.h"
Used: /Users/arjan/Documents/Arduino/libraries/IRremote
Not used: /Applications/Arduino.app/Contents/Java/libraries/RobotIRremote
Fout bij compileren.

Dit rapport zou meer informatie hebben met
"Tijdens de compilatie uitgebreide uitvoer weergeven"
ingeschakeld in Bestand > Voorkeuren.

Library covers too much other functionality

Hello!

Thanks for this code.

This library seems to be doing other functions that should be taken out of the library's domain.

Reading infrared codes, working with time and date, reading temperature are not really important for the purpose of the RGB Digit library and could be taken out to be a separate library (or use existing Arduino libraries).

I propose taking the functions that are not directly related to driving the 7 segment display out.

How to change segment positions ?

Hi,

First of all thank for the library, and I would like to know how we can change the segment positions into a different mode like

---5
-4 --6
---3
-0---2
---1

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.