The KS_TEA5767 library facilitates easy integration and control of the TEA5767 FM radio module via I2C communication. It includes functions for setting the frequency, retrieving RSSI values, detecting stereo mode, and checking PLL status, offering comprehensive capabilities for managing FM radio functionality in embedded systems.
- Download the library as a ZIP file from the GitHub repository.
- Open the Arduino IDE.
- Go to
Sketch
>Include Library
>Add .ZIP Library...
. - Select the downloaded ZIP file.
Function Name | Input Parameter | Returned Parameter | Description (English) |
---|---|---|---|
getPLL |
None | bool |
Checks if the PLL is locked (true for locked, false for unlocked). |
getRSSI |
None | int |
Returns the Received Signal Strength Indication (RSSI) value. |
getRSSIdBm |
int rssi |
int |
Converts the RSSI value to dBm scale and returns it. |
getStereo |
None | bool |
Checks if the radio is in stereo mode (true for stereo, false for mono). |
getHex |
None | String |
Returns the status bytes received from TEA5767 in hexadecimal format. |
getBin |
None | String |
Returns the status bytes received from TEA5767 in binary format. |
getDec |
None | String |
Returns the status bytes received from TEA5767 in decimal format. |
getASCII |
None | String |
Converts the status bytes received from TEA5767 to ASCII characters. Non-printable characters are replaced with ".". |
setFrequency |
float frequencyMHz |
None | Sets the frequency of the TEA5767 module to the specified value in MHz. |
#include <Wire.h>
#include <KS_TEA5767.h>
KS_TEA5767 radio;
void setup() {
Serial.begin(9600);
radio.begin(); // KS_TEA5767 library initialization
radio.setFrequency(104.5); // Set frequency to 104.5 MHz
}
void loop() {
}