Код поправлен для правильной работы с Rst pin модуля, добавлен правильный antcap

This commit is contained in:
VladislavOstapov 2023-04-23 17:40:24 +03:00
parent 0b89d84626
commit bfe2dd30bf
2 changed files with 17 additions and 19 deletions

View File

@ -47,14 +47,14 @@ Adafruit_Si4713::Adafruit_Si4713(int8_t resetpin) { _rst = resetpin; }
*
*/
bool Adafruit_Si4713::begin(uint8_t addr, TwoWire *theWire) {
if (i2c_dev)
reset();
delete i2c_dev;
i2c_dev = new Adafruit_I2CDevice(addr, theWire);
if (!i2c_dev->begin())
return false;
reset();
powerUp();
// check for Si4713
@ -72,9 +72,9 @@ void Adafruit_Si4713::reset() {
if (_rst > 0) {
pinMode(_rst, OUTPUT);
digitalWrite(_rst, HIGH);
delay(10);
delay(100);
digitalWrite(_rst, LOW);
delay(10);
delay(100);
digitalWrite(_rst, HIGH);
}
}

View File

@ -41,6 +41,8 @@ void do_i2c_scan() {
if (!radio->begin()) { // begin with address 0x63 (CS high default)
Serial.println("Couldn't find radio?");
Serial.println("Run I2C scanner...");
do_i2c_scan();
while (1);
}
@ -55,19 +57,15 @@ void do_i2c_scan() {
*/
Serial.print("\nSet TX power");
radio->setTXpower(114); // dBuV, 88-115 max
radio->setTXpower(115, 55); // dBuV, 88-115 max, cap надо задать 0 и посмотреть сколько будет
Serial.print("\nTuning into freq");
radio->tuneFM(10740); // 100.0 mhz
// This will tell you the status in case you want to read it from the chip
radio->readTuneStatus();
Serial.print("\tCurr freq: ");
Serial.println(radio->currFreq);
Serial.print("\tCurr freqdBuV:");
Serial.println(radio->currdBuV);
Serial.print("\tCurr ANTcap:");
Serial.println(radio->currAntCap);
Serial.printf("Curr tuned: freq=%d, freqdBuV=%d, ANTcap=%d\n",
radio->currFreq, radio->currdBuV, radio->currAntCap);
// begin the RDS/RDBS transmission
radio->beginRDS();