Skip to content

Commit

Permalink
fix off by one in I2C error message
Browse files Browse the repository at this point in the history
The port numbers (PORT_* values) are 0-based, however the actual port
numbers printed on the NXT are 1-based. So, add one so that the user
sees the port number printed on the NXT.
  • Loading branch information
dlech committed Apr 28, 2018
1 parent 9851bee commit ee0e25a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion nxt/sensor/digital.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ def __init__(self, brick, port, check_compatible=True):
sensor = self.get_sensor_info()
if not sensor in self.compatible_sensors:
print(('WARNING: Wrong sensor class chosen for sensor ' +
str(sensor.product_id) + ' on port ' + str(port) + '. ' + """
str(sensor.product_id) + ' on port ' + str(port + 1) + '. ' + """
You may be using the wrong type of sensor or may have connected the cable
incorrectly. If you are sure you're using the correct sensor class for the
sensor, this message is likely in error and you should disregard it and file a
Expand Down

0 comments on commit ee0e25a

Please sign in to comment.