hmc5883l_read.c
Go to the documentation of this file.
1 /*
2  hmc5883l_read.c : report magnetometer measurements
3 
4  Copyright (C) 2016 James Jackson
5 
6  This file is part of BreezySTM32.
7 
8  BreezySTM32 is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  BreezySTM32 is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with BreezySTM32. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #include <breezystm32.h>
23 
24 #define BOARD_REV 2
25 
26 
27 volatile uint8_t mag_status = 0;
28 int16_t mag_data[3] = {0.0, 0.0, 0.0};
29 
30 void setup(void)
31 {
32  delay(500);
34 
35  // Initialize the Magnetometer
38 }
39 
40 void loop(void)
41 {
44  printf("%d\t %d\t %d\n",
45  (int32_t)(mag_data[0]),
46  (int32_t)(mag_data[1]),
47  (int32_t)(mag_data[2]));
48  delay(6);
49 
50 
51 }
52 
bool hmc5883lInit()
Definition: drv_hmc5883l.c:83
void i2cInit(I2CDevice index)
Definition: drv_i2c.c:420
#define printf
Definition: printf.h:119
void setup(void)
Definition: hmc5883l_read.c:30
void hmc5883l_async_read(float *mag_data)
Definition: drv_hmc5883l.c:138
void loop(void)
Definition: hmc5883l_read.c:40
#define BOARD_REV
Definition: hmc5883l_read.c:24
int16_t mag_data[3]
Definition: hmc5883l_read.c:28
void hmc5883l_request_async_update()
Definition: drv_hmc5883l.c:118
volatile uint8_t mag_status
Definition: hmc5883l_read.c:27
void delay(uint32_t ms)
Definition: system.c:98


rosflight_firmware
Author(s): Daniel Koch , James Jackson
autogenerated on Thu Oct 24 2019 03:17:18