Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Adafruit RDS Stereo FM Transmitter
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Adafruit RDS Stereo FM Transmitter

by POPOV77 on Mon Aug 03, 2020 7:54 am

Trying to print variable values using a Adafruit RDS Stereo FM Transmitter. Seems though that the Adafruit Si4713 library only supports character string printing .
Would someone know more on the topic, attached parts of the Adafruit Si4713 library showing the printing logic.

Code: Select all | TOGGLE FULL SIZE


void Adafruit_Si4713::setRDSstation(char *s) {
  uint8_t i, len = strlen(s);
  uint8_t slots = (len + 3) / 4;

  for (uint8_t i = 0; i < slots; i++) {
    memset(_i2ccommand, ' ', 6); // clear it with ' '
    memcpy(_i2ccommand + 2, s, min(4, (int)strlen(s)));
    s += 4;
    _i2ccommand[6] = 0;
    // Serial.print("Set slot #"); Serial.print(i);
    // char *slot = (char *)( _i2ccommand+2);
    // Serial.print(" to '"); Serial.print(slot); Serial.println("'");
    _i2ccommand[0] = SI4710_CMD_TX_RDS_PS;
    _i2ccommand[1] = i; // slot #
    sendCommand(6);
  }
}

 
void Adafruit_Si4713::setRDSbuffer(char *s) {
  uint8_t i, len = strlen(s);
  uint8_t slots = (len + 3) / 4;
  char slot[5];

  for (uint8_t i = 0; i < slots; i++) {
    memset(_i2ccommand, ' ', 8); // clear it with ' '
    memcpy(_i2ccommand + 4, s, min(4, (int)strlen(s)));
    s += 4;
    _i2ccommand[8] = 0;
    // Serial.print("Set buff #"); Serial.print(i);
    // char *slot = (char *)( _i2ccommand+4);
    // Serial.print(" to '"); Serial.print(slot); Serial.println("'");
    _i2ccommand[0] = SI4710_CMD_TX_RDS_BUFF;
    if (i == 0)
      _i2ccommand[1] = 0x06;
    else
      _i2ccommand[1] = 0x04;

    _i2ccommand[2] = 0x20;
    _i2ccommand[3] = i;
    sendCommand(8);
  }


POPOV77
 
Posts: 2
Joined: Mon Aug 03, 2020 7:45 am

Re: Adafruit RDS Stereo FM Transmitter

by POPOV77 on Fri Aug 14, 2020 1:06 am

nay help is welcome =)

POPOV77
 
Posts: 2
Joined: Mon Aug 03, 2020 7:45 am

Please be positive and constructive with your questions and comments.


cron