Skip to content

Instantly share code, notes, and snippets.

View mianqi2016's full-sized avatar

Mian Qi mianqi2016

View GitHub Profile
@mianqi2016
mianqi2016 / pcint_example.c
Created July 27, 2022 08:30 — forked from Wollw/pcint_example.c
ATMega328P PCINT example
#include <avr/io.h>
#include <avr/interrupt.h>
#include <util/atomic.h>
#include <util/delay.h>
#include <stdbool.h>
/*
* A global flag used to communicate between the Interrupt Service Routine
* and the main program. It has to be declared volatile or the compiler
* might optimize it out.