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 3 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
Members
Forum Posts: 35
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: 408
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
Members
Forum Posts: 35
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: 408
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
Members
Forum Posts: 35
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: 408
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
Members
Forum Posts: 35
Member Since:
May 11, 2016
sp_UserOfflineSmall Offline

yes!!

thanks you Steffan!

July 3, 2016
10:11 am
Avatar
miche91
Member
Members
Forum Posts: 35
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: 408
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
Members
Forum Posts: 35
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: 408
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
Members
Forum Posts: 35
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: 408
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
Members
Forum Posts: 35
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: 408
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

May 15, 2019
4:49 pm
Avatar
AK7466
Guest
Guests

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. 

miche91 said

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

Hi Steffan, I have the same problem as this one...    '_Wire' was not declared in this scope.

I have checked that I have the "I2C Open" vi in the initialisation, so I have attached my zipped up LabVIEW source code.  I would appreciate and help you may be able to give.

Many thanks

Alan K.

May 15, 2019
5:15 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

Please upload your code, there is no attachment on your post. 

May 15, 2019
5:30 pm
Avatar
AK7466
Guest
Guests

Thanks Steffan - not sure where the file went. However, I have sent the zipped up LVFlowProject.

May 15, 2019
5:42 pm
Avatar
Steffan
Admin
Forum Posts: 408
Member Since:
March 12, 2015
sp_UserOfflineSmall Offline

It compiled fine for me.  Are you sure you are stating the correct error or is this possibly your issue?

https://www.geverywhere.com/fo.....2c-lcd-vi/

May 16, 2019
9:57 am
Avatar
AK7466
Guest
Guests

Thanks for checking that Steffan, and for the suggestions.

I have attached the complete error listing from the compiler, which I notice also includes an error relating to the Serial comms which have been working fine.

Is it possible that this relates to file locations?

Thanks again for your help.

Alan K.

Forum Timezone: UTC 0
Most Users Ever Online: 100
Currently Online:
9
Guest(s)
Currently Browsing this Page:
2 Guest(s)
Top Posters:
miche91: 33
scottj: 28
scadao: 23
Member Stats:
Guest Posters: 5
Members: 202
Moderators: 0
Admins: 3
Forum Stats:
Groups: 1
Forums: 2
Topics: 266
Posts: 1222
Newest Members:
pujacontrol
Administrators: geadmin: 22, filipealtoe: 96, Steffan: 356