This may be a dumb question or observation but ... I an trying to read/write digital I/O on the Arduino MEGA1280 but cannot seem to read or write digital I/O above address 20.
Have I missed a compiler directive somewhere or is there an IDE setting? The IDE is set for the correct board under TOOLS.
My code simply toggles the LED and at the same time toggles the I/O port set by the int testPin. If the testPin is between 0 and 21, it works. No port above 21 works though.
Thanks for your help
int ledPin = 13; // select the pin for the LED
int testPin = 21;
void setup() {
// declare the ledPin as an OUTPUT:
pinMode(ledPin, OUTPUT);
pinMode(testPin, OUTPUT);
}
void loop() {
// turn the ledPin on
digitalWrite(ledPin, HIGH);
digitalWrite(testPin, HIGH);
Nothing wrong with your sketch, I changed it to pin 22 and loaded into my Seeeduino mega board and pin 22 toggles fine. Are you sure you have identified the pin numbers correctly on the shield connectors? You may be toggling the correct pins but measuring or wiring to the wrong pin numbers.
[edit]Edit: Just saw your reply, your not a idiot, just a beginner to arduinos. ;)[/edit]