Skip to content

Metronome with speaker and remote vibration module.

Notifications You must be signed in to change notification settings

wysockipiotr/avr-metronome

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AVR Metronome

Metronome with speaker and remote vibration module

Modules

Built with

  • ATmega 168A-PU
  • Qduino Mini
  • MCP4161
  • TPA2005D1
  • HM-10 BLE

Features

  • Sound mode with volume control
  • Rotary encoder (with push button) user interface
  • BPM and basic signatures control
  • Tap tempo (button)
  • PWM LCD backlight (dimming after a period of inactivity)
  • Storing metronome settings in the internal EEPROM
  • Custom character display
  • Remote vibration module (BLE)
  • Default idle state for remote module, receiving disable signal
  • MicroUSB charging
  • Adjustable sound pitch

Project structure

+-- 
   +-- README.md
   +-- .gitignore
   +-- doc
      +-- eagle
         +-- main
         +-- remote
   +-- metronome          // ATmega metronome main module directory
      +-- Makefile        // compiler and programmer config
      +-- main.c          // entry point
      +-- setup.h         // device main settings
      +-- util.h          // helper macros
      +-- global.h        // extern declarations
      +-- lcd.h           // LCD 2x16 interfacing in 4-bit mode
      +-- lcd.c
      +-- eeprom.h
      +-- eeprom.c
      +-- metronome.h     // core logic of the metronome, ISR handlers
      +-- metronome.c
      +-- usart.h         // serial communication with HM-10 BLE module
      +-- usart.c
      +-- mcp41xx.h       // MCP4161 Digital potentiometer SPI interfacing
      +-- mcp41xx.c
   +-- remote_module      // Qduino (Arduino) remote vibrating module sketch directory
      +-- README.md
      +-- remote_module.ino

Setup

Prerequisites
  • make
  • avrdude
  • avr-gcc
Makefile

Override parameters in Makefile to suit your hardware configuration. Here, Arduino Uno is used as an in-system programmer.

- MCU = atmega168
+ MCU = <your_unit>

- PROGRAMMER_TYPE = avrisp
- PROGRAMMER_ARGS = -b 19200 -P COM4
+ PROGRAMMER_TYPE = <your_programmer_type>
+ PROGRAMMER_ARGS = -b <baud_rate> -P <device_name>
Deployment

Use make flash to compile and save program in flash memory (using avrdude). Use make size to find out about the size of the program.