Thank you, I took out the SPI library at the top.
However, it didnt do anything different.
Below is the code that im using right now...
#include <LiquidCrystal.h> //Used for the LCD Module HAVE TO GO TO SKETCH-> Import Library...
#include "LedControl.h" // This library helps with using the 7-segment driver(MAX72XX)
/*
pin 12 is DataIn
pin 11 is CLK
pin 10 is LOAD (Latch)
*/
//Constants wont change
const int Data = 12; // Data line into the chip
const int CLK = 11; //CLOCK Signal for the chip
const int LOAD = 10; //The pin to control the latch or load value on chip
const int driver_num = 1; //number of MAX72XX's we are linked or using in total
LedControl lc=LedControl(Data,CLK,LOAD,driver_num); //this line assigns the pins to what we have labeled in the comment block above
//The last number states how many devices aka how many MAX72XX's Note: the lc is just a variable that is created
/*
Gets the max number of devices attached to the LedControl
Returns the number of devices attached
*/
//int LedControl::getDeviceCount();
// Variables that will change: AKA software variables
int milliseconds = 0; //will keep track of milliseconds
int countOnes = 0; // will keep track of seconds
int countTwos = 0; // will keep track of tens of seconds
int countThrees = 0; // will keep track of minutes
int countFours = 0; // will keep track of tens of minutes
int countFives = 0; // will keep track of hours
int countSix = 0; // will keep track of tens of hours
int amPM = 0; // low for AM, High for pm
//INTERRUPT SERVICE ROUTINE FOR TIMER 1
ISR(TIMER1_OVF_vect) {
TCNT1 = 0xC180; //this resets the timer to this preloaded value after every overflow
milliseconds = milliseconds + 1; //increments this 1 each time an overflow occurs
}
void setup() { //Code to be run 1 time goes here
//*******************************************TIMER INITIALIZATION CODE************************************************************
TIMSK1 = 0x01;
TCCR1A = 0x00;
TCNT1 = 0xC180; //Reload value of 49,536, so we can get a 1millisecond clock...
TCCR1B = 0x01; //No prescaler (page 137 Atmel Datasheet)
//***********************************************************************************************************************************
//wakes up the MAX72XX from power-saving mode
lc.shutdown(0,false); //turns off shutdown mode, so you can display stuff
//set a medium brightness for the display
lc.setIntensity(0,14); //this sets intesity for digits 0 to 3
//clear display
lc.clearDisplay(0);
}
void loop() { //Infinate Loop
//BEGINING OF MAIN TIMER SECTION
if(milliseconds == 1000){
milliseconds = 0;
countOnes += 1; //after 1000 milliseconds, seconds will be incrmented 1
}
if(countOnes == 10){
countOnes = 0;
countTwos +=1;
}
if(countTwos == 6){
countTwos =0;
countThrees += 1; //means that when 60 seconds pass, minutes is incremented 1
}
if(countThrees == 10){
countThrees = 0; // if 10 minutes goes buy, this goes to zero and the ten minutes spot gets incrmented one
countFours += 1; // tens of minutes
}
if(countFours == 6){
countFours = 0; // Sixty seconds equal 1 hour
countFives += 1; // hours is incremented
}
if(countFives == 10){
countFives = 0; //count to 9 hours, then when get to 10 hours the place gets rolled over
countSix += 1;
}
if(countSix == 2){
countSix = 0; //This can only get to the vaule of 0 or 1 any higher, it resets
if(amPM == 1){
amPM = 0; // this code inverts PM to am or vis versa
}
else{
amPM = 1;
}
} // end of countSix
//lc.setDigit(0,0,0x04, false);//seconds place output countThrees
// device 0(only 1 Max72xx) , digit(0), number to output and then false
delay(2000);
lc.setDigit(0,1,countFours, false); // device 0(only 1 Max72xx) , digit, number to output and then false
delay(2000);
lc.setDigit(0,2,countFives, false); //hours place output
// device 0(only 1 Max72xx) , digit(2), number to output and then false
delay(2000);
lc.setDigit(0,3,countSix, false); //tens of hours place output
// device 0(only 1 Max72xx) , digit(3), number to output and then false
delay(2000);
lc.setChar(0,0,'0',false);
delay(2000);
lc.shutdown(0,true); //turns off shutdown mode, so you can display stuff
delay(2000);
lc.shutdown(0,false); //turns off shutdown mode, so you can display stuff
delay(2000);
lc.setChar(0,0,'1',false);
delay(2000);
lc.setChar(0,0,'2',false);
delay(2000);
lc.setChar(0,0,'3',false);
delay(2000);
lc.setChar(0,0,'4',false);
delay(2000);
lc.setChar(0,0,'5',false);
delay(2000);
lc.setChar(0,0,'6',false);
delay(2000);
lc.setChar(0,0,'7',false);
delay(2000);
lc.setChar(0,0,'8',false);
delay(2000);
lc.setChar(0,0,'9',false);
delay(2000);
lc.setChar(0,0,'a',false);
delay(2000);
lc.setChar(0,0,'b',false);
delay(2000);
lc.setChar(0,0,'c',false);
delay(2000);
lc.setChar(0,0,'d',false);
delay(2000);
lc.setChar(0,0,'e',false);
delay(2000);
lc.setChar(0,0,'f',false);
delay(2000);
} //END OF LOOP
//END OF MAIN TIMER SECTION
As seen at the bottom of my code i attempt to go through all the characters... but what i can see is no numbers, but the decimal points stay lit at all times, untill it enters shutdown mode, that works. then upon shutdown mode being turned off, the decimal points are lit again for and still nothing on the other segments...
Any ideas?
Also i will draw up a hardware diagram to see if that might be wrong too... i think its correct however, since ive gone through it multiple times.
Thanks agian!
Zack