Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Revision 0:4cd724eebb78, committed 2022-04-25
- Comitter:
- fernandosakabe
- Date:
- Mon Apr 25 22:25:13 2022 +0000
- Commit message:
- j
Changed in this revision
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/buzzer.lib Mon Apr 25 22:25:13 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/Reniboy/code/buzzer/#622b1d533a1c
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Mon Apr 25 22:25:13 2022 +0000 @@ -0,0 +1,46 @@ +#include "mbed.h" +#include "buzzer.h" + +DigitalOut Fase_A(D4); +DigitalOut Fase_B(D5); +DigitalOut Fase_C(D6); +DigitalOut Fase_D(D7); +Beep Buzzer(D11); +DigitalIn button(USER_BUTTON); + +int main() +{ + float tempo = 0.05; + int i = 0; + float time = 1.00; + float nota_do = 264.00; + int numero_fases = 4; + int datasheet_numero_passos = 200; + int numero_revolucoes = 2; + int revolucao = datasheet_numero_passos/numero_fases; + Fase_A = 0; + Fase_B = 0; + Fase_C = 0; + Fase_D = 0; + while(1) { + if(button == 0) { + while(i < numero_revolucoes * revolucao) { + Fase_A = 1; + wait(tempo); + Fase_A=0; + Fase_B=1; + wait(tempo); + Fase_B=0; + Fase_C=1; + wait(tempo); + Fase_C=0; + Fase_D=1; + wait(tempo); + Fase_D=0; + i++; + } + i = 0; + Buzzer.beep(nota_do, time); + } + } +} \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Mon Apr 25 22:25:13 2022 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400 \ No newline at end of file