Devices & Components
Arduino Uno Rev3
Rotary potentiometer (generic)
Breadboard (generic)
Evaluation Kit, MAX14745 Wearable Charge Management Solution
LED Dot Matrix Display, Red
Jumper wires (generic)
Project description
Code
The code
c_cpp
Plug in the arduino and wire it up run the code you may need to download a library called LedControl :)
1#include <LedControl.h> 2 3const int DIN = 12; 4const int CS = 11; 5const int CLK = 10; 6 7//byte smile[8]= {0x3C,0x42,0xA5,0x81,0xA5,0x99,0x42,0x3C}; 8//byte neutral[8]= {0x3C,0x42,0xA5,0x81,0xBD,0x81,0x42,0x3C}; 9//byte frown[8]= {0x3C,0x42,0xA5,0x81,0x99,0xA5,0x42,0x3C}; 10//byte m[8]= {0xE7,0xFF,0xFF,0xDB,0xDB,0xDB,0xC3,0xC3}; 11byte One[8] = {0x00,0x00,0x88,0x84,0xFE,0x80,0x80,0x00,}; 12byte Two[8] = {0x00,0x00,0x88,0xC4,0xA4,0x94,0x88,0x00,}; 13byte Three[8] = {0x00,0x00,0x82,0x91,0x91,0xA9,0xEE,0x00,}; 14byte Four[8] = {0x00,0x00,0x3F,0x20,0x20,0x20,0xFF,0x20,}; 15byte Five[8] = {0x00,0x00,0x9F,0x91,0x91,0x91,0x61,0x00,}; 16byte Six[8] = {0x00,0x00,0x78,0x8C,0x8A,0x89,0x71,0x00,}; 17byte Seven[8] = {0x00,0x81,0x41,0x21,0x11,0x09,0x07,0x01,}; 18byte Eight[8] = {0x00,0x6E,0x91,0x91,0x91,0x91,0x6E,0x00,}; 19byte Nine[8] = {0x00,0x06,0x09,0x09,0x09,0xFE,0x00,0x00,}; 20byte Ten[8] = {0x04,0x02,0x01,0xFF,0x00,0xFF,0x81,0xFF,}; 21byte Eleven[8] = {0x04,0x02,0xFF,0x00,0x04,0x02,0xFF,0x00,}; 22byte Twelve[8] = {0x04,0x02,0xFF,0x00,0xE4,0x92,0x8A,0x84,}; 23byte Thirteen[8] = {0x04,0x02,0xFF,0x00,0x82,0x92,0x92,0xFE,}; 24byte Fourteen[8] = {0x04,0x02,0xFF,0x00,0x1E,0x10,0x10,0xFE,}; 25byte Fifteen[8] = {0x04,0x02,0xFF,0x00,0x9E,0x92,0x92,0xE2,}; 26byte Sixteen[8] = {0x04,0x02,0xFF,0x00,0xFE,0x92,0x92,0xE2,}; 27byte Error[8] = {0x7F,0x49,0x49,0x00,0x7F,0x0D,0x77,0x00,}; 28 29LedControl lc=LedControl(DIN,CLK,CS,0); 30 31void setup(){ 32 lc.shutdown(0,false); //The MAX72XX is in power-saving mode on startup 33 lc.setIntensity(0,1); // Set the brightness to maximum value 34 lc.clearDisplay(0); // and clear the display 35 Serial.begin(9600); 36} 37 38void loop(){ 39 40 int Number = analogRead(A0); 41 int checknum = Number/64+1; 42 if(checknum == 1){ 43 printByte(One); 44 }else if(checknum == 2){ 45 printByte(Two); 46 }else if(checknum == 3){ 47 printByte(Three); 48 }else if(checknum == 4){ 49 printByte(Four); 50 }else if(checknum == 5){ 51 printByte(Five); 52 }else if(checknum == 6){ 53 printByte(Six); 54 }else if(checknum == 7){ 55 printByte(Seven); 56 }else if(checknum == 8){ 57 printByte(Eight); 58 }else if(checknum == 9){ 59 printByte(Nine); 60 }else if(checknum == 10){ 61 printByte(Ten); 62 }else if(checknum == 11){ 63 printByte(Eleven); 64 }else if(checknum == 12){ 65 printByte(Twelve); 66 }else if(checknum == 13){ 67 printByte(Thirteen); 68 }else if(checknum == 14){ 69 printByte(Fourteen); 70 }else if(checknum == 15){ 71 printByte(Fifteen); 72 }else if(checknum == 16){ 73 printByte(Sixteen); 74 }else{ 75 printByte(Error); 76 } 77 //lc.clearDisplay(0); 78 79 80} 81 82 83void printByte(byte character []) 84{ 85 int i = 0; 86 for(i=0;i<8;i++) 87 { 88 lc.setRow(0,i,character[i]); 89 } 90} 91
Downloadable files
Wiring connectinons
I dont have fritzing so this the next best thing \_('/')_/
Wiring connectinons

Comments
Only logged in users can leave comments