View unanswered posts | View active topics It is currently Fri Dec 19, 2014 11:45 pm






Reply to topic  [ 12 posts ] 
Commands not working???? 
Author Message
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post 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.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Thu Nov 24, 2011 12:38 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Nov 24, 2011 12:45 pm
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post 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? :?

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Thu Nov 24, 2011 1:06 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Nov 24, 2011 1:17 pm
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post 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.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Thu Nov 24, 2011 1:24 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post Re: Commands not working????
Maybe take a look at the LLinvertLineColor() function in the library :)

- Xander

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Nov 24, 2011 1:43 pm
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post 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?

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Thu Nov 24, 2011 2:36 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Thu Nov 24, 2011 3:11 pm
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post 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.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Thu Nov 24, 2011 5:29 pm
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post Re: Commands not working????
Anybody have an idea?

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Fri Nov 25, 2011 8:48 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3297
Location: Rotterdam, The Netherlands
Post 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

_________________
| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]


Sat Nov 26, 2011 2:26 am
Profile WWW
Senior Roboticist
User avatar

Joined: Wed Sep 28, 2011 10:13 pm
Posts: 630
Location: If I told you, I'd have to kill you.
Post 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.

_________________
A.K.A. inxt-generation
Self-proclaimed genius, and future world dominator.
My Brickshelf Folder
"Don't they teach recreational mathematics anymore?" - The Tenth Doctor
Bow down to Nikola Tesla, King of the Geek Gods.


Sat Nov 26, 2011 11:47 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 12 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.