Skip to content

Commit

Permalink
Examples
Browse files Browse the repository at this point in the history
  • Loading branch information
Ricardo Lima Caratti committed Dec 19, 2019
1 parent b602ef3 commit 3a18cf8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 17 deletions.
4 changes: 2 additions & 2 deletions examples/SI4735_02_POC_SW/SI4735_02_POC_SW.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,11 @@ typedef struct {
} Band;


Band band[] = {{4600,5200,4700,5},
Band band[] = {{4700,5200,4850,5},
{5700,6200,6000,5},
{7000,7500,7200,5},
{9300,10000,9600,5},
{11400,12200,1800,5},
{11400,12200,11940,5},
{13500,13900,13600,5},
{15000,15800,15200,5},
{17400,17900,17600,5},
Expand Down
17 changes: 10 additions & 7 deletions examples/SI4735_03_LCD_20x4_I2C/SI4735_03_LCD_20x4_I2C.ino
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@
#define ENCODER_PIN_B 2

// Buttons controllers
#define AM_FM_BUTTON 5 // Next Band
#define SEEK_BUTTON 6 // Previous Band
#define VOL_UP 7 // Volume Volume Up
#define VOL_DOWN 8 // Volume Down
#define SEEK 9 // Seek Function
#define AM_FM_BUTTON 4 // AM/FM SWITCH
#define SEEK_BUTTON_UP 5 // Next Station
#define SEEK_BUTTON_DOWN 6 // Previous Station
#define VOL_UP 7 // Volume Volume Up
#define VOL_DOWN 8 // Volume Down

#define MIN_ELAPSED_TIME 100

Expand Down Expand Up @@ -59,7 +59,8 @@ void setup()
pinMode(ENCODER_PIN_B, INPUT_PULLUP);

pinMode(AM_FM_BUTTON, INPUT_PULLUP);
pinMode(SEEK_BUTTON, INPUT_PULLUP);
pinMode(SEEK_BUTTON_UP, INPUT_PULLUP);
pinMode(SEEK_BUTTON_DOWN, INPUT_PULLUP);
pinMode(VOL_UP, INPUT_PULLUP);
pinMode(VOL_DOWN, INPUT_PULLUP);

Expand Down Expand Up @@ -206,8 +207,10 @@ void loop()
else
si4735.setFM(8600, 10800, 10390, 10);
}
else if (digitalRead(SEEK_BUTTON) == LOW )
else if (digitalRead(SEEK_BUTTON_UP) == LOW )
si4735.seekStationUp();
else if (digitalRead(SEEK_BUTTON_DOWN) == LOW )
si4735.seekStationDown();
else if (digitalRead(VOL_UP) == LOW )
si4735.volumeUp();
else if (digitalRead(VOL_DOWN) == LOW )
Expand Down
3 changes: 2 additions & 1 deletion examples/SI4735_04_OLED_I2C/SI4735_04_OLED_I2C.ino
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#define ENCODER_PIN_B 2

// Buttons controllers
#define AM_FM_BUTTON 4 // Next Band
#define AM_FM_BUTTON 4 // AM/FM SWITCH
#define SEEK_BUTTON_UP 5 // Seek Up
#define SEEK_BUTTON_DOWN 6 // Seek Down
#define VOL_UP 8 // Volume Volume Up
Expand Down Expand Up @@ -277,6 +277,7 @@ void loop()
}

// Show RSSI status only if this condition has changed
si4735.getCurrentReceivedSignalQuality();
if ( rssi != si4735.getCurrentRSSI() ) {
rssi = si4735.getCurrentRSSI();
showRSSI();
Expand Down
7 changes: 4 additions & 3 deletions examples/SI4735_07_SSB_OLED_TEST/SI4735_07_SSB_OLED_TEST.ino
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,7 @@ void loop()
} else if ( digitalRead(AGC_SWITCH) == LOW) {
disableAgc = !disableAgc;
// siwtch on/off ACG; AGC Index = 0. It means Minimum attenuation (max gain)
si4735.setAutomaticGainControl(disableAgc, 1);
si4735.setAutomaticGainControl(disableAgc, 0);
showStatus();
} else if ( digitalRead(STEP_SWITCH) == LOW) {
if ( bfoOn ) {
Expand All @@ -437,7 +437,7 @@ void loop()
}

// Show the current frequency only if it has changed
if ( ( millis() - elapsedFrequency) > (MIN_ELAPSED_TIME * 3) ) {
if ( ( millis() - elapsedFrequency) > (MIN_ELAPSED_TIME * 4) ) {
currentFrequency = si4735.getFrequency();
if (currentFrequency != previousFrequency)
{
Expand All @@ -448,7 +448,8 @@ void loop()
}

// Show RSSI status only if this condition has changed
if ( ( millis() - elapsedRSSI) > (MIN_ELAPSED_TIME * 4) ) {
if ( ( millis() - elapsedRSSI) > (MIN_ELAPSED_TIME * 6) ) {
si4735.getCurrentReceivedSignalQuality();
if (rssi != si4735.getCurrentRSSI())
{
rssi = si4735.getCurrentRSSI();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ void loop()
}

// Show the current frequency only if it has changed
if ( (millis() - elapsedFrequency) > MIN_ELAPSED_RSSI_TIME * 3) {
if ( (millis() - elapsedFrequency) > MIN_ELAPSED_RSSI_TIME * 4) {
currentFrequency = si4735.getFrequency();
if (currentFrequency != previousFrequency)
{
Expand All @@ -474,7 +474,7 @@ void loop()


// Show RSSI status only if this condition has changed
if ((millis() - elapsedRSSI) > MIN_ELAPSED_RSSI_TIME ) {
if ((millis() - elapsedRSSI) > MIN_ELAPSED_RSSI_TIME * 6 ) {
si4735.getCurrentReceivedSignalQuality();
if (rssi != si4735.getCurrentRSSI())
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -147,10 +147,10 @@ void showStatus()
lcd.print("AM ");
lcd.setCursor(8, 0);
lcd.print(currentFrequency);
lcd.setCursor(17, 0);
lcd.setCursor(16, 0);
lcd.print("KHz");
lcd.setCursor(0, 3);
lcd.print(" ");
lcd.print(" ");
}
}

Expand Down

0 comments on commit 3a18cf8

Please sign in to comment.