Comments (4)
for what it's worth, I added an implementation here : https://github.com/stefaandesmet2003/sduino
It's using TIM2 (similar to AVR), but STM8 TIM2 is 16-bit.
STM8S003 has TIM2 peripheral, so it should work too.
from sduino.
It has a tone generator, the "BEEPER" periperheral. That thing however only has 3 possible output frequencies: 1, 2 or 4 kHz (refer datasheet / user manual and e.g. here). So it can't support arbitrary audible frequencies from like 0-44kHz with that.
But ofc it should be possible with a timer / PWM output. I've outlined some initial ideas some time ago there.
However a simple high-low write and a microsecond delay works on my STM8S103F3 (and pretty much every other). I've slightly adapted a sketch for a tetris theme and it plays nicely on a buzzer, with simulated 2-tone polyphony, with the play_one_note
function as basis.
from sduino.
very cool! you can open a pull request
from sduino.
from sduino.
Related Issues (20)
- TM1637 support HOT 9
- Disable I2C ports PB4 PB5 HOT 1
- ERROR: Timer and interrupt on STM8 using SPL HOT 9
- unable to install in arduino 2 beta HOT 1
- Cannot upload STM8S-discovery board using its ST-link
- Any chance for STM7? HOT 7
- PA1 on the STM8S105x4/6 cannot be an interrupt
- IRQ example not quite right
- Not enough memory when compiling the oled-mini example HOT 1
- STM8S103 with arduino IDE has error HOT 3
- Space in username causes compile error.
- Software Reset not implemented
- Generic selection functional after SDCC 13402
- Is there possible software serial support?
- Compilation error when including .c file from the same directory
- Lack of example of using I2C. Event interrupts not implemented? HOT 5
- 'Upload using programmer' fails with "Error while uploading: missing 'program.params.verbose' configuration parameter" HOT 3
- Arduino IDE 2.0.3 gives "Error: 13 INTERNAL: Cannot install platform: installing platform" HOT 1
- Sleep and interrupt in Sduino HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sduino.