6. Exercises with the buzzer

Program the blocks needed to solve the following problems.

  1. The following program emits a 1000Hz tone with a duration of 200ms every second. Modify the program so that it emits a 1500Hz tone with a duration of 400ms every two seconds.

    Programa Ardublock. Buzzer con una frecuencia.
  2. The following program plays a series of fast notes every two seconds in scale 4. Modify the program so that it plays a different series of notes in scale 5.

    Programa Ardublock. Buzzer con varios tonos.
  3. The following program plays the beginning of the happy birthday song. Complete the program with the complete song knowing that the notes are those that appear in the following table. The duration of the notes will be 200, 400 or 800 milliseconds.

    No more than 16 notes can be sent at one time. Each new submission must wait for the previous score to finish playing.

    Programa Ardublock. Partitura en el Buzzer.

    Happy birthday notes:

    C4 C4 K4 C4 F4 E4
    C4 C4 Ke4 C4 G4 F4
    C4 C4 C5 A4 F4 Mi4 Re4
    C5 C5 A4 F4 G4 F4
  4. Repeat the previous exercise with the music of the cockroach:

    Ce4 Do4 Do4 F4 A4
    Ce4 Do4 Do4 F4 A4
    F4 F4 Mi4 Mi4 Ke4 Ke4 Do4
    C4 C4 C4 E4 G4
    C4 C4 C4 E4 G4
    C5 Re5 C5 B4 A4 G4 F4

    The duration of the notes will be 200, 400 or 800 milliseconds.