volatile int encoderCount = 0; int encorderCount = 0; uint8_t seekDirection = 1; // 0 = Down; 1 = Up. This value is set by the last encoder
direction. long elapsedTimeEncoder = millis();
// Encoder control Rotary encoder = Rotary(ENCODER_PIN_A, ENCODER_PIN_B);
unsigned char frequencyH=0; unsigned char frequencyL=0; unsigned int frequencyB; double frequency=0; double freq_available=0;
//receivef int b=0; int c=0; int d=0; int e=0; int f=0;
oled.setCursor(0,40); oled.println("By
PU2CLR "); oled.setCursor(0,90); oled.println("Modefy By"); oled.setCursor(0,140);
oled.println(" JL7GMN"); delay(3000); oled.clear(); /* Reads encoder via interrupt
Use Rotary.h and Rotary.cpp implementation to process encoder via interrupt */ // Encoder interrupt
attachInterrupt(digitalPinToInterrupt(ENCODER_PIN_A), rotaryEncoder, CHANGE); attachInterrupt(digitalPinToInterrupt(ENCODER_PIN_B), rotaryEncoder,
CHANGE);
// frequency initialize ------------------------------------------------- frequency=51.00; //starting frequency ABALABLE MIN
45.60MHz TO MAX 119.60MHz frequencyB=4*(frequency*1000000+225000)/32768; //calculating PLL word frequencyH=frequencyB>>8;
frequencyL=frequencyB&0XFF; delay(100); //tune set to 0 Wire.beginTransmission(0X10); //continuous write
//no need to specify register Wire.write(0X00); // 02h(HighByte02) DMUTE0 Wire.write(0X00); // 02l(LowByte02)
Wire.write(0X00); // 03h Wire.write(0X00); // 03l TUNE0 ENABLE0 Wire.endTransmission();
} else if (digitalRead(SEEK_STATION) == LOW) //D14 { ; // rx.seek(RDA_SEEK_WRAP, seekDirection, showStatus); //
showFrequency will be called by the seek function during the process.