Quote:
Originally Posted by nickdigger
Are you using the PWM 10/11 for buttons? Without looking at the specs, i assumed the mega had the same pinouts as all other Arduinos, for the base set of pins, and then have the extras off to the side... for backward compatibility purposes. Am i correct?
|
I thought that would be true, but I guess not. Kudos to Bobski for pointing that out.
Quote:
Originally Posted by bobski
Okay... The big difference I notice between the standard boards and the mega is the pin numbering when using the analog pins as standard digital I/O. The scheme is the same but the numbering is different: the analog pins can be addressed as digital pins just beyond the range of dedicated digital pins. In the case of standard boards, the digital pins are numbered 0-13, so the digital-analog pins become 14-19 (or 14-21 for the Seeeduino). The mega boards have 54 digital I/O pins (0-53) so the analog pins become 54-69. The Seeduino Mega has an additional bank of 16 digital I/O pins, but these are unnumbered, so the standard mega numbering scheme applies.
Paste this into Arduino and upload it to your board. Grounding any of the first 13 standard digital pins (0-12), or any of the 16 analog pins should make the "L" indicator LED light. Pin 13 gets left out because it's being used to drive the LED.
|
Thank you for that bit of code Bobski. The 'duino mega -does- work, and I got the code to work properly. Although if I removed any of the inputs the led just stayed lit, which was a little irritating, but whatever.
I see why you both are using your own custom codes. Trying to decipher the code is confusing as hell, even if I don't know what i'm doing.
I soldered everything back up after testing the code Bobski posted, and the screen is working just fine, although I am still stuck on the buttons, and the vss. I should probably test it with the injectors, but for the moment I am going to pass on that. Once I get the speedo working I'll hook up the injectors and then from there I'll just plug everything in.
So all there is left to do is to get the buttons and vss working. I would like to stick to the original code so that it is just a souped up version of the Mpguino that can run mainly on the Mega series, and that is open for later custom additions, however confusing they may be to add in at a later time.
Again, thank you Bobski and Nickdigger for your help on this.
Update: So I found an area of code I get to tweak with.
Quote:
#define lbuttonPin 55 // Left Button, on analog 3, Mega would be analog 1
#define mbuttonPin 56 // Middle Button, on analog 4 Mega would be analog 2
#define rbuttonPin 57 // Right Button, on analog 5 Mega would be analog 3
#define vssBit 0 // pin14 is a bitmask 1 on port C
#define lbuttonBit 8 // pin17 is a bitmask 8 on port C
#define mbuttonBit 6 // pin18 is a bitmask 16 on port C
#define rbuttonBit 32 // pin19 is a bitmask 32 on port C
|
If I change the bitmask settings, the screens just utterly spaz out. I'm guessing that's noise, and a lot of it. If I change them back to the stock settings, they don't change at all. I'd love to include the Bounce bit, but I'm still figuring out how. And I think I figured out that there isn't much love for the Seeeduino Mega. Didn't realize nobody has really made a pinout chart for it yet, and I think it is still different from the Arduino Mega.
Anybody know what the bitmask is for and/or what it does?
And this is a video of just what this thing is doing.