A generic library to support Max7221 chip for 8 digit 7 segment displays

Dependencies:   mbed

Dependents:   Example_Max7221

You are viewing an older revision! See the latest version

Homepage

Example Max7221 Library usage

 #include "mbed.h"
 #include "Max7221.h"
 

// p5: DIN, p7: CLK, p8: LOAD/CS
Max7221 max7221disp1(p5, p7, p8);

int count=-99;

void loop(void) {
   max7221disp1=count;
   if (count < 100)
      count=count+1;
   else 
      count=-99; 
}

int main() {  
    max7221disp1.Setup();
    max7221disp1.WriteFloat(123.125);
    wait(1.0);  

    while (1) {
        loop();
        wait(1.0);
    }
}

    max7221disp1.WriteFloat(123.125);
    wait(1.0);  

    while (1) {
        loop();
        wait(1.0);
    }
}

Import programExample_Max7221

Example_Max7221


All wikipages