SparkFun Forums 

Where electronics enthusiasts find answers.

Topics pertaining to the Arduino Core & software used with the Artemis module and Artemis development boards.
#243149
I have an Artemis ATP and I'm experiencing a really confusing. Here's the simplest test case I've been able to write to reproduce the issue. For context, I'm testing this with no wires connected to the pins.
Code: Select all
void setup() {
	Serial.begin(9600);
	pinMode(D4, INPUT_PULLUP);

	// attachInterrupt(D4, [](){}, FALLING);
}

void loop() {
	Serial.println(digitalRead(D4));
	delay(100);
}

The above code pulls D4 to HIGH and produces the following output, as expected:
Code: Select all
1
1
1
1
1
...

If I uncomment the attachInterrupt line, then I get output that looks like this:
Code: Select all
1
0
0
1
0
1
1
0
...

It looks like the pin begins floating. Again, this is all with no wires connected to any pins. Is there some consideration I'm not aware that I need to be making in this very simple example?

Additionally, if I put a Serial.writeln() call in the interrupt, I find that it's being called constantly, again with no wires attached.
 Topic permissions

You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum