Hi, I’m trying to use an NXT Ultrasonic Sensor with an EV3 brain. According to the documentation, I should use the following:
var brain = new Brick<Sensor, Sensor, Sensor, Sensor>("com6"); //set up brick brain.Connection.Open(); //connect to brick brain.Sensor1 = new UltrasonicSensor();
However, trying this brings up a compile error:
MonoBrick.EV3.UltrasonicSensor is inaccessible due to its protection level
and MonoBrick.EV3.UltrasonicSensor has no constructors defined
I have linked the communication library .dll properly, as tab completion is working (Visual Studio 2013), and creating the brick object works fine. Is there something I’m missing to get this sensor working?
In the source code the ultrasonic sensor is internal. This means that the you can not access the class if you use the DLL. This is a bug that has already been fixed as seen here. But the new source have not been compiled and released. So there are two ways that you can solve the problem. Use the library that comes with the the test project or compile the DLL yourself use the Github“>Github source. Hope this answers your question.