read from 0x77 i2c address | Arduino Compatible Compiler for LabVIEW Discussions | Forum

Avatar

Please consider registering
guest

sp_LogInOut Log In sp_Registration Register

Register | Lost password?
Advanced Search

— Forum Scope —




— Match —





— Forum Options —





Minimum search word length is 4 characters - maximum search word length is 84 characters

sp_Feed Topic RSS sp_TopicIcon
read from 0x77 i2c address
May 30, 2016
10:35 pm
Avatar
miche91
Member
Forum Posts: 33
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

hi,

I need to read barometric pressure from BMP180 sensor on 0x77 i2c address

I've tried to open_i2c.vi , read_i2c.vi and on serial I receive always value "255", as address pin I put "77"

it is correct? what can I do?

 

thanks

May 31, 2016
4:33 am
Avatar
Steffan
Admin
Forum Posts: 305
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Yes, 0x77 is the correct address.  The VIs you referenced dont sounds like the correct ones for the Arduino Compatible Compiler for LabVIEW.  Please post your VIs if you want further support.

May 31, 2016
11:03 am
Avatar
miche91
Member
Forum Posts: 33
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

thank you very much

I've attached my VI

sorry but it is my first i2c VI

thanks again ,

Michele

May 31, 2016
7:07 pm
Avatar
Steffan
Admin
Forum Posts: 305
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

You are missing quite a bit of code.  You need to send the register address you are trying to read first before reading the data.  I attached an example VI we had for a BMP180 demo you can use as a starting point. 

June 3, 2016
6:59 pm
Avatar
miche91
Member
Forum Posts: 33
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

Steffan said
You are missing quite a bit of code.  You need to send the register address you are trying to read first before reading the data.  I attached an example VI we had for a BMP180 demo you can use as a starting point. 

thank you very much.

I've studied your very helpful VIs and I think I understood.

Now BMP180 works fine.

But now i have an other problem, from yesterday when I try to compile a VI with RTC i receive this error and I don't know why

C:\Users\Michele\AppData\Local\Temp\58e9973bb6e2e908c6c199f5a9d39075.tmp\temp\temp.ino: In function 'void Read_RTC_Time_and_Format(String*, boolean, unsigned char, boolean, unsigned char)':

temp:102: error: '_Wire' was not declared in this scope

             _Wire[Interface_253]->beginTransmission(Slave_Address_225);

             ^

temp:120: error: '_Wire' was not declared in this scope

         _Wire[Interface_253]->requestFrom(Slave_Address_225, Const1583, (uint8_t)NULL);

         ^

exit status 1
'_Wire' was not declared in this scope

 

thanks

Michele

June 4, 2016
6:51 am
Avatar
Steffan
Admin
Forum Posts: 305
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Sounds like you are not calling I2C open somewhere. If that's not the issue please post your VI. 

June 5, 2016
7:03 pm
Avatar
miche91
Member
Forum Posts: 33
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

yes!!

thanks you Steffan!

July 3, 2016
10:11 am
Avatar
miche91
Member
Forum Posts: 33
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

hi,

your example show how to read and compensate obly the temperature, right?

what about pressure?

 

thanks

Michele

July 4, 2016
4:29 am
Avatar
Steffan
Admin
Forum Posts: 305
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

miche91 said
hi,

your example show how to read and compensate obly the temperature, right?

what about pressure?

 

thanks

Michele

Yes that example only shows temperature.  But it should be trivial to add pressure.  Just read the appropriate calibration constants and readings for pressure per the datasheet.

July 17, 2016
9:37 pm
Avatar
miche91
Member
Forum Posts: 33
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

Hi,

I've tried to built a VI aroud read temperature and pressure, but I can't understant how I can calculate "B3", "B4" and "B7" in "calculate true pressure" window on the Bosch datasheet (see attached), can anyone help me?

In my VI I perfectly calculate true temperature and read unconpensed pressure

thanks

July 19, 2016
4:19 pm
Avatar
Steffan
Admin
Forum Posts: 305
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

The equations for B3, B4, and B7 are in the datasheet you referenced.  You only need oss, AC1, AC3, and AC4 to compute these, which are the calibration and settings registers you have access to.  Let me know where your confusion is.

July 19, 2016
10:08 pm
Avatar
miche91
Member
Forum Posts: 33
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

I can't understand what does it means "<<" symbol and with what I need to replace "unsigned long" word

July 19, 2016
10:32 pm
Avatar
Steffan
Admin
Forum Posts: 305
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

That is a left shift and (unsigned long) is a cast.  You need to be able to understand this C code to be able to reproduce it in LabVIEW.  It would probably be more efficient to write a LabVIEW wrapper around a readily available BMP180 library.  You could check this forum to see if anyone has done that already but I am not aware of it.  If there is a demand for it, this is something we could do but it would not happen right away.

July 24, 2016
4:16 pm
Avatar
miche91
Member
Forum Posts: 33
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

Hi everyone,

I've tried to do a VI for read temperature and pressure through BMP180, I share with you all

If you need to read this sensor you can use this my VI hoping it's fair

 

Michele

July 29, 2016
2:48 am
Avatar
Steffan
Admin
Forum Posts: 305
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Michele,

I have created an addon for the BMP180 to read temperature and pressure that utilizes the SFE_BMP180 Arduino library.  Feel free to use this one.  It just needs to be unzipped to the Arduino Compatible Compiler for LabVIEW's addons directory.

Steffan

Forum Timezone: UTC 0

Most Users Ever Online: 33

Currently Online:
1 Guest(s)

Currently Browsing this Page:
1 Guest(s)

Top Posters:

John: 18

RTSLVU: 15

Dan6077: 11

Member Stats:

Guest Posters: 0

Members: 80

Moderators: 0

Admins: 3

Forum Stats:

Groups: 1

Forums: 2

Topics: 58

Posts: 289

Newest Members: Travlissah, viktorIcera, HowardClouG, Dianecet, Produktnaodchudzaniex

Administrators: geadmin: 5, filipealtoe: 35, Steffan: 89