Objectif
Définir une note à jouer sur le buzzer.
Quand l’utiliser
Quand vous voulez jouer quelque chose.
Où l’utiliser
Typiquement en début de fichier, dans une mélodie, ou lors de l’appel de PlayTune.
Main prototype and parameters
Notes are defined using their frequency in Hertz, as you would with a simple int.
Constants
The CRC defines the following constants, which represents the standard musical notes:
NOTE_B0
NOTE_C1
NOTE_CS1
NOTE_D1
NOTE_DS1
NOTE_E1
NOTE_F1
NOTE_FS1
NOTE_G1
NOTE_GS1
NOTE_A1
NOTE_AS1
NOTE_B1
NOTE_C2
…
NOTE_DS8
The first letter (A, B, C, etc.) defines the note, the optional S denotes if the note is sharp and the number defines the octave
Note
Note
is a type that includes a pitch and a duration, used for a tune played by the CrcDuino. Note::END
indicates the end of the tune.
Make sure to add Note::END
at the end of your pattern, else very weird tune will be played.
Use it as such:
// Define a tune. Notice the Note::END at the end. const Note TUNE_METRO[] = { { 500, NOTE_FS4 }, { 500, NOTE_B4 }, { 800, NOTE_FS5 }, Note::END };
Related articles
-
CrcLib Basic Programs (Système CrcDuino System) —
This page presents the most basic programs that should first be tried out by every program when first getting their hands on a CrcDuino.
Minimal program
-
GetBatteryVoltage() (Système CrcDuino System) —
Purpose
Read the potential difference between the 12V and GND green terminals (the board supply voltage).
When to use
-
GetDeltaTimeMicros() (Système CrcDuino System) —
Purpose
Gives you the execution time of your code in microseconds.
When to use
-
GetDeltaTimeMillis() (Système CrcDuino System) —
Purpose
Gives you the execution time of your code in milliseconds.
When to use
-
Initialize() (Système CrcDuino System) —
Purpose
Sets up the board to be able to run the
CrcLib
library properly.When to use
-
PrintControllerState() (Système CrcDuino System) —
Purpose
Print the received state of the controller attached to the CrcConnect.
When to use
-
PrintControllerState() {FR} (Système CrcDuino System) —
Objectif
Afficher l'état de la manette connectée au CRCduino par le biais de la CRCconnect.
Quand l’utiliser
-
Timer (Système CrcDuino System) —
Purpose
Delay a task in time or make it repeat periodically without blocking the CrcDuino.
When to use
-
Timer {FR} (Système CrcDuino System) —
Objectif
Retarder une tâche ou la faire exécuter en boucle sans bloquer le CRCduino.
Quand l’utiliser
-
Update() (Système CrcDuino System) —
Purpose
Updates all
CrcLib
members and routines. This allows the CrcDuino to update its time, LEDs, buzzer, inputs, and any other continuous functionality like communicating with the CrcConnect module.When to use
Add Comment