Skip to content

Question: Arduino gets freezed if an Interrupt is attached #47

@swimm3r

Description

@swimm3r

Hello,

Does anyone have problem with attachInterrupt while using hd44780ioClass/hd44780_I2Cexp.h?
The Arduino Uno gets freeze while running the folowing code (it's only a part of it).

#include <Wire.h>
#include <hd44780.h>                 
#include <hd44780ioClass/hd44780_I2Cexp.h>
#include <util/parity.h> //comment out if you don't use an AVR MCU

int interruptPin = 3;
int ledPin = 13;

//hd44780_I2Cexp lcd(0x3f, I2Cexp_BOARD_SUNROM);
hd44780_I2Cexp lcd;

volatile unsigned long lastInt = 0;
volatile unsigned long long currentBuf = 0;
volatile byte bufCounter;

void setup(){
  Serial.begin(115200);
  Wire.begin();
  lcd.begin(16, 2);
  pinMode(ledPin, OUTPUT);
  pinMode(interruptPin, INPUT);
  attachInterrupt(digitalPinToInterrupt(interruptPin), DCF77_ISR, CHANGE);
  lcd.setCursor(0, 0);
  lcd.print("up:");
  lcd.setCursor(0, 1);
  lcd.print("down:");
  lcd.setCursor(0, 0);
}

Thank you. Any suggestion is welcomed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions