forked from EmbeddedTeam/app_photomagnetic
feat: complete v0.0.1 temperature and id reporting
This commit is contained in:
parent
62205e1377
commit
0539014bfd
2
prj.conf
2
prj.conf
@ -9,3 +9,5 @@ CONFIG_SERIAL=y
|
||||
CONFIG_UART_INTERRUPT_DRIVEN=y
|
||||
CONFIG_PMC_COM=y
|
||||
CONFIG_HWINFO=y
|
||||
|
||||
CONFIG_REBOOT=y
|
||||
@ -7,6 +7,7 @@
|
||||
using namespace pmc;
|
||||
|
||||
auto sensor = DEVICE_DT_GET(DT_NODELABEL(godtek));
|
||||
auto uart = DEVICE_DT_GET(DT_NODELABEL(usart2));
|
||||
|
||||
volatile bool flag{false};
|
||||
|
||||
@ -22,6 +23,11 @@ auto main(void) -> int {
|
||||
};
|
||||
|
||||
while (1) {
|
||||
for (int i = 0; i < 16; i++) {
|
||||
uart_poll_out(uart, 0xAA);
|
||||
}
|
||||
k_msleep(100);
|
||||
|
||||
if (flag) {
|
||||
sensor_value val{0, 0};
|
||||
if (sensor_sample_fetch_chan(sensor, SENSOR_CHAN_AMBIENT_TEMP) == 0) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user