December 30, 2015 at 11:02 #5566
I browsed the forum, but didn’t seem to find any topic about controlling I2C sensors connected to EV3 brick.
I’m a senior programmer, and I wrote a .NET software on my PC to make my bot autonomous, taking complex decisions, this software also allows me to control the bot using voice.
In the first time, I use the legoev3 library (C#), but I would like to add third party sensors like LightSensorArray from mindsensors and RFID reader from codatex, and this library doesn’t handle I2C sensors.
I try your communication library, but it seems there is the same issue.
My question is : how can I have access (read and write) to I2C sensors from my PC app (using Bluetooth) ?
Basically I see two solutions :
- to use a library which provides a way to communicate with I2C sensors (does the monobrick communication library fits ?)
- to use your firmware on a sd card, upload a EV3 program which deals with I2C sensors, but it must be able to send and receive data to the PC app (besides does your firmware handle bluetooth ?)
I’m a bit lost, accessing I2C sensors seems a bit tricky.
Thanks for any tips
PascalDecember 30, 2015 at 11:52 #5567
Anders SøborgKey Master
Have a look at this file and the sensor class. The file also shows how the Ultra Sonic sensor for both the NXT and EV3 is implemented. It should be possible to get the your I2C sensor working if the sensor is supported by the standard firmware.
I hope this will get your started.
/AndersDecember 30, 2015 at 13:59 #5568
I had a look at this file, the only function that seems useful is ‘Setup’, but I can’t manage it to work.
The ultraSonic Sensor seems to be a ‘classic’ sensor (only derives from sensor, with no particularities).
Thanks for taking the time to answer
PascalDecember 30, 2015 at 21:33 #5571
Anders SøborgKey Master
I must have misunderstood your question. The firmware takes care of detecting the sensor type and therefore also the I2C part. No way to setup I2C via the communication library. But if the firmware supports your sensor then you should be able to read its value.
Our C# firmware does not official support BT – but has support for WiFi and USB. But working with I2C from our firmware is easy. Just inherit from this class.
/AndersDecember 31, 2015 at 08:30 #5573
Nice, So the solution to my problem will be :
- Install the EV3 firmware on SD card
- Install the dll an compile my app (to deal with I2C sensors), I’m using VisuaStudio
- Manually upload the app on the EV3 (WinSCP)
But this makes the bot running by itself, How can I interact with my PC app ?
I saw in samples you have a webserver ? Can I use it to exchange messages between bot and PC ?
If I had a way to communicate with the firmware, I could setup a kind of server on EV3 which will interpret command messages from my PC App.
ThanksJanuary 1, 2016 at 14:21 #5574
Browsing the forum, I found useful examples about the way to send/receive message with the Web Server.
Also thanks for the I2CSensor class, I manage to deal with the LightSensorArray,not yet the RFID sensor.
I close this subject, and will post any further request or remarks in the Firmware Forum
You must be logged in to reply to this topic.