Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: alpha_message TP1_matriz
matrixDisplay.h
00001 /* 00002 class to write to a matrix led display. 00003 00004 Written by tonymudd (mbed@tonymudd.co.uk) 00005 00006 */ 00007 #include "mbed.h" 00008 00009 #ifndef MBED_MATRIXDISPLAY_H 00010 #define MBED_MATRIXDISPLAY_H 00011 00012 class matrixDisplay 00013 { 00014 public: 00015 matrixDisplay( float scrollRate, PinName clockPinIn, PinName dataPinIn, 00016 PinName col1, PinName col2, PinName col3, 00017 PinName col4, PinName col5); 00018 virtual ~matrixDisplay(); 00019 void setMessage(char * newMessage); 00020 void stop(); 00021 00022 private: 00023 void colChange(); 00024 void outputCol(int); 00025 void loadDisplay(); 00026 void scrollMessage(); 00027 static const int numOfColumns = 5; 00028 static const int numOfRows = 7; 00029 static const int numOfChars = 4; 00030 static const int numOfLeds = numOfRows * numOfChars; 00031 int column; 00032 // fires when the column changes - fast 00033 Ticker colTick; 00034 // fires to scroll the chars along one - slow. 00035 Ticker scroll; 00036 bool display[numOfColumns][numOfLeds]; // on the display now 00037 char text[numOfChars]; // text on the display 00038 char *message; // the whole message 00039 int whereInMessage; // which character in message to display next 00040 00041 // And the hardware it uses: 00042 DigitalOut * clockPin; 00043 DigitalOut * dataPin; // DigitalOut data(p20); 00044 BusOut * columnsBus; // BusOut columns(p10,p11,p12,p13,p14); 00045 00046 }; 00047 00048 #endif
Generated on Wed Jul 13 2022 16:35:11 by
1.7.2