Library to control Silicon Labs SI570 10 MHZ TO 1.4 GHZ I2C PROGRAMMABLE XO/VCXO.

Dependencies:   mbed

Fork of SI570 by Gerrit Polder

main.cpp

Committer:
DL3LD
Date:
2016-03-27
Revision:
1:1556bcaaf759

File content as of revision 1:1556bcaaf759:

#include "mbed.h"
#include "SI570.h"
#include "QEI.h"
#include "LCD_DISCO_F746NG.h"

LCD_DISCO_F746NG lcd;
SI570 si570(D14, D15, 0xAA);
QEI wheel (A4, A5, NC, 360);

 
int main() {
    int wp,swp=0;
    float startfreq=7.0;
    float freq;
 
    while (1) {
           lcd.Clear(LCD_COLOR_BLUE);
      lcd.SetBackColor(LCD_COLOR_BLUE);
      lcd.SetTextColor(LCD_COLOR_WHITE);
      
        wp =  wheel.getPulses();
        freq=startfreq+wp*0.00001;
        if (swp != wp) {
            si570.set_frequency(freq);
            swp = wp;
        }                
   lcd.DisplayStringAt(0, LINE(5), (uint8_t *)"%f Mhz", CENTER_MODE);
    }
}