Go Down

Topic: MAX7219 woes.. (Read 1 time) previous topic - next topic

db2db


I have some max7219 code that works fine:

Code: [Select]


#include "LedControl.h"

LedControl lc=LedControl(6,9,11,1);  // lc is our object
/* format is: LedControl(data pin, clock pin, load pin, 1) */
/* arduino pin 6 is connected to DATA [pin 1 on max]  */
/* arduino pin 9 is connected to CLK [pin 13 on max] */
/* arduino pin 11 is connected to LOAD [pin 12 on max] */
/* mumber of devices to control - 1 as we are only using a single MAX7219  */
/* always wait a bit between updates of the display */

void setup()
{
  lc.shutdown(0,false);          // The MAX72XX is in power-saving mode on startup,we have to do a wakeup call
  lc.setIntensity(0,5);          // set the brightness to a value 1-15
  lc.clearDisplay(0);            // clear the display
  lc.setScanLimit(0,1);          // set chip number 0 to drive 2 digits
}

void loop()
{
  lc.setChar(0,0,'d',false);
  delay(250);
  lc.setChar(0,1,'b',false);
  delay(250);
}



This was to prove to me that my wiring is all good.

The problem is that I don't want to use this library. I have tried various bits of code to write to the chip, but I just cant seem to get it working without using this library.

Does anyone have some code to just write two digits to the MAX7219? It would be a huge help..

Go Up