![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
A Hello World program showing how to get temperature readings from the MLX90614 infrared temperature sensor.
gy-906.h@0:964606fa7e7a, 2016-05-11 (annotated)
- Committer:
- jjones646
- Date:
- Wed May 11 17:48:57 2016 +0000
- Revision:
- 0:964606fa7e7a
Adding example program for the MLX90614 temperature sensor.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jjones646 | 0:964606fa7e7a | 1 | #pragma once |
jjones646 | 0:964606fa7e7a | 2 | |
jjones646 | 0:964606fa7e7a | 3 | namespace gy906 { |
jjones646 | 0:964606fa7e7a | 4 | //const int default_addr = 0x5a; |
jjones646 | 0:964606fa7e7a | 5 | const int default_addr = 0x00; |
jjones646 | 0:964606fa7e7a | 6 | namespace opcode { |
jjones646 | 0:964606fa7e7a | 7 | const int eeprom_access = 0x20; |
jjones646 | 0:964606fa7e7a | 8 | const int ram_access = 0x00; |
jjones646 | 0:964606fa7e7a | 9 | const int read_flags = 0xf0; |
jjones646 | 0:964606fa7e7a | 10 | const int sleep = 0xff; |
jjones646 | 0:964606fa7e7a | 11 | const int read_mask = 0x80; |
jjones646 | 0:964606fa7e7a | 12 | const int write_mask = 0x00; |
jjones646 | 0:964606fa7e7a | 13 | } |
jjones646 | 0:964606fa7e7a | 14 | namespace eeprom { |
jjones646 | 0:964606fa7e7a | 15 | const int T0_max = 0x00; |
jjones646 | 0:964606fa7e7a | 16 | const int T0_min = 0x01; |
jjones646 | 0:964606fa7e7a | 17 | const int PWMCTRL = 0x02; |
jjones646 | 0:964606fa7e7a | 18 | const int Ta_range = 0x03; |
jjones646 | 0:964606fa7e7a | 19 | const int EC_coef = 0x04; |
jjones646 | 0:964606fa7e7a | 20 | const int config_reg1 = 0x05; |
jjones646 | 0:964606fa7e7a | 21 | const int SMBus_addr = 0x0e; |
jjones646 | 0:964606fa7e7a | 22 | const int id1 = 0x1c; |
jjones646 | 0:964606fa7e7a | 23 | const int id2 = 0x1d; |
jjones646 | 0:964606fa7e7a | 24 | const int id3 = 0x1e; |
jjones646 | 0:964606fa7e7a | 25 | const int id4 = 0x1f; |
jjones646 | 0:964606fa7e7a | 26 | } |
jjones646 | 0:964606fa7e7a | 27 | namespace ram { |
jjones646 | 0:964606fa7e7a | 28 | const int ir1 = 0x04; |
jjones646 | 0:964606fa7e7a | 29 | const int ir2 = 0x05; |
jjones646 | 0:964606fa7e7a | 30 | const int T_ambient = 0x06; |
jjones646 | 0:964606fa7e7a | 31 | const int T_obj1 = 0x07; |
jjones646 | 0:964606fa7e7a | 32 | const int T_obj2 = 0x08; |
jjones646 | 0:964606fa7e7a | 33 | } |
jjones646 | 0:964606fa7e7a | 34 | } |