Will the library for the Rev color sensor work?

67 views
Skip to first unread message

Charlie Peppler

unread,
Nov 2, 2020, 8:41:05 AM11/2/20
to vmx-pi
Just a quick question for whoever might know the answer...

Because the FRC season has effectively been blown out, and
the local high school where I was a mentor has abandoned
robotics, I decided to keep going forward with any students
who were interested.  I am now training a few, using the 
Studica Trainer.

I created a fun challenge for them, part of which is detecting
the color of a ball, so an RGB sensor would be quite useful.

I know they included this one for last years competition:
https://www.revrobotics.com/rev-31-1557/

Before I get started with it, I wanted to inquire whether the vendordep
will work with the VMX-pi.

Any heads up before I go ordering it would be much appreciated.

Thanks in advance!

Charlie Peppler

James Taylor

unread,
Nov 2, 2020, 8:47:37 AM11/2/20
to vmx-pi
Based on the json they include raspbian as a platform. I can test and let you know. 

James Taylor

unread,
Nov 2, 2020, 10:01:19 AM11/2/20
to vmx-pi
I have tested it and it is working.

Somethings to note
  • The sensor is 3.3V so adjust the jumper correctly
  • When initializing the i2c port use kMXP.

2020-11-02 09_58_20-Shuffleboard.png

Thanks
James

Charlie Peppler

unread,
Nov 2, 2020, 2:13:49 PM11/2/20
to vmx-pi
James,

Thanks for your fast turn around on testing this sensor.  I just ordered one for the team.

Best,

Charlie

Charlie Peppler

unread,
Nov 14, 2020, 2:23:45 PM11/14/20
to vmx-pi
James,

  • I've set the power jumper on the comm ports to 3.3V,
  • I used the kMXP enum for the port (see attached code)
  • I've wired the sensor to the I2C port on the comm bank of the VMXpi
  • The white LED light is showing on the sensor, so it has power.
  • Downloaded the attached code successfully

I executed the attached code, and got the following error (from the console):

 VMX HAL:  SPI Aux Channel 2 opened with baudrate of 4000000. 
 VMX HAL:  Established communication with VMX-pi model 0x32, hardware rev 60, firmware version 3.0.411 
 VMX HAL:  Acquired navX-Sensor configuration. 
 VMX HAL:  Library version 1.1.237 
 Set VMX CAN Mode to NORMAL. 
 Server Running... 
 ********** Robot program starting ********** 
ERROR  1  Could not find REV color sensor  com.revrobotics.ColorSensorV3.checkDeviceID(ColorSensorV3.java:400) 
 Error at com.revrobotics.ColorSensorV3.checkDeviceID(ColorSensorV3.java:400): Could not find REV color sensor 
 [...]

I tried changed the port address to I2C.Port.kOnboard, with no change.  I've tried it on two different VMX-pi s, and get
the same result on both.

Any recommendations about how to diagnose the problem, so the library can find the sensor?

------------
Robot.java

Charlie Peppler

unread,
Nov 15, 2020, 12:41:07 PM11/15/20
to vmx-pi
Here is a photo of connections, in case this is helpful....IMG_7270[1].JPG

James Taylor

unread,
Nov 16, 2020, 9:05:53 AM11/16/20
to vmx-pi
Hi Charlie,

Sorry for the late reply, I was fishing. Your code is correct but your wiring is not. Based on the REV datasheet you have the communication lines mixed up. IE the blue and white cable. 

It should be GND V SDA SCL and you have GND V SCL SDA.

Thanks
James

Charlie Peppler

unread,
Nov 16, 2020, 10:24:04 AM11/16/20
to vmx-pi
Hi James,

I'm jealous!  Where do you fish and what do you fish for?  I enjoy fishing myself.

Doh!  You nailed it.  I made the bad assumption of using the provided cable out of the
box.  It must be specifically for the RoboRIO, which likely switches from the VMXpi AMP
breakout.

It is now working correctly.

Thank you!

Charlie

James Taylor

unread,
Nov 16, 2020, 11:08:13 AM11/16/20
to vmx-pi
Good to hear that it is working. 

Also, I fish up by my cottage here in Ontario. Normally go for Pike or Bass. 

Thanks
James

Reply all
Reply to author
Forward
0 new messages