3 Replies Latest reply on Aug 16, 2016 3:04 AM by khoinguyen2k

    Problem with e-health v2.0 integrated with Intel Edison

    khoinguyen2k

      I need to read blood pressure from a BPM monitor by using Intel Edison and an e-health sensor shield that i bought on cooking hacks . I have followed this tutor :https://www.cooking-hacks.com/documentation/tutorials/ehealth-biometric-sensor-platform-arduino-raspberry-pi-medical  . But after uploading the code into Intel Edison by Arduino IDE it appeared the following errors:

      Arduino: 1.6.10 (Windows 7), Board: "Intel® Edison"

       

       

      In file included from C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp:41:0:

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h: In function 'void i2cInit()':

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:102:6: error: 'TWCR' was not declared in this scope

       

       

        sbi(TWCR, TWEN); // Enable TWI

       

       

            ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:53:28: note: in definition of macro 'sbi'

       

       

      #define sbi(var, mask)   ((var) |= (uint8_t)(1 << mask))

       

       

                                  ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:102:12: error: 'TWEN' was not declared in this scope

       

       

        sbi(TWCR, TWEN); // Enable TWI

       

       

                  ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:53:51: note: in definition of macro 'sbi'

       

       

      #define sbi(var, mask)   ((var) |= (uint8_t)(1 << mask))

       

       

                                                         ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h: In function 'void i2cSetBitrate(short unsigned int)':

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:110:6: error: 'TWSR' was not declared in this scope

       

       

        cbi(TWSR, TWPS0);

       

       

            ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:54:28: note: in definition of macro 'cbi'

       

       

      #define cbi(var, mask)   ((var) &= (uint8_t)~(1 << mask))

       

       

                                  ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:110:12: error: 'TWPS0' was not declared in this scope

       

       

        cbi(TWSR, TWPS0);

       

       

                  ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:54:52: note: in definition of macro 'cbi'

       

       

      #define cbi(var, mask)   ((var) &= (uint8_t)~(1 << mask))

       

       

                                                          ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:111:12: error: 'TWPS1' was not declared in this scope

       

       

        cbi(TWSR, TWPS1);

       

       

                  ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:54:52: note: in definition of macro 'cbi'

       

       

      #define cbi(var, mask)   ((var) &= (uint8_t)~(1 << mask))

       

       

                                                          ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:114:18: error: 'F_CPU' was not declared in this scope

       

       

        bitrate_div = ((F_CPU/4000l)/bitrateKHz);

       

       

                        ^

      In file included from C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:6:0,

       

       

                       from C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp:41:

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:117:7: error: 'TWBR' was not declared in this scope

       

       

        outb(TWBR, bitrate_div);

       

       

             ^

      C:\Program Files\Arduino\libraries\eHealth\utils/defs.h:31:27: note: in definition of macro 'outb'

       

       

        #define outb(addr, data) addr = (data)

       

       

                                 ^

      In file included from C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp:41:0:

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h: In function 'void i2cSendStart()':

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:56:21: error: 'DDRC' was not declared in this scope

       

       

      #define WRITE_sda() DDRC = DDRC | 0b00010000 //SDA must be output when writing

       

       

                           ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:122:2: note: in expansion of macro 'WRITE_sda'

       

       

        WRITE_sda();

       

       

        ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:124:2: error: 'TWCR' was not declared in this scope

       

       

        TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN);

       

       

        ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:124:13: error: 'TWINT' was not declared in this scope

       

       

        TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN);

       

       

                   ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:124:24: error: 'TWSTA' was not declared in this scope

       

       

        TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN);

       

       

                              ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:124:35: error: 'TWEN' was not declared in this scope

       

       

        TWCR = (1<<TWINT)|(1<<TWSTA)|(1<<TWEN);

       

       

                                         ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h: In function 'void i2cSendStop()':

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:130:9: error: 'TWCR' was not declared in this scope

       

       

               TWCR = (1<<TWINT)|(1<<TWEN)|(1<<TWSTO);

       

       

               ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:130:20: error: 'TWINT' was not declared in this scope

       

       

               TWCR = (1<<TWINT)|(1<<TWEN)|(1<<TWSTO);

       

       

                          ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:130:31: error: 'TWEN' was not declared in this scope

       

       

               TWCR = (1<<TWINT)|(1<<TWEN)|(1<<TWSTO);

       

       

                                     ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:130:41: error: 'TWSTO' was not declared in this scope

       

       

               TWCR = (1<<TWINT)|(1<<TWEN)|(1<<TWSTO);

       

       

                                               ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h: In function 'void i2cWaitForComplete()':

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:138:15: error: 'TWCR' was not declared in this scope

       

       

           while ((!(TWCR & (1<<TWINT))) && (i < 90))

       

       

                     ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:138:26: error: 'TWINT' was not declared in this scope

       

       

           while ((!(TWCR & (1<<TWINT))) && (i < 90))

       

       

                                ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h: In function 'void i2cSendByte(unsigned char)':

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:56:21: error: 'DDRC' was not declared in this scope

       

       

      #define WRITE_sda() DDRC = DDRC | 0b00010000 //SDA must be output when writing

       

       

                           ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:146:2: note: in expansion of macro 'WRITE_sda'

       

       

        WRITE_sda();

       

       

        ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:148:2: error: 'TWDR' was not declared in this scope

       

       

        TWDR = data;

       

       

        ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:150:2: error: 'TWCR' was not declared in this scope

       

       

        TWCR = (1<<TWINT)|(1<<TWEN);

       

       

        ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:150:13: error: 'TWINT' was not declared in this scope

       

       

        TWCR = (1<<TWINT)|(1<<TWEN);

       

       

                   ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:150:24: error: 'TWEN' was not declared in this scope

       

       

        TWCR = (1<<TWINT)|(1<<TWEN);

       

       

                              ^

      In file included from C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:6:0,

       

       

                       from C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp:41:

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h: In function 'void i2cReceiveByte(unsigned char)':

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:159:8: error: 'TWCR' was not declared in this scope

       

       

         outb(TWCR, (inb(TWCR)&TWCR_CMD_MASK)|BV(TWINT)|BV(TWEA));

       

       

              ^

      C:\Program Files\Arduino\libraries\eHealth\utils/defs.h:31:27: note: in definition of macro 'outb'

       

       

        #define outb(addr, data) addr = (data)

       

       

                                 ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:159:43: error: 'TWINT' was not declared in this scope

       

       

         outb(TWCR, (inb(TWCR)&TWCR_CMD_MASK)|BV(TWINT)|BV(TWEA));

       

       

                                                 ^

      C:\Program Files\Arduino\libraries\eHealth\utils/defs.h:31:35: note: in definition of macro 'outb'

       

       

        #define outb(addr, data) addr = (data)

       

       

                                         ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:159:40: note: in expansion of macro 'BV'

       

       

         outb(TWCR, (inb(TWCR)&TWCR_CMD_MASK)|BV(TWINT)|BV(TWEA));

       

       

                                              ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:159:53: error: 'TWEA' was not declared in this scope

       

       

         outb(TWCR, (inb(TWCR)&TWCR_CMD_MASK)|BV(TWINT)|BV(TWEA));

       

       

                                                           ^

      C:\Program Files\Arduino\libraries\eHealth\utils/defs.h:31:35: note: in definition of macro 'outb'

       

       

        #define outb(addr, data) addr = (data)

       

       

                                         ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:159:50: note: in expansion of macro 'BV'

       

       

         outb(TWCR, (inb(TWCR)&TWCR_CMD_MASK)|BV(TWINT)|BV(TWEA));

       

       

                                                        ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:164:8: error: 'TWCR' was not declared in this scope

       

       

         outb(TWCR, (inb(TWCR)&TWCR_CMD_MASK)|BV(TWINT));

       

       

              ^

      C:\Program Files\Arduino\libraries\eHealth\utils/defs.h:31:27: note: in definition of macro 'outb'

       

       

        #define outb(addr, data) addr = (data)

       

       

                                 ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:164:43: error: 'TWINT' was not declared in this scope

       

       

         outb(TWCR, (inb(TWCR)&TWCR_CMD_MASK)|BV(TWINT));

       

       

                                                 ^

      C:\Program Files\Arduino\libraries\eHealth\utils/defs.h:31:35: note: in definition of macro 'outb'

       

       

        #define outb(addr, data) addr = (data)

       

       

                                         ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:164:40: note: in expansion of macro 'BV'

       

       

         outb(TWCR, (inb(TWCR)&TWCR_CMD_MASK)|BV(TWINT));

       

       

                                              ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h: In function 'unsigned char i2cGetReceivedByte()':

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:171:14: error: 'TWDR' was not declared in this scope

       

       

        return( inb(TWDR) );

       

       

                    ^

      C:\Program Files\Arduino\libraries\eHealth\utils/defs.h:34:23: note: in definition of macro 'inb'

       

       

        #define inb(addr)   (addr)

       

       

                             ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h: In function 'unsigned char i2cGetStatus()':

       

       

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:177:14: error: 'TWSR' was not declared in this scope

       

       

        return( inb(TWSR) );

       

       

                    ^

      C:\Program Files\Arduino\libraries\eHealth\utils/defs.h:34:23: note: in definition of macro 'inb'

       

       

        #define inb(addr)   (addr)

       

       

                             ^

      In file included from C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp:41:0:

       

       

      C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp: In member function 'void eHealthClass::readRegisters(byte, int, byte*)':

       

       

      C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp:812:7: error: 'TWCR' was not declared in this scope

       

       

         cbi(TWCR, TWEN);// Disable TWI

       

       

             ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:54:28: note: in definition of macro 'cbi'

       

       

      #define cbi(var, mask)   ((var) &= (uint8_t)~(1 << mask))

       

       

                                  ^

      C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp:812:13: error: 'TWEN' was not declared in this scope

       

       

         cbi(TWCR, TWEN);// Disable TWI

       

       

                   ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:54:52: note: in definition of macro 'cbi'

       

       

      #define cbi(var, mask)   ((var) &= (uint8_t)~(1 << mask))

       

       

                                                          ^

      C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp: In member function 'byte eHealthClass::readRegister(uint8_t)':

       

      C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp:844:7: error: 'TWCR' was not declared in this scope

       

      cbi(TWCR, TWEN); // Disable TWI

       

       

             ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:54:28: note: in definition of macro 'cbi'

       

       

      #define cbi(var, mask)   ((var) &= (uint8_t)~(1 << mask))

       

       

                                  ^

      C:\Program Files\Arduino\libraries\eHealth\eHealth.cpp:844:13: error: 'TWEN' was not declared in this scope

      cbi(TWCR, TWEN); // Disable TWI

       

       

                   ^

      C:\Program Files\Arduino\libraries\eHealth\utils/i2c.h:54:52: note: in definition of macro 'cbi'

      #define cbi(var, mask)   ((var) &= (uint8_t)~(1 << mask))

       

      exit status 1

      Error compiling for board Intel® Edison.

       

      Thank you and regard

      Khoi