From 29d5ebe4f5ebbe63f15ab64b8dcd452ff6c2de68 Mon Sep 17 00:00:00 2001 From: Noah Andrews Date: Thu, 29 Jun 2023 12:37:44 -0500 Subject: [PATCH] Missed a couple spots when updating the constructor --- Writing-an-I2C-Driver.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Writing-an-I2C-Driver.md b/Writing-an-I2C-Driver.md index 1d2ed8c..3a9887e 100644 --- a/Writing-an-I2C-Driver.md +++ b/Writing-an-I2C-Driver.md @@ -118,9 +118,9 @@ public class MCP9808 extends I2cDeviceSynchDevice 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 isn’t 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); 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); } - public MCP9808(I2cDeviceSynch deviceClient) + public MCP9808(I2cDeviceSynch deviceClient, boolean deviceClientIsOwned) { - super(deviceClient, true); + super(deviceClient, deviceClientIsOwned); this.setOptimalReadWindow(); this.deviceClient.setI2cAddress(ADDRESS_I2C_DEFAULT);