0
#include<PinChangeInt.h>
#define SensorPin 2
int ledPin = 10;
int BuzzerPin = 12;
volatile byte blip = 0;
void blipcount(){
 blip++;
};
void setup() {
 // put your setup code here, to run once:
 pinMode(SensorPin,INPUT);
 pinMode(ledPin,OUTPUT);
 pinMode(BuzzerPin,OUTPUT);
 PCintPort::attachInterrupt(SensorPin,blipCount,FALLING);
 Serial.begin(9600);
}
void loop() {
 // put your main code here, to run repeatedly:
 if(digitalRead(SensorPin)==HIGH){
 digitalWrite(ledPin,HIGH);
 digitalWrite(BuzzerPin,HIGH);
 Serial.print("blipcoun:\t");
 Serial.println(blip,DEC);
 }
 if(digitalRead(SensorPin)==LOW){
 digitalWrite(ledPin,LOW);
 digitalWrite(BuzzerPin,LOW);
 }
}

I am using arduino uno for a project.I need to record when my sensor gives a high value but i need it to read only falls in pulses.The program is giving error as

Arduino: 1.6.3 (Windows 8.1), Board: "Arduino Uno"
Sense.ino: In function 'void setup()':
Sense.ino:14:38: error: 'blipCount' was not declared in this scope
Error compiling

please tell me what is the problem with the function.

The library link is https://code.google.com/p/arduino-pinchangeint/downloads/list

tested the code on both 1.72 and 2.19

asked Apr 15, 2015 at 10:49
1
  • void blipcount(){ blip++; }; why the ; at the end of the function? Commented Apr 15, 2015 at 11:57

1 Answer 1

1

You have a typo:

PCintPort::attachInterrupt(SensorPin,blipCount,FALLING);

Should be:

PCintPort::attachInterrupt(SensorPin,blipcount,FALLING);
 ^

Note the lower-case "c".

answered Apr 15, 2015 at 14:53

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.