I'm gettin a constant "on" for button 1.
#include <Wire.h>
#include "Adafruit_LEDBackpack.h"
#include "Adafruit_GFX.h"
#include "RTClib.h"
int hours1;
int hours2;
int minutes1;
int minutes2;
const int button1= 1; //mode
const int button2= 2; //hours
const int button3= 3; //mins
const int button4= 4; //alarmoff
const int button5= 5; //alarmoff
Adafruit_8x8matrix matrix1 = Adafruit_8x8matrix();
Adafruit_8x8matrix matrix2 = Adafruit_8x8matrix();
Adafruit_8x8matrix matrix3 = Adafruit_8x8matrix();
Adafruit_8x8matrix matrix4 = Adafruit_8x8matrix();
int button1Val; //mode
int button2Val; //hours
int button3Val; //mins
int button4Val; //alarm off
int buttonState = 0; // variable for reading the pushbutton status
int alarmHour;
int alarmMinute;
//int newHour1=0;
//int newHour2=0;
//int newMin2=0;
//int newMin1=0;
RTC_DS1307 RTC;
void setup() {
Serial.begin(9600);
Serial.println("Double 8x8 LED Matrix Test");
// if (button1 == HIGH) {
// digitalWrite(button1,HIGH);
// setAlarm();
// }
// else {
// digitalWrite(button1, LOW);
// printTIME();
//}
//
// if (button2 == HIGH){
// digitalWrite(button2,HIGH);
// hours1 = alarmHour/10+1;
// }
// if (digitalRead(button2) == LOW) {
// printTIME();
//// hours1=alarmHour/10+1;
// }
// else {
// hours1=alarmHour/10;
//
// }
// pinMode(button1,OUTPUT);
// pinMode(button2,OUTPUT);
// pinMode(button3,OUTPUT);Is this wrong? I feel like I'm not doing the inputs and out puts right
// pinMode(button4,OUTPUT);
// pinMode(button1,OUTPUT);
Wire.begin();
RTC.begin();
matrix1.begin(0x71); // pass in the address
matrix2.begin(0x70); // pass in the address
matrix3.begin(0x72); // pass in the address
matrix4.begin(0x73); // pass in the address
// matrix1= (now.hour/10);
// matrix2= new.hour- (matrix1 x 10);
// matrix3= now.minute/10;
// matrix4= new.minute - (matrix4 x 10);
pinMode(button1, INPUT);
pinMode(button2, INPUT);
pinMode(button3, INPUT);Is this completely wrong?
pinMode(button4, INPUT);
pinMode(button5, INPUT);
pinMode(hours1,OUTPUT);
Could you guys maybe help me review my setup code ? just to make sure all this is right