1313
1414// You will need the SparkFun Toolkit. Click here to get it: http://librarymanager/All#SparkFun_Toolkit
1515
16- #include < SparkFun_ADS1219 .h> // Click here to get the library: http://librarymanager/All#SparkFun_ADS1219
16+ #include < SparkFun_SiT5358 .h> // Click here to get the library: http://librarymanager/All#SparkFun_SiT5358
1717
18- SfeADS1219ArdI2C myADC ;
18+ SfeSiT5358ArdI2C myTCXO ;
1919
2020void setup ()
2121{
@@ -26,34 +26,33 @@ void setup()
2626 {
2727 delay (100 ); // Wait for the user to open the Serial Monitor
2828 }
29- Serial.println (" SparkFun ADS1219 Example" );
29+ Serial.println (" SparkFun SiT5358 Example" );
3030
3131 Wire.begin (); // Begin the I2C bus
3232
3333 bool begun;
34- begun = myADC.begin (Wire, 0x4F ); // Initialize the ADC - using a custom bus and address - see notes above
35- begun = myADC.begin (0x4F ); // This is also possible. It defaults to Wire
34+ begun = myTCXO.begin (Wire, 0x60 ); // Initialize the SiT5358 - using a custom bus and address
35+ begun = myTCXO.begin (0x60 ); // This is also possible. It defaults to Wire
36+ begun = myTCXO.begin (); // This is also possible. It defaults to Wire and address 0x60
3637
3738 if (!begun)
3839 {
39- Serial.println (" ADC not detected! Please check the address and try again..." );
40+ Serial.println (" SiT5358 not detected! Please check the address and try again..." );
4041 while (1 ); // Do nothing more
4142 }
4243
43- Serial.println (" Reading the differential voltage between AIN0 (+) and AIN1 (-)" );
44+ // Read the frequency control word - should be zero initially
45+ int32_t fcw = myTCXO.getFrequencyControlWord ();
46+ Serial.print (" The frequency control word is: " );
47+ Serial.println (fcw);
48+
49+ // Read the pull range control
50+ uint8_t prc = myTCXO.getPullRangeControl ();
51+ Serial.print (" Pull range control is: " );
52+ Serial.println (myTCXO.getPullRangeControlText (prc));
4453}
4554
4655void loop ()
4756{
48- myADC.startSync (); // Start a single-shot conversion.
49-
50- while (myADC.dataReady () == false ) // Check if the conversion is complete. This will return true if data is ready.
51- {
52- delay (10 ); // The conversion is not complete. Wait a little to avoid pounding the I2C bus.
53- }
54-
55- myADC.readConversion (); // Read the conversion result from the ADC. Store it internally.
56- int32_t sample = myADC.getConversionRaw (); // Get the raw ADC value. Note: this is NOT adjusted for gain.
57- Serial.print (" Raw ADC value: " );
58- Serial.println (sample); // Print the raw ADC value
57+ // Nothing to do here
5958}
0 commit comments