MUFF WIGGLER Forum Index
 FAQ & Terms of UseFAQ & Terms Of Use   Wiggler RadioMW Radio   Muff Wiggler TwitterTwitter   Support the site @ PatreonPatreon 
 SearchSearch   RegisterSign up   Log inLog in 
WIGGLING 'LITE' IN GUEST MODE

BPM display?
MUFF WIGGLER Forum Index -> Music Tech DIY  
Author BPM display?
ejr27233
I want to add a BPM display to my master clock with a 7 segment display and Arduino but I can't find anything other then measuring heart rate and DJ flashing lights. Does any know of such a project?
guest
this little guy come preloaded with an arduino bootloader, and can be reprogrammed if you have an FTDI cable. there are a bunch of midi projects out there, so it shouldnt be too bad to crib some code from them. youll only be looking for one midi code, which makes it easier.

https://www.sparkfun.com/products/11442
zerogroupsystems
I have some code to measure BPM using the Timer1 library; connect clock to pin 2. You can replace the print statement with something that outputs to a display.

EDIT: in-lining the code because I can't get the attachment to work

#include <TimerOne.h>

volatile unsigned long tick_count = 0;
volatile unsigned long last_tick = 0;
volatile unsigned int bpm = 0;

void timerIncr() {
tick_count++;
}

void clockTick() {
bpm = 6000000L / (tick_count - last_tick);
last_tick = tick_count;
}


void setup() {
Serial.begin(57600);
Timer1.initialize(10);
Timer1.attachInterrupt(timerIncr);
attachInterrupt(digitalPinToInterrupt(2), clockTick, RISING);
}

void loop() {
unsigned long last = 0;
while (true) {
if (last != bpm) {
last = bpm;
Serial.println(bpm);
}
}
}
yoho
You _could_ look into te TriggerHappy module. It has a BPM display and you could strip down the code to do just that. https://github.com/emast42/triggerhappy
MUFF WIGGLER Forum Index -> Music Tech DIY  
Page 1 of 1
Powered by phpBB © phpBB Group