Kazuaki Hongu / ADS1100
Revision:
3:7c8d1aa80a9d
Parent:
2:7ee26d7e2997
--- a/ADS1100.h	Wed Jun 20 07:05:53 2018 +0000
+++ b/ADS1100.h	Mon Jul 02 13:25:18 2018 +0000
@@ -10,21 +10,21 @@
 #ifndef ADS1100_H_
 #define ADS1100_H_
 
-#define ADS1100_ADDR    0b1001
+#define ADS1100_ADDR    0b10010000
 
 typedef union {
     char UC;   
     struct {
-        unsigned char ST:1; //0
-        unsigned char RE:2; //must be 00
+        unsigned char PGA:2; //GAIN: 00=1, 01=2, 10=4, 11=8
+        unsigned char DR:2; //00=128SPS, 01=32SPS, 10=16SPS, 11=8SPS
         unsigned char SC:1; //0=continuous, 1=single
-        unsigned char DR:2; //00=128SPS, 01=32SPS, 10=16SPS, 11=8SPS
-        unsigned char PGA:2; //GAIN: 00=1, 01=2, 10=4, 11=8
+        unsigned char RE:2; //must be 00
+        unsigned char ST:1; //0
     } bit;
 } CONFIG;
 
 typedef union {
-    uint16_t S;
+    short S;
     struct {
         char UB; //upper Byte (8bit)
         char LB; //lpper Byte (8bit)
@@ -36,7 +36,9 @@
         ADS1100 (PinName sda, PinName scl, char addr);
         ADS1100 (I2C& p_i2c, char addr);
         void init(char addr);
-        uint16_t get();
+        void init();
+        short get();
+//        char get();
     
     protected:
         I2C _i2c;