buzzer player

This forum is about you. Feel free to discuss anything is related to embedded and electronics, your awesome projects, your ideas, your announcements, not necessarily related to ChibiOS but to embedded in general.
sdalu
Posts: 34
Joined: Wed Dec 30, 2015 5:31 pm
Has thanked: 1 time
Been thanked: 1 time

buzzer player

Postby sdalu » Fri Aug 05, 2016 9:50 pm

I've written a small code to allow basic control of a buzzer and to play "melody" (using a compact format)

I'm putting the link here, if it can be useful to someone else.

https://github.com/sdalu/kakapo

acr
Posts: 14
Joined: Tue Nov 18, 2014 3:52 am

Re: buzzer player

Postby acr » Tue Aug 09, 2016 6:33 am

volume is missing in BuzzerConfig

acr
Posts: 14
Joined: Tue Nov 18, 2014 3:52 am

Re: buzzer player

Postby acr » Tue Aug 09, 2016 6:42 am

i get from ruby

kakapo.rb:184: syntax error, unexpected '.'
... return if delta_error&.< edlt # Ensure ac...
... ^
kakapo.rb:185: syntax error, unexpected '.'
return if pct_error&.< epct # Ensure ...
^
kakapo.rb:184: syntax error, unexpected '.'
... return if delta_error&.< edlt # Ensure ac...
... ^
kakapo.rb:185: syntax error, unexpected '.'
return if pct_error&.< epct # Ensure ...
^
kakapo.rb:184: syntax error, unexpected '.'
... return if delta_error&.< edlt # Ensure ac...
... ^
kakapo.rb:185: syntax error, unexpected '.'
return if pct_error&.< epct # Ensure ...
^
kakapo.rb:184: syntax error, unexpected '.'
... return if delta_error&.< edlt # Ensure ac...
... ^
kakapo.rb:185: syntax error, unexpected '.'
return if pct_error&.< epct # Ensure ...
^

i really hate ruby

sdalu
Posts: 34
Joined: Wed Dec 30, 2015 5:31 pm
Has thanked: 1 time
Been thanked: 1 time

Re: buzzer player

Postby sdalu » Tue Aug 09, 2016 10:04 pm

Hi.

You need to use ruby 2.3, due to the &. syntax and some of the Enumerable methods

Volume is currently not handled by the driver as it is not possible to control it by using only the pwm driver.
It would requires additional circuitry to control it using the voltage. If you can provide me with the schematic, I could add the code.
If I'm wrong let me now, as electronic is not my strength.

Sincerly

rmozel
Posts: 1
Joined: Fri Feb 17, 2017 11:43 am

Re: buzzer player

Postby rmozel » Fri Feb 17, 2017 11:52 am

Dear sdalu,

I have some difficulties to make your kakapo library to work with my STM32F401 Nucleo based board. It successfully executes buzzer_init() but gets stuck at buzzer_melody, _ring, or _beep. If you kindly provide your main.c together with appropriate configuration files, e.g., halconf, mcuconf, and board.h), I will be appreciated.

Regards,
Renan


Return to “User Projects”

Who is online

Users browsing this forum: No registered users and 2 guests