Added tone function
Added tone function. Syntax: radio.tone(x, y, z); x = length in mS y = Amplitude in dB, -30 to 0 z = Frequency in Hertz. (10 to 20000) Note. After this command the audio is set to Unmute.
This commit is contained in:
@@ -221,3 +221,14 @@ bool devTEF_Radio_Get_Identification (uint16_t *device, uint16_t *hw_version, ui
|
||||
*sw_version = Convert8bto16b(buf + 4);
|
||||
return r;
|
||||
}
|
||||
|
||||
bool devTEF_Radio_Set_Wavegen(bool mode, int16_t amplitude, uint16_t freq)
|
||||
{
|
||||
if (mode == true) {
|
||||
devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_Input, 5, 240);
|
||||
return devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_WaveGen, 15, 5, 0, amplitude*10, freq, amplitude*10 , freq);
|
||||
} else {
|
||||
devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_Input, 5, 0);
|
||||
return devTEF_Set_Cmd(TEF_AUDIO, Cmd_Set_WaveGen, 15, 0);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user