I've added sound to projects in the past with the tone() function. I assumed I would be doing the same here, but I guess it leverages a property of the ATMEGA processors that is absent in the ESP32. When I added a tone() command, the compiler wouldn't recognize it as legitimate, and some searching confirmed that this processor wouldn't play nicely.
The first library I found looked promising, but when I opened it, I saw that it was using delays, so my processor would stop everything else to chirp for me. Unacceptable. I looked a little longer, but it wasn't pretty, so I decided to write a new function. I will spare the details, but I couldn't get a tone higher than two hertz. It sounded like a tiny metronome. I have too many processes to dedicate time to squeaking.
I had the idea to use the softwareSerial library to oscillate the piezo pin. Artificial serial ports don't like the ESP32 either, and the examples looked gruesome. Unless I find a new way to create sound, I am going to give up on it.
The rest of the posts for this project have been arranged by date.
First time here?
Completed projects from year 1
Completed projects from year 2
Completed projects from year 3
Completed projects from year 4
Completed projects from year 5
Completed projects from year 6
Completed projects from year 7
Disclaimer for http://24hourengineer.blogspot.com and 24HourEngineer.com
This disclaimer must be intact and whole. This disclaimer must be included if a project is distributed.
All information on this blog, or linked by this blog, is not to be taken as advice or solicitation. Anyone attempting to replicate, in whole or in part, is responsible for the outcome and procedure. Any loss of functionality, money, property, or similar, is the responsibility of those involved in the replication.
All digital communication regarding the email address 24hourengineer@gmail.com becomes the intellectual property of Brian McEvoy. Any information contained within these messages may be distributed or retained at the discretion of Brian McEvoy. Any email sent to this address, or any email account owned by Brian McEvoy, cannot be used to claim property or assets.
Comments to the blog may be utilized or erased at the discretion of the owner. No one posting may claim property or assets based on their post.
This blog, including pictures and text, is copyright to Brian McEvoy.
2021-07-14
The first library I found looked promising, but when I opened it, I saw that it was using delays, so my processor would stop everything else to chirp for me. Unacceptable. I looked a little longer, but it wasn't pretty, so I decided to write a new function. I will spare the details, but I couldn't get a tone higher than two hertz. It sounded like a tiny metronome. I have too many processes to dedicate time to squeaking.
I had the idea to use the softwareSerial library to oscillate the piezo pin. Artificial serial ports don't like the ESP32 either, and the examples looked gruesome. Unless I find a new way to create sound, I am going to give up on it.
The rest of the posts for this project have been arranged by date.
First time here?
Completed projects from year 1
Completed projects from year 2
Completed projects from year 3
Completed projects from year 4
Completed projects from year 5
Completed projects from year 6
Completed projects from year 7
Disclaimer for http://24hourengineer.blogspot.com and 24HourEngineer.com
This disclaimer must be intact and whole. This disclaimer must be included if a project is distributed.
All information on this blog, or linked by this blog, is not to be taken as advice or solicitation. Anyone attempting to replicate, in whole or in part, is responsible for the outcome and procedure. Any loss of functionality, money, property, or similar, is the responsibility of those involved in the replication.
All digital communication regarding the email address 24hourengineer@gmail.com becomes the intellectual property of Brian McEvoy. Any information contained within these messages may be distributed or retained at the discretion of Brian McEvoy. Any email sent to this address, or any email account owned by Brian McEvoy, cannot be used to claim property or assets.
Comments to the blog may be utilized or erased at the discretion of the owner. No one posting may claim property or assets based on their post.
This blog, including pictures and text, is copyright to Brian McEvoy.
2021-07-14
Comments
Post a Comment