Skip to content
Snippets Groups Projects
Commit e3d4f3e9 authored by Alberto Nidasio's avatar Alberto Nidasio
Browse files

[Thermocouples] Tested driver without success

parent d160e166
Branches
Tags
No related merge requests found
Pipeline #3601 passed
...@@ -112,6 +112,7 @@ ...@@ -112,6 +112,7 @@
"Alain", "Alain",
"ARPE", "ARPE",
"BDTR", "BDTR",
"Boardcore",
"Carlucci", "Carlucci",
"CCER", "CCER",
"CCMR", "CCMR",
...@@ -151,7 +152,8 @@ ...@@ -151,7 +152,8 @@
"USART", "USART",
"WWDG", "WWDG",
"WWDGEN", "WWDGEN",
"Xbee" "Xbee",
"Zangari"
], ],
"C_Cpp.errorSquiggles": "Disabled", "C_Cpp.errorSquiggles": "Disabled",
"cSpell.enabled": true "cSpell.enabled": true
......
Subproject commit e61a8fc6d279c0681434c3dca161215a3758916c Subproject commit 5e2af801ff9093f2d93c469a170618d67ba6bdca
...@@ -21,12 +21,14 @@ ...@@ -21,12 +21,14 @@
*/ */
#include <miosix.h> #include <miosix.h>
#include <scheduler/TaskScheduler.h>
#include <sensors/MAX31855/MAX31855.h> #include <sensors/MAX31855/MAX31855.h>
#include <sensors/MAX6675/MAX6675.h>
using namespace miosix; using namespace miosix;
using namespace Boardcore; using namespace Boardcore;
constexpr uint32_t THERMOCOUPLE_SAMPLE_PERIOD = 250; constexpr uint32_t THERMOCOUPLE_SAMPLE_PERIOD = 150;
SPIBus spiBus(SPI5); SPIBus spiBus(SPI5);
...@@ -37,9 +39,20 @@ MAX31855 thermocouple4(spiBus, sensors::max31855::cs4::getPin()); ...@@ -37,9 +39,20 @@ MAX31855 thermocouple4(spiBus, sensors::max31855::cs4::getPin());
MAX31855 thermocouple5(spiBus, sensors::max31855::cs5::getPin()); MAX31855 thermocouple5(spiBus, sensors::max31855::cs5::getPin());
MAX31855 thermocouple6(spiBus, sensors::max31855::cs6::getPin()); MAX31855 thermocouple6(spiBus, sensors::max31855::cs6::getPin());
void sample();
int main() int main()
{ {
TaskScheduler scheduler;
scheduler.addTask(sample, THERMOCOUPLE_SAMPLE_PERIOD);
scheduler.start();
while (true) while (true)
Thread::sleep(1000);
}
void sample()
{ {
thermocouple1.sample(); thermocouple1.sample();
thermocouple2.sample(); thermocouple2.sample();
...@@ -56,8 +69,4 @@ int main() ...@@ -56,8 +69,4 @@ int main()
thermocouple4.getLastSample().temperature, thermocouple4.getLastSample().temperature,
thermocouple5.getLastSample().temperature, thermocouple5.getLastSample().temperature,
thermocouple6.getLastSample().temperature); thermocouple6.getLastSample().temperature);
Thread::sleep(THERMOCOUPLE_SAMPLE_PERIOD);
}
return 0;
} }
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment