I have successfully tested with the sample code below but I wish to use two sensors, The code searches by sensor type. How can I directly access each sensor by address.
This code is from :
Grove - I2C High Accuracy Temperature Sensor(MCP9808) - Seeed Wiki (seeedstudio.com)
import sys
import time
from grove.factory import Factory
from grove.temperature import Temper
def main():
print(“Insert Grove - I2C-High-Accuracy-Temperature”)
print(" to Grove-Base-Hat any I2C slot")
sensor = Factory.getTemper("MCP9808-I2C")
sensor.resolution(Temper.RES_1_16_CELSIUS)
print('Detecting temperature...')
while True:
print('{} Celsius'.format(sensor.temperature))
time.sleep(1)
if name == ‘main’:
main()