View unanswered posts | View active topics It is currently Sat Aug 23, 2014 2:20 am






Reply to topic  [ 39 posts ]  Go to page 1, 2, 3  Next
NXT + PCF8574 
Author Message
Expert

Joined: Sun Sep 09, 2007 10:12 am
Posts: 116
Post NXT + PCF8574
I am trying to work with RobotC + PCF8574

and until now i can't do nothing with it...

The sample program on RobotC doesn't work for me and i really don't know why.

Anyone could help?

_________________
http://www.apcsguarda.com
My Project: http://www.robotc.net/forums/viewtopic.php?f=15&t=712


Mon Jun 02, 2008 7:00 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3191
Location: Rotterdam, The Netherlands
Post 
I would love to know how to use this thing, too. I have one but I have not used it yet.

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]


Tue Jun 03, 2008 4:05 am
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
hi,
in our German forum we have a member who wrote a program with this PCF to connect a small keypad to the NXT:
http://www.mindstormsforum.de/viewtopic.php?t=2885

foto: Image

HTH!

_________________
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)}


Tue Jun 03, 2008 8:58 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3191
Location: Rotterdam, The Netherlands
Post 
Super toll! Thanks for the link, Ford :)

I am going to have to learn I2C if I am ever to mate my NXT with one of these babies:
Image
It's a Propeller Proto Board, a test board with an 8 core uController (the Parallax Propeller) running at 80MHz. I have two robots powered by these. True multiprocessing :) I have a spare board, complete with VGA connector and 2xPS2 for keyboard and mouse.

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]


Tue Jun 03, 2008 9:14 am
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
I'm glad if I could help!
I myself unfortunately am unable to solder anything - as we call it: I got "two left hands".

But for my neural net I'm looking for a sensor multiplexer for analog sensors, like 20 Touch or Sharp GP2D12 Sensors (<- THAT would be GREAT!)

Are you experienced for such a thing?

_________________
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)}


Last edited by Ford Prefect on Tue Jun 03, 2008 11:59 am, edited 1 time in total.



Tue Jun 03, 2008 9:27 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3191
Location: Rotterdam, The Netherlands
Post 
Well, I am not an expert, but I manage. The protoboard pictured above comes pre-assembled, so you don't need to do much to make it work. As for ADCs to suit your need, a friend of mine swears by the Maxim MAX127. It has something like 8 x 12bit analogue channels and a very nice I2C interface. They're a little pricey (about 15-20 euro) but you can order "product samples" for free from the website if you have some company address to send them to :)
Here is some more info on them: LINK.

As for soldering, why not get yourself a breadboard:
Image
No need to solder then, I love those things. Once you have it all working, you stick it onto a proper board and solder it all together. Breadboards are very much in the Lego-spirit, put it together, play with it, then take it apart again.

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]


Tue Jun 03, 2008 9:41 am
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
thx for the link, but I don't understand anything of those electronics... (otherwise I probably were even able to solder... :oops: )

_________________
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)}


Tue Jun 03, 2008 10:07 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3191
Location: Rotterdam, The Netherlands
Post 
Surely if you can wrap your brain around AI and NNs, you can figure out a small electronic circuit :)

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]


Tue Jun 03, 2008 1:00 pm
Profile WWW
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post 
Hi Docilio

It looks like there could be a I2C bug in the last 2 beta releases, and I2C devices are not working. This could be the issue. Dicks working on that right now, so hang in there B-)

viewtopic.php?t=591

Scott

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Tue Jun 03, 2008 2:14 pm
Profile WWW
Guru
User avatar

Joined: Sat Mar 01, 2008 12:52 pm
Posts: 1030
Post 
mightor wrote:
Surely if you can wrap your brain around AI and NNs, you can figure out a small electronic circuit :)

maybe, if I found the time to learn sth. about resistors and transistors and IC's (and English) - but the only thing I know is sth about mathmatics (besides my profession). Unfortunately, nobody is prefect - eehm: perfect. :wink:

_________________
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)}


Tue Jun 03, 2008 3:43 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Jan 31, 2007 3:39 am
Posts: 299
Location: San Diego, California. USA
Post 
Quote:
Unfortunately, nobody is prefect - eehm: perfect.

lol poke fun at the moderator ;-)

_________________
Mmmm Legos B-)

My Robot Projects:
http://www.freewebs.com/robotprojects/


Tue Jun 03, 2008 3:46 pm
Profile WWW
Rookie

Joined: Fri Apr 20, 2007 3:22 am
Posts: 36
Post Re: NXT + PCF8574
docilio wrote:
I am trying to work with RobotC + PCF8574

and until now i can't do nothing with it...

The sample program on RobotC doesn't work for me and i really don't know why.

Anyone could help?


Are you talking abnout minsdsenors unit?

I've used one a few times, what exactly are you trying to do with it?


Tue Jun 03, 2008 6:11 pm
Profile
Rookie

Joined: Fri Apr 20, 2007 3:22 am
Posts: 36
Post 
Here's a sample to use as an input device:

typedef struct{
byte i2cMessageSize;
byte i2cDeviceAddress;
byte i2cWriteMessage;
} i2c_mess;



task main()
{
byte value[2];
int outputNumber;

byte cnt = 0;

SensorType[S1] = sensorI2CCustomFast;

i2c_mess ledArray;
ledArray.i2cMessageSize = 1;
ledArray.i2cDeviceAddress = 0x70;
ledArray.i2cWriteMessage = 0xFF;

while(1)
{
cnt++;
if (nI2CStatus[S1] == NO_ERR)
sendI2CMsg(S1,ledArray.i2cMessageSize,1); // set pins high for input
if (nI2CStatus[S1] == NO_ERR)
readI2CReply(S1, value[0],1); // read pins

outputNumber =(int) value[0];

nxtDisplayTextLine(4, "value %d", outputNumber);

}
}


I also have some out put samples at home I can post later on if you'd like.

If you built the mindsensors board you have to be careful that the address jumpers are set up correctly. And the documantation they have for it is wrong. They give you the adrressing for the PCF8574 but they give you the PCF8574A. The base address of the PCF8574A is 0x70.


Tue Jun 03, 2008 6:17 pm
Profile
Rookie

Joined: Fri Apr 20, 2007 3:22 am
Posts: 36
Post 
I was thinking the same thing. =P

Somebody posted an I2cslave object for the propeller a few weeks ago. I haven't had a chance to try it yet.

mightor wrote:
Super toll! Thanks for the link, Ford :)

I am going to have to learn I2C if I am ever to mate my NXT with one of these babies:
Image
It's a Propeller Proto Board, a test board with an 8 core uController (the Parallax Propeller) running at 80MHz. I have two robots powered by these. True multiprocessing :) I have a spare board, complete with VGA connector and 2xPS2 for keyboard and mouse.

Regards,
Xander


Tue Jun 03, 2008 6:19 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3191
Location: Rotterdam, The Netherlands
Post 
squiggy wrote:
I was thinking the same thing. =P

Somebody posted an I2cslave object for the propeller a few weeks ago. I haven't had a chance to try it yet.

I saw Hippy's post. I can't wait to try it out. So many things to play with, so little time! Thanks for the code for the mindsensors unit, btw.

Edit: Any code you might have, would be great! Please post whatever you [have|are willing to share].

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]


Tue Jun 03, 2008 11:08 pm
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 39 posts ]  Go to page 1, 2, 3  Next

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.