Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

did read and init for MS5611 #154

Merged
merged 2 commits into from
Oct 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions Spaceport/Code/Teensy-Based Avionics/src/Sensors/MS5611.cpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@

#include "MS5611.h"


namespace mmfs
{
MS5611::MS5611(const char *name)
{
setName(name);
}


bool MS5611::init()
{
if(!ms.begin())
{
return initialized = false;
}
ms.setOversampling(OSR_ULTRA_LOW)

return initialized = true;
}
void MS5611::read()
{
temperature = ms.getTemperature();
pressure = ms.getPressure();
}

}
24 changes: 24 additions & 0 deletions Spaceport/Code/Teensy-Based Avionics/src/Sensors/MS5611.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#ifndef MS5611_H
#define MS5611_H


#include <MS5611.h>
#include "Sensors/Baro/Barometer.h"


namespace mmfs
{
class MS5611 : public Barometer
{
private:
MS5611 ms;

public:
MS5611("MS5611");
virtual bool init() override;
virtual void read() override;
};


}
#endif
Loading