Created Mon, 16 Jan 2012 03:12:20 +0000 by Iggymo
Mon, 16 Jan 2012 03:12:20 +0000
My first post...be gentle ;)
I am trying to create a scoreboard for a friends' ball blaster arcade game. It has 8 7-segment LEDs... 4 for a simple countdown timer, and the other 4 for two, 2-digit score displays (two team scores). I also need a start button, a reset button, and an external relay to control an air compressor (Yes, I will use external relays, contactors, etc for HV)
I Chose the ChipKit Max32 for the number of I/Os and the "All in One" aspect. I was hoping to use it and some supporting electronics to interface to larger 7 segment displays and other equipment.
I have found code on other sites that show a basic 4 digit countdown function, but when I try to run it on the Chipkit Max32, I get library errors:
countdown.cpp:79:4: error: expected constructor, destructor, or type conversion before '(' token countdown.cpp: In function 'void setup()': countdown.cpp:360:3: error: 'TIMSK1' was not declared in this scope countdown.cpp:361:3: error: 'TCCR1A' was not declared in this scope countdown.cpp:363:3: error: 'TCNT1' was not declared in this scope countdown.cpp:365:3: error: 'TCCR1B' was not declared in this scope countdown.cpp: In function 'void loop()': countdown.cpp:381:9: error: 'TCCR1B' was not declared in this scope countdown.cpp:385:9: error: 'TCCR1B' was not declared in this scope countdown.cpp:499:5: error: 'TCCR1B' was not declared in this scope
Am I missing some libraries? Do the proper ones exist? Would someone be willing to look at the code and let me know where I can improve/change to correct these issues?
I am new to these microcontrollers but have some (very little) programming experience in C++ (Allbeit several years ago) Any assistance would be helpful.
Mon, 16 Jan 2012 08:06:36 +0000
What you are missing is an Arduino. Those are Atmel registers, and the code will only work on an atmel based Arduino.
Mon, 16 Jan 2012 15:08:52 +0000
Also make sure the Chipkit is selected in the "Boards" menu.
Mon, 16 Jan 2012 19:06:36 +0000
And in the same menu select the correct COM port (you can find it in device manager).
I am using my chipkit UNO32 with the TLC5940 and common ANODE 7 segment digits. I had to write the program myself (to display 1, light up LEDs number x and y), but it only uses 5 pins on the board. You can find the library for the TLC in this forum. Just make sure you are using common anode digits.
Sun, 22 Jan 2012 20:57:55 +0000
Thanks for the replies! I knew there was something fundamental I was missing. I do have the right board selected, and I have been uploading snippits of code to it and testing the 7 segment with success, I just was not able to figure why the code for the timer was not working, I was assuming it was a library difference and turns out that is correct. Well, off the the programming chair to try and write some code for a timer/countdown timer!!