ROBOTC.net forums
http://www.robotc.net/forums/

Commands not working????
http://www.robotc.net/forums/viewtopic.php?f=41&t=3782
Page 1 of 1

Author:  NeXT-Generation [ Thu Nov 24, 2011 12:38 pm ]
Post subject:  Commands not working????

I have made a simple program to display the "average" value from the line leader:
Code:
#pragma config(Sensor, S4, LineLead, sensorI2CMindsensorsLineFollow)

#include "drivers/MSLL-driver.h";

task main()
{
  int Average;
 
  LLinit(LineLead);

  //LLinvertLineColor(LineLead);
  //LLtakeSnapshot(LineLead);
 
  while(true)
  {
    Average=LLreadAverage(LineLead);
    nxtDisplayCenteredBigTextLine(3, "%d", Average);
  }
 
}
It works fine on a black line, but when I add either of the commands to change the Line color, it still thinks the line is black. I've tried both commands, but they don't work. I'm using RobotC 3.04 with the latest driver suite.

Author:  mightor [ Thu Nov 24, 2011 12:45 pm ]
Post subject:  Re: Commands not working????

You need reread the sample programs that are included with the driver. They show how the sensor should be configured.

Set menu level to "expert" by going to Window->Menu Level->Expert
Open the Motor and Sensors Setup UI from the Robot menu
On the "Sensor Management" ensure "Allow custom designed sensors" is enabled

Now you can select "I2C Custom Fastest" from the drop down list in the "Sensors" tab.

- Xander

Author:  NeXT-Generation [ Thu Nov 24, 2011 1:06 pm ]
Post subject:  Re: Commands not working????

Okay, I did that, but it's still sensing the black as the line instead of the white!!! :breakcomputer: Is there some limitation of it that I'm not aware of? :?

Author:  mightor [ Thu Nov 24, 2011 1:17 pm ]
Post subject:  Re: Commands not working????

Did you calibrate it? You can get the calibration programs (for ROBOTC) from the Mindsensors website.
http://www.mindsensors.com/index.php?mo ... ent_id=102

- Xander

Author:  NeXT-Generation [ Thu Nov 24, 2011 1:24 pm ]
Post subject:  Re: Commands not working????

I have already calibrated it. It's not inverting the line color. It still thinks it's black line on white, yet it seems to automatically detect it when it follows the line.

Author:  mightor [ Thu Nov 24, 2011 1:43 pm ]
Post subject:  Re: Commands not working????

Maybe take a look at the LLinvertLineColor() function in the library :)

- Xander

Author:  NeXT-Generation [ Thu Nov 24, 2011 2:36 pm ]
Post subject:  Re: Commands not working????

I've tried that here:
Code:
#pragma config(Sensor, S4, LineLead, sensorI2CCustomFastSkipStates9V)

#include "drivers/MSLL-driver.h";

task main()
{
  int Average;
 
  LLinit(LineLead);

  //LLinvertLineColor(LineLead);
  //LLtakeSnapshot(LineLead);
 
  while(true)
  {
    Average=LLreadAverage(LineLead);
    nxtDisplayCenteredBigTextLine(3, "%d", Average);
  }
}
LLinvertLineColor and LLtakeSnapShot aren't changing anything. Is there a extra parameter that I missed?

Author:  mightor [ Thu Nov 24, 2011 3:11 pm ]
Post subject:  Re: Commands not working????

I am really not sure what the problem is. You put it on a white background with a black line and sees the line, you put it on a black background with a white line and it sees the line. What's the issue?

- Xander

Author:  NeXT-Generation [ Thu Nov 24, 2011 5:29 pm ]
Post subject:  Re: Commands not working????

The thing is every sensor except those that are on the line are returning a value. Even after I add LLinvertLineColor, it still thinks black is the line. I only want the sensors that are on the white line to return a value. If that isn't possible, then I need to rethink some stuff.

Author:  NeXT-Generation [ Fri Nov 25, 2011 8:48 pm ]
Post subject:  Re: Commands not working????

Anybody have an idea?

Author:  mightor [ Sat Nov 26, 2011 2:26 am ]
Post subject:  Re: Commands not working????

The sensors merely return what they see. The average is calculated regardless of whether the robot is on a black line or a white line, it's how it works. I am not entirely sure this is really an issue, it's just how the sensor works.

- Xander

Author:  NeXT-Generation [ Sat Nov 26, 2011 11:47 am ]
Post subject:  Re: Commands not working????

Oh, okay. Thanks anyway. I was just trying to have it return the average of the sensors that are over the white.

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/