View Single Post
  #1   Spotlight this post!  
Unread 20-11-2016, 20:06
godkane godkane is offline
Registered User
FRC #3875
 
Join Date: Jan 2014
Location: Grand Rapids, MI
Posts: 11
godkane is an unknown quantity at this point
[FTC]: Using multiple sensors of same type

I got tired of not being able to read two color sensors or two sonic sensors, so I re-wrote the code to get them to work as expected.

In configuration, make sensor "I2C Device".

Initialization is hardware map, device name, and configured address.
color = new RedStormColorSensor(hwMap, "cb", 0x40);
range = new RedStormRangeSensor(hwMap, "rf", 0x2a);
Attached Files
File Type: java RedStormColorSensor.java (8.5 KB, 12 views)
File Type: java RedStormI2CDevice.java (9.0 KB, 11 views)
File Type: java RedStormRangeSensor.java (2.8 KB, 9 views)
Reply With Quote