Hi all,
i have just started getting into Arduino programming and have a project that i am planning. I have been looking around on the internet t0 try to solve what i want to do but with no luck and getting myself more confused!
i am trying to make a counter/ score display. i started off using a LCD screen in my kit and 2 buttons (add 1 point, Add 10 points) the idea is to keep track of a score and display on the screen. I had this code working
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// set up a constant for the score switchPin
const int switchPin = 6;
const int switchPin2 = 7;
int hits = 0;
// variable to hold the value of the switchPin
int switchState = 0;
int switchState2 = 0;
void setup() {
Serial.begin(9600);
// set up the number of columns and rows on the LCD
lcd.begin(16, 2);
// set up the switch pin as an input
pinMode(switchPin,INPUT);
pinMode(switchPin2,INPUT);
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Start Game");
lcd.setCursor(0, 1);
lcd.print("Get Ready");
}
void loop() {
// check the status of the switch
switchState = digitalRead(switchPin);
switchState2 = digitalRead(switchPin2);
// compare the switchState to its previous state
if (switchState == HIGH) {
hits = hits + 10;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Score");
lcd.setCursor(0, 1);
lcd.print(hits);
}
if (switchState2 == HIGH) {
hits = hits + 1;
lcd.clear();
lcd.setCursor(0, 0);
lcd.print("Score");
lcd.setCursor(0, 1);
lcd.print(hits);
}
}
i then wanted to display the score on 4 LED matrix that i got from ebay
http://www.ebay.co.uk/itm/131382969866
and i have connected them up the same as in this instructables
http://www.instructables.com/id/Multiple-LED-Matrixes-with-Arduino/3/
How do i go about getting a similar code to work on the LED matrix?? i dont need the game start bits i just want it to start displaying 0000 and then start counting upwards of 1 or 10 depending on the button pressed and it doesnt need to scroll!
i have got confused on whether i should be looking at using binary type coding or can i send to print
any direction or help would be great!