File tree Expand file tree Collapse file tree 1 file changed +23
-10
lines changed Expand file tree Collapse file tree 1 file changed +23
-10
lines changed Original file line number Diff line number Diff line change 7
7
8
8
Adafruit_MCP9600 mcp;
9
9
10
+ /* Set and print ambient resolution */
11
+ Ambient_Resolution ambientRes = RES_ZERO_POINT_0625;
12
+
10
13
void setup ()
11
14
{
12
- Serial.begin (115200 );
13
- while (!Serial) {
14
- delay (10 );
15
- }
16
- Serial.println (" MCP9600 HW test" );
15
+ Serial.begin (115200 );
16
+ while (!Serial) {
17
+ delay (10 );
18
+ }
19
+ Serial.println (" MCP9600 HW test" );
17
20
18
- /* Initialise the driver with I2C_ADDRESS and the default I2C bus. */
19
- if (! mcp.begin (I2C_ADDRESS)) {
20
- Serial.println (" Sensor not found. Check wiring!" );
21
- while (1 );
22
- }
21
+ /* Initialise the driver with I2C_ADDRESS and the default I2C bus. */
22
+ if (! mcp.begin (I2C_ADDRESS)) {
23
+ Serial.println (" Sensor not found. Check wiring!" );
24
+ while (1 );
25
+ }
23
26
24
27
Serial.println (" Found MCP9600!" );
25
28
29
+ /* Set and print ambient resolution */
30
+ mcp.setAmbientResolution (ambientRes);
31
+ Serial.print (" Ambient Resolution set to: " );
32
+ switch (ambientRes) {
33
+ case RES_ZERO_POINT_25: Serial.println (" 0.25°C" ); break ;
34
+ case RES_ZERO_POINT_125: Serial.println (" 0.125°C" ); break ;
35
+ case RES_ZERO_POINT_0625: Serial.println (" 0.0625°C" ); break ;
36
+ case RES_ZERO_POINT_03125: Serial.println (" 0.03125°C" ); break ;
37
+ }
38
+
26
39
mcp.setADCresolution (MCP9600_ADCRESOLUTION_18);
27
40
Serial.print (" ADC resolution set to " );
28
41
switch (mcp.getADCresolution ()) {
You can’t perform that action at this time.
0 commit comments