View unanswered posts | View active topics It is currently Tue Sep 02, 2014 6:30 pm






Reply to topic  [ 4 posts ] 
NXT Prototype board 
Author Message
Rookie
User avatar

Joined: Thu Oct 16, 2008 10:07 am
Posts: 6
Location: Between Here and There
Post NXT Prototype board
I am not sure where to ask this, but does anyone know what we are allowed to put on the NXT protoboard from HiTechnic? I am tempted to put a second processor on there to allow for a separate logic unit.

Also, how would I interface with the board via RobotC. I would assume the use of I2C, but how.

_________________
Code:
(*prev).next = (*toDelete).next;
delete toDelete;

//if only forgetting were
//this easy for me

assert "It's going to be okay";

//-xkcd


Wed Oct 22, 2008 5:06 pm
Profile
Novice

Joined: Thu Oct 09, 2008 7:58 pm
Posts: 79
Post Re: NXT Prototype board
Your question would be better handled in the FIRST forums. There you can get an official answer.

Personally, I don't think a separate logic unit is allowed. Check in the rules though.

I would STRONGLY recommond going to the FIRST forums. But make sure you read through the forums first. I think this issue has been previously addressed.


Wed Oct 22, 2008 8:00 pm
Profile
Creator
Creator

Joined: Fri Feb 09, 2007 9:21 am
Posts: 615
Post Re: NXT Prototype board
I would expect the most likely use of the prototype board is to add additional sensors. It is a great board for addigin additional simple analog sensors and simple touch sensors.

There are snippets of code on the web that illustrate the use of the prototype board and wrap into a nice function that you can use.


Wed Oct 22, 2008 10:29 pm
Profile
Professor

Joined: Fri Sep 19, 2008 1:22 am
Posts: 200
Post Re: NXT Prototype board
Our prototype board showed up in the mail today. We created a simple touch sensor and hooked it to one of the digital pins.

Here is the sample code. When you press the touch sensor, NXT displays the decimal value of the pin that sensor is attached to:

Code:
task main()
{
    // I2C Byte pattern to set the digital IO pins for Input
    // Message Length: 3    Data: 02 4E 00    Return bytes: 0
    byte msgSetDigitalIOPins[] = { 3, 2, 0x4E, 0 };

    // I2C Byte pattern to read the digital 6 bit value
    // Message Length: 2    Data: 02 4C     Return bytes: 1
    byte msgReadDigitalValues[] = { 2, 2, 0x4C };
   
    byte retBytes[8];  // return (reply) bytes

    eraseDisplay();
    SensorType[S1] = sensorI2CCustom;
    sendI2CMsg(S1, msgSetDigitalIOPins, 0);  // Make sure all of the digital I/O pins are in INPUT mode.

    while (nI2CStatus[S1] == STAT_COMM_PENDING)
        wait1Msec(2);

    readI2CReply(S1, retBytes, 0);

    while (true)
    {
        sendI2CMsg(S1, msgReadDigitalValues, 1);

        while (nI2CStatus[S1] == STAT_COMM_PENDING)
            wait1Msec(2);

        if (nI2CBytesReady[S1] == 1)
        {
            readI2CReply(S1, retBytes, 1);

            nxtDisplayTextLine(1, "B: %d", (~retBytes[0]) & 0x01);
            nxtDisplayTextLine(2, "B: %d", (~retBytes[0]) & 0x02);
            nxtDisplayTextLine(3, "B: %d", (~retBytes[0]) & 0x04);
            nxtDisplayTextLine(4, "B: %d", (~retBytes[0]) & 0x08);
            nxtDisplayTextLine(5, "B: %d", (~retBytes[0]) & 0x10);
            nxtDisplayTextLine(6, "B: %d", (~retBytes[0]) & 0x20);
        }
        else
            nxtDisplayTextLine(2, "B: ERR");
    }
}

_________________
Jeff McBride
Benson Robotics Club


Thu Oct 23, 2008 1:36 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 4 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest


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.