View unanswered posts | View active topics It is currently Thu Aug 21, 2014 10:29 pm






Reply to topic  [ 8 posts ] 
Color sensor for Robotc 
Author Message
Rookie

Joined: Wed Jul 15, 2009 5:08 am
Posts: 4
Post Color sensor for Robotc
Hello world! I am Italian so I apologize if my English is not very correct.
I'm desperately looking for drivers for the color sensor of hitechnic to add on robotc. Someone knows where I can download it?
thanks...
Grees


Wed Jul 15, 2009 5:24 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3188
Location: Rotterdam, The Netherlands
Post Re: Color sensor for ROBOTC
Grees,

Have a look at the RobotC Driver Suite. It has drivers for the sensor you're talking about. You can also use the built-in one by using the Motor and Sensor Setup in the "Robot" menu option. It's in the drop down list. You can then access the colour it is currently detecting by using "SensorValue[<your sensor port>];

Regards,
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]


Wed Jul 15, 2009 5:35 am
Profile WWW
Rookie

Joined: Wed Jul 15, 2009 5:08 am
Posts: 4
Post Re: Color sensor for ROBOTC
Grazie mille mightor. Sei un grande! GRAZIE GRAZIE.
Thank you for the help.I have a debt with you.:):) Thanks


Wed Jul 15, 2009 5:41 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3188
Location: Rotterdam, The Netherlands
Post Re: Color sensor for ROBOTC
Quote:
Grazie mille mightor. Sei un grande! GRAZIE GRAZIE.
Thank you for the help.I have a debt with you.:) Thanks

I accept payments in all major denominations, euro, yen and Canadian dollars. Sorry no US dollars, they're a little weak and unstable at the moment.

*grin*

If you need an example of some code, let me know and I'll see if I can cook something up for you.

Regards,
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]


Wed Jul 15, 2009 5:56 am
Profile WWW
Rookie

Joined: Wed Jul 15, 2009 5:08 am
Posts: 4
Post Re: Color sensor for ROBOTC
hihi!:) you are very sympathetic.
ehm, I have a problem. I do not know how I have to add the drivers to robotc. How is it done?
Grees


Wed Jul 15, 2009 6:03 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3188
Location: Rotterdam, The Netherlands
Post Re: Color sensor for ROBOTC
If you copy the following program in your editor window, you can get started with the sensor:
Code:
#pragma config(Sensor, S1,     HTCOLOUR,            sensorI2CHiTechnicColor)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main() {
  int colournr = 0;

  nxtDisplayCenteredBigTextLine(1, "Colour:");
  while (true) {
    // Read the colour value from the sensor
    colournr = SensorValue[HTCOLOUR];
    // Display the colour in big letters
    nxtDisplayCenteredBigTextLine(3, "%d", colournr);
    wait1Msec(50);
  }
}


I have tested this with RobotC 1.46 and the colour sensor attached to sensor port S1. You do not need the RobotC driver suite for this. It makes use of the built-in ones.

Regards,
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]


Wed Jul 15, 2009 6:17 am
Profile WWW
Rookie
User avatar

Joined: Fri Jun 12, 2009 6:38 pm
Posts: 25
Location: Albany, Oregon, USA, North Western Hemisphere, Planet Tera
Post Re: Color sensor for ROBOTC
mightor wrote:
Quote:
Grazie mille mightor. Sei un grande! GRAZIE GRAZIE.
Thank you for the help.I have a debt with you.:) Thanks

I accept payments in all major denominations, euro, yen and Canadian dollars. Sorry no US dollars, they're a little weak and unstable at the moment.

*grin*

<< SNIP >>

Regards,
Xander


No US Dollars? Are you sure?? Maybe you could just double your amount.

_________________
MarkO

FRC Team 957 "2007-2009 Professional Mentor"

http://vex.markdoverholser.com/notice.html

http://vex.markdoverholser.com/
http://tech.markdoverholser.com/


Wed Jul 15, 2009 6:16 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post Re: Color sensor for ROBOTC
Xander,
I can copy this:
"Buy on bad news"! ;)

_________________
regards,
HaWe aka Ford
#define S sqrt(t+2*i*i)<2
#define F(a,b) for(a=0;a<b;++a)
float x,y,r,i,s,j,t,n;task main(){F(y,64){F(x,99){r=i=t=0;s=x/33-2;j=y/32-1;F(n,50&S){t=r*r-i*i;i=2*r*i+j;r=t+s;}if(S){PutPixel(x,y);}}}while(1)}


Wed Jul 15, 2009 6:18 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 8 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.