View unanswered posts | View active topics It is currently Sun Sep 15, 2019 2:31 pm






Reply to topic  [ 5 posts ] 
NXT COLOR SENSOR !! 
Author Message
Rookie

Joined: Tue Mar 22, 2011 2:58 pm
Posts: 5
Post NXT COLOR SENSOR !!
Hey Guys

i wanna some Queries about color sensor nxt

Essential idea :
DAM safety

Architecture of our Project :-

1-graphical Simulation for dam by Java
2-color sensor Nxt
3-Controller

the way of implement
color sensor sens the color from graphical simulation
if color is blue do not do any thing but if the color is red the color sensor send raw red color to the controller after that the controller send the number it's meant 3 for red or 4 blue anything else to the computer by Embedded Bluetooth then our computer it's gives instruction to graphical simulation for dam open gates and decrease the red color !!!



Questions!!
now i wanna the code of program that sens color from graphical simulation or similar for that
is programmed by NXC ?

and The code of blutooth it's supported connection between controller and Pc
is programmed by Nxc?


Tue Mar 22, 2011 3:20 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: NXT COLOR SENSOR !!
Here's a very simple program for your colour sensor:

Code:
#pragma config(Sensor, S1,     colorPort,           sensorCOLORFULL)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
{
  string sColor;

  while (true) {
    switch (SensorValue[colorPort])
    {
      case BLACKCOLOR:    sColor = "Black";     break;
      case BLUECOLOR:     sColor = "Blue";      break;
      case GREENCOLOR:    sColor = "Green";     break;
      case YELLOWCOLOR:   sColor = "Yellow";    break;
      case REDCOLOR:      sColor = "Red";       break;
      case WHITECOLOR:    sColor = "White";     break;
      default:            sColor = "???";       break;
    }
    nxtDisplayCenteredTextLine(2, sColor);
    wait1Msec(50);
  }
}


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


Tue Mar 22, 2011 3:46 pm
Profile WWW
Rookie

Joined: Fri Mar 18, 2011 12:17 pm
Posts: 3
Post Re: NXT COLOR SENSOR !!
Mr. Mightor

how can I connect the NXT to the PC using bluetooth??

must I write a code in NXC for bluetooth on NXT and another code on the PC??

plz mighter
if you have any code help me

thx in advance


Tue Mar 22, 2011 4:21 pm
Profile
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: NXT COLOR SENSOR !!
If you need help with ROBOTC then this is the right place, if you need help with NXC, you would be better off going to the MINDboards forums: index.php

These are the ROBOTC forums :)

- 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 Mar 23, 2011 2:27 am
Profile WWW
Rookie

Joined: Fri Mar 18, 2011 12:17 pm
Posts: 3
Post Re: NXT COLOR SENSOR !!
Xandar

my question is regarding the NXT robot and how can I connect it to my pc through bluetooth??

thx


Fri Mar 25, 2011 1:03 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 5 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.