View unanswered posts | View active topics It is currently Wed Jan 17, 2018 3:19 am






Reply to topic  [ 2 posts ] 
SensorType seem "read only" on my EV3 
Author Message
Rookie

Joined: Tue Feb 21, 2012 12:38 pm
Posts: 11
Location: Paris, France
Post SensorType seem "read only" on my EV3
Hi,

Until now, I was using a NXT brick for my robots. But now the drivers seem up to date for all my sensors, I tried to go now on a EV3 brick.
That doesn't work at all and I tried to see what is the source of my issues. It seems to come from sensor configuration that I can't change. I made the following code :
Code:
#pragma config(Sensor, S1,     sensor1,        sensorEV3_GenericI2C)
#pragma config(Sensor, S2,     sensor2,              sensorEV3_Touch)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

int var1,var2=50;
task main()
{

   while(1)
   {
      var1 = SensorType[S1];
      var2 = SensorType[S2];
      wait1Msec (1000);
   }
}
Just to see why i2cwrite function told me my sensors were not well configured.

With this code running on my EV3, I read var1 and var2 on my debug window. Both equal to 0, whatever the initial configuration. Even if I force the SensorType of S1 or S2 into my code, it doesn't change anything.

If I use the "Test I2C sensors utility", it works fine and I can use my i2C sensors.
What have I done wrong?

I'm using RobotC 4.32, WindowsXP 32bits, linuxKernel 107x.bin and latest firmware.

Thx,

_________________
Bichon, Brickstory team for Eurobot


Mon May 16, 2016 5:29 pm
Profile WWW
Rookie

Joined: Tue Feb 21, 2012 12:38 pm
Posts: 11
Location: Paris, France
Post Re: SensorType seem "read only" on my EV3
I have more clues after having tested different things on my EV3:

When I connect a well known sensor (EV3Touch for example), the program gives me the good SensorType into my variable. If it's another kind of sensor (RCX Motor Mux for example), then the brick doesn't recognize it and says there is no sensor (in my program) and answer 0.

If I use the "Test I2C sensors utility", it works fine, I can use the I2C device using this tool. Then if I launch my program, it recognize that the SensorType is sensorEV3_GenericI2C.
But if I unplug then plug my device, it seems to search what kind of sensor is plugged and as it doesn't recognize it, it answers 0.

So my questions now are :
- Why the brick doesn't recognize my RCXmotorMux as a known I2C device, although the drivers are in the sample programs?
- Why does it try to recognize which i2c device as I try to force the SensorType in my program?
- Is there a way to avoid this and to really force the SensorType inside the program?

Thank you for your help.

_________________
Bichon, Brickstory team for Eurobot


Thu May 19, 2016 5:57 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  



Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.