Stap 2:
De code is zeer eenvoudig en sinds zijn compatibel met de TEA5767 er zijn tonnen van schetsen en documenten op het web.
#include < Wire.h >
unsigned char frequencyH = 0;
unsigned char frequencyL = 0;
unsigned int frequencyB;
dubbele frequentie = 0;
VOID Setup
{
Wire.begin();
frequentie = 96,7; beginnend frequentie
setFrequency();
Serial.begin(9600);
}
void loop
{
setFrequency();
Serial.println(Frequency);
}
VOID setFrequency()
{
frequencyB = 4 * (frequentie * 1000000 + 225000) / 32768;
frequencyH = frequencyB >> 8;
frequencyL = frequencyB & 0XFF;
delay(1000);
Wire.beginTransmission(0x60);
Wire.write(frequencyH);
Wire.write(frequencyL);
Wire.write(0xB0);
Wire.write(0x10);
Wire.write((byte)0x00);
Wire.endTransmission();
delay(1000);
}