element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Pi-Fest
  • Challenges & Projects
  • Design Challenges
  • Pi-Fest
  • More
  • Cancel
Pi-Fest
Blog Blog#4 Implementation-- Pi Fest - Music/Audio Project
  • Blog
  • Forum
  • Documents
  • Polls
  • Files
  • Leaderboard
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: skruglewicz
  • Date Created: 22 Jul 2022 7:14 AM Date Created
  • Views 561 views
  • Likes 7 likes
  • Comments 1 comment
Related
Recommended

Blog#4 Implementation-- Pi Fest - Music/Audio Project

skruglewicz
skruglewicz
22 Jul 2022

imageBlog#4 Implementation-- Pi Fest - Music/Audio Projectimage

 This blog is part of a blog series for the Pi-Fest Design Challenge.

  • This blog will include the details of the implementation of my idea. A Video and photo's are used to show metronome working as designed

Firmware Implementation

This section will describe my implementation of the Firmware that will run on the PICO for my metronome Idea.

FIRMWARE CODE

from picozero import Pot, LED, Buzzer # Pot is short for Potentiometer Add LED
from time import sleep

# OLED
from machine import Pin, I2C
import ssd1306

dial = Pot(0) # Connected to pin A0 (GP26)
led = LED(13) # Make sure this is the correct pin
buzzer = Buzzer(18)

# OLED
# setup the I2C communication
i2c = I2C(0, sda=Pin(16), scl=Pin(17))
display = ssd1306.SSD1306_I2C(128, 64, i2c)

heart_min = 40
heart_max = 180
heart_range = heart_max - heart_min # Calculate the difference
#bpm = 0


while True:
    bpm = heart_min + dial.value * heart_range # Convert dial value to BPM
    print(int(bpm))
    # The following part changes according to what you want to display
    display.text('Beats Per Minute,', 0, 0)
    display.text('----------------', 0, 16)
    display.text(str(int(bpm)),50, 32)
    display.text('----------------', 0, 48)

    display.show()
    
    beat = 60/bpm
    
    brighter_time = beat / 2 # Spend half a beat getting brighter
    dimmer_time = beat / 2 # Spend half a beat getting dimmer
    print(brighter_time)
    print(dimmer_time)
    #led.pulse(brighter_time, dimmer_time, n=1, wait=True)   # Pulse 1 time, waiting until finished
    sleep(brighter_time)
    #display.poweron()
    led.on()
#     buzzer.beep(brighter_time, dimmer_time, n=1, wait=True)
    buzzer.beep(.10, .25, n=1, wait=True)
    #display.text(str(0),50, 32)
    #display.poweroff()
    led.off()
    sleep(dimmer_time)

Hardware Implementation

This section will describe the implementation of the circuit using the Pico and other electronics, to implement my metronome idea.

image   image    image

VIDEO

You don't have permission to edit metadata of this video.
Edit media
x
image
Upload Preview
image

References

This section includes some links that I found helpful.

  • Sign in to reply

Top Comments

  • DAB
    DAB over 3 years ago +1
    Keep the beat going.
Parents
  • DAB
    DAB over 3 years ago

    Keep the beat going.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • DAB
    DAB over 3 years ago

    Keep the beat going.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube