Sign up ×
Arduino Stack Exchange is a question and answer site for developers of open-source hardware and software that is compatible with Arduino. It's 100% free, no registration required.
#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

share|improve this question
    
void blipcount(){ blip++; }; why the ; at the end of the function? – FuaZe Apr 15 at 11:57

1 Answer 1

up vote 1 down vote accepted

You have a typo:

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

Should be:

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

Note the lower-case "c".

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.