Missed a couple spots when updating the constructor

Noah Andrews
2023-06-29 12:37:44 -05:00
parent f02ff0b85c
commit 29d5ebe4f5

@ -118,9 +118,9 @@ public class MCP9808 extends I2cDeviceSynchDevice<I2cDeviceSynch>
In the construction, we need to add a couple statements in order to communicate with the sensor. The sensor starts off disengaged, meaning that there isnt any communication, which allows us to change things like the I2C address (more on that later) without causing issues. Once everything has been set up, we need to engage the sensor to start communicating. We also need to run the arming state callback method that deals with situations involving USB cables disconnecting and reconnecting: In the construction, we need to add a couple statements in order to communicate with the sensor. The sensor starts off disengaged, meaning that there isnt any communication, which allows us to change things like the I2C address (more on that later) without causing issues. Once everything has been set up, we need to engage the sensor to start communicating. We also need to run the arming state callback method that deals with situations involving USB cables disconnecting and reconnecting:
``` ```
public MCP9808(I2cDeviceSynch deviceClient) public MCP9808(I2cDeviceSynch deviceClient, boolean deviceClientIsOwned)
{ {
super(deviceClient, true); super(deviceClient, deviceClientIsOwned);
super.registerArmingStateCallback(false); super.registerArmingStateCallback(false);
this.deviceClient.engage(); this.deviceClient.engage();
@ -227,9 +227,9 @@ Now that we have the registers set up, we can add a few more things to the initi
this.deviceClient.setReadWindow(readWindow); this.deviceClient.setReadWindow(readWindow);
} }
public MCP9808(I2cDeviceSynch deviceClient) public MCP9808(I2cDeviceSynch deviceClient, boolean deviceClientIsOwned)
{ {
super(deviceClient, true); super(deviceClient, deviceClientIsOwned);
this.setOptimalReadWindow(); this.setOptimalReadWindow();
this.deviceClient.setI2cAddress(ADDRESS_I2C_DEFAULT); this.deviceClient.setI2cAddress(ADDRESS_I2C_DEFAULT);