First Commit
This commit is contained in:
commit
31565dcde2
14 changed files with 970 additions and 0 deletions
38
lib/MAX7219/examples/Demo/Demo.ino
Normal file
38
lib/MAX7219/examples/Demo/Demo.ino
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
// Demo of MAX7219 library
|
||||
// Author: Nick Gammon
|
||||
// Date: 17 March 2015
|
||||
|
||||
#include <SPI.h>
|
||||
#include <bitBangedSPI.h>
|
||||
#include <MAX7219.h>
|
||||
|
||||
const byte chips = 1;
|
||||
|
||||
// 1 chip, bit banged SPI on pins 6, 7, 8
|
||||
MAX7219 display (chips, 6, 7, 8); // Chips / LOAD / DIN / CLK
|
||||
|
||||
void setup ()
|
||||
{
|
||||
display.begin ();
|
||||
display.sendString ("HELLO _-_-_-_-");
|
||||
delay (2000);
|
||||
display.setIntensity (2);
|
||||
display.sendString ("Lo Light");
|
||||
delay (2000);
|
||||
display.setIntensity (6);
|
||||
} // end of setup
|
||||
|
||||
// scrolling display of all available characters
|
||||
void loop ()
|
||||
{
|
||||
char buf [(chips * 8) + 1];
|
||||
for (char i = '0'; i < 'z'; i++)
|
||||
{
|
||||
for (byte j = 0; j < (chips * 8); j++)
|
||||
buf [j] = i + j;
|
||||
buf [chips * 8] = 0;
|
||||
display.sendString (buf);
|
||||
delay (1000);
|
||||
} // end of for loop
|
||||
} // end of loop
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue