element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • 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 & Tria Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • About Us
  • 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
      • Japan
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Vietnam
      • 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# 3 Testing -- 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:06 AM Date Created
  • Views 554 views
  • Likes 6 likes
  • Comments 1 comment
Related
Recommended

Blog# 3 Testing -- Pi Fest - Music/Audio Project

skruglewicz
skruglewicz
22 Jul 2022

imageBlog#3 Testing- Music/Audio Projectimage

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

 This blog will describe the unit testing I performed on the 4 electronic components that I attached to the PICO. The Wiring diagram and the code for each of the 4 components that I will attach to the PICOis depicted in this blog. I then used the code to implement my design code.

UNIT Testing

  • PICO to Display

    • This test will display 100 on the SSD1306 OLED screen along with a title.
  • Wiring

    • image
  • CODE

    • from machine import Pin, I2C
      import ssd1306
      
      # setup the I2C communication
      i2c = I2C(0, sda=Pin(16), scl=Pin(17))
      display = ssd1306.SSD1306_I2C(128, 64, i2c)
      
      bpm = 100
      
      # 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(bpm),50, 32)
      display.text('----------------', 0, 48)
      
      
      # The following line sends what to show to the display
      display.show()
      
  • PICO To Buzzer

    • This test will turn the Grove buzzer on and off. 
  • Wiring

    • image
  • CODE

    • # Active Buzzer that plays a note when powered
      from time import sleep
      from picozero import Buzzer
      
      buzzer = Buzzer(18)
      
      buzzer.on()
      sleep(1)
      buzzer.off()
      sleep(1)
      
      buzzer.beep()
      sleep(4)
      buzzer.off()
  • PICO to LED

    • This test will blink the Grove LED every half second. 
  • Wiring

    • image
  • CODE

    • from machine import Pin
      from time import sleep
      
      led = Pin(13, Pin.OUT)
      
      while True:
          led.toggle()
          sleep(0.5)
  • PICO to Potentiometer

    • This test will print the Potentiometer value on the PC serial port.
  • Wiring

    • image
  • CODE

    • from picozero import Pot # Pot is short for Potentiometer
      from time import sleep
      
      dial = Pot(0) # Connected to pin A0 (GP26)
      
      while True:
          print(dial.value)
          sleep(0.1) # Slow down the output

References

This section includes some links that I found helpful.

picozero API — picozero 0.2.0 documentation

  • Sign in to reply

Top Comments

  • DAB
    DAB over 3 years ago +1
    Nice overview of the parts.
  • DAB
    DAB over 3 years ago

    Nice overview of the parts.

    • Cancel
    • Vote Up +1 Vote Down
    • Sign in to reply
    • More
    • Cancel
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 © 2026 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