Little Robot Friends
Arduino Library Reference  version 1.1
LRFSound Union Reference

Detailed Description

Sound data structures are wrapped in this union datatype to allow for easy access to the raw data contained therein. Sounds can be created using the same method as creating a LRFSoundStruct. For example:

LRFSound mySound = { LRFNote_C, LRFOctave_4, LRFIntonation_Rising, LRFDuration_Medium, LRFDuration_None };

Is the same as...

LRFSoundStruct mySound = { LRFNote_C, LRFOctave_4, LRFIntonation_Rising, LRFDuration_Medium, LRFDuration_None };

However, with our union type we can also access the raw integer value of that sound.

Serial.print(mySound.raw,BIN);              // prints the integer value in binary format
mySound.raw = pgm_read_word(&mySavedSound); // loads sound data from program memory

For more information on how sounds work, check out the documentation for LRFSoundStruct.

Definition at line 307 of file LRFUtils.h.

#include <LRFUtils.h>


The documentation for this union was generated from the following file: