Community
cancel
Showing results for 
Search instead for 
Did you mean: 
KKhoi
Beginner
1,529 Views

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

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-rasp... https://www.cooking-hacks.com/documentation/tutorials/ehealth-biometric-sensor-platform-arduino-rasp... . 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&#...

0 Kudos
3 Replies
idata
Community Manager
63 Views

Hi,

 

 

This issue seems to be related to the libraries used in the code. The libraries used in this code are compiled for different devices. I'm going to run this code and run some tests.

 

 

You can also look at this thread /message/381028# 381028 https://communities.intel.com/message/381028# 381028 , which discusses using an e-health sensor as well.

 

 

-Sergio

 

idata
Community Manager
63 Views

I followed the steps and as expected the IDE threw an error. This is because the libraries used by the e-health are for Raspberry Pi and Arduino, devices with a different architecture to the Edison.

 

 

I recommend you to try to write your own version of the library, based on the Arduino library code, so you can use it with the Edison.

 

 

-Sergio

 

KKhoi
Beginner
63 Views

Thanks you for your answer,I have download the library for Intel Galileo and fixed the problem

Reply