system
February 16, 2014, 9:13am
1
I have a problem, SOS~~I don't know why the program doesn't work? Oh, the arduino is mega r3
#include<arv/io.h>
#include<arv/interrupt.h>
int ledPin=13;
int sensorPin=2;
volatile boolean flag=0;
ISR(INTO_vect){
digitalWrite(ledPin,1);
}
void setup(){
pinMode(ledPin,OUTPUT);
sei ();
//enable INT0
EIMSK|=1;
//clear existing flags
EICRA &=~3;
EICRA|=0;
}
void loop()
{
digitalWrite(sensorPin,0);
}
what do you expect? - we don't know what it should do -
what does it do?
what have you tried so far?
MarkT
February 16, 2014, 10:10am
3
Why aren't you using attachInterrupt()?
system
February 16, 2014, 10:33am
4
robtillaart:
what do you expect? - we don't know what it should do -
what does it do?
what have you tried so far?
oh~~sorry,it's my mistake. I want to let the program into the interrupt,then light on the led. But, the led is not light on now.
system
February 16, 2014, 10:34am
5
MarkT:
Why aren't you using attachInterrupt()?
I want to learn how the interrupt works inside .
westfw
February 16, 2014, 12:03pm
6
ISR(INTO_vect){
That looks like an O rather than a 0...
system
February 16, 2014, 12:16pm
7
westfw:
ISR(INTO_vect){
That looks like an O rather than a 0...
It's the number zero but the O, I still can not enter the interrupt function.Why???
system
February 16, 2014, 1:13pm
8
I still can not enter the interrupt function.Why???
Do you KNOW that using attachInterrupt(), using the same function (contents) actually works? The question is what problem are you trying to solve? You may have more than one.
system
February 16, 2014, 1:20pm
9
PaulS:
I still can not enter the interrupt function.Why???
Do you KNOW that using attachInterrupt(), using the same function (contents) actually works? The question is what problem are you trying to solve? You may have more than one.
It's no problem to use the attachInterrupt().....