Main Site Documentation

Barometer in C#


#1

Hi, I’m in High School and I’m working on a Cerbuino FEZ in C#.

I need to mesure the altitude with the barometer and put it on the display N18. I know how to write on the display but I don't know what to do with the barometer. I've search every where...

If anyone of you could give me a code so I can look at it, or even a website, I would be thanksfull to you :wink:


#2

Welcome to the forum Ragn!

Can I ask, do you have the barometer connected in the Gadgeteer designer ?

https://bitbucket.org/ghi_elect/gadgeteer/src/aa94c72f5efb18d49b04f1b56ddcc51f3ff53d31/Modules/GHIElectronics/Barometer/Barometer_43/Barometer_43.cs?at=master has the driver if not, but it also is a reference to tell you what methods the driver exposes. From that you can figure out how to get the baro reading. From that, it seems like you’ll use a measurement completed handler (look for MeasurementCompleteEventArgs), and you’ll call either the single measurement request or start doing constant readings, depending on how often you expect the barometric pressure to change.


#3

@ Ragn - have a look here as an overview for how this works http://en.m.wikipedia.org/wiki/Altimeter
And there are lots of code samples for the barometer module in the code share section


#4

@ Ragn - Welcome to the community! Do you mind sharing a little more about your class? First, are you part of @ Gary’s class? If not… Is your entire class using Gadgeteer or did you pick it on your own? Is this part of your core curriculum or an after school program? Is a member here your instructor? Would you share as much about the location of your school as you’re comfortable with? Sorry if I’m prying too much but I’m interested in learning more about your curriculum and how Gadgeteer became a part of it.

Thanks!

Ian