View unanswered posts | View active topics It is currently Tue Jul 29, 2014 8:47 am






Reply to topic  [ 5 posts ] 
sensorDigitalIn weird values 
Author Message
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3164
Location: Rotterdam, The Netherlands
Post sensorDigitalIn weird values
Hey guys,

I am trying to write some code to make the NXTCam work on the VEX Cortex by bit-banging I2C. I can see perfectly fine I2C messages being sent back and forth (using a protocol analyser), only the firmware is not really digging it.
Code:
int READSDA() {
  SensorType[SDATA] = sensorDigitalIn;
  wait1Msec(1);
  int val = SensorValue[SDATA];
  writeDebugStreamLine("sdata: %d", val);
  return val;
}

This keeps spitting out values between 245 and 246. Is there a reason this would be anything other than 0 or 1, seeing as it's a digital in? SDA has pull-ups that should pull it to +5V when it is set to sensorDigitalIn. I have also tried increasing the wait time, nothing makes a difference.
I've tried this with both a HT Colour Sensor V2 and the NXTCam V3, both give me the similar results.
I am using ROBOTC 3.13b.

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


Fri Jun 29, 2012 3:27 pm
Profile WWW
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 556
Post Re: sensorDigitalIn weird values
Hey Xander,

Sorry for the long wait on the response; have you checked your flux capacitor values on the NXTCam? :) But in all seriousness, I'm guessing this is probably an issue with the 3.13 build (betas are fun), I'll make sure Tim and some of the more code-savvy members get a look at this and get it taken care of.

Thanks for the heads up, and if you come across any other issues please let us know!

John

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Fri Jul 06, 2012 11:11 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3164
Location: Rotterdam, The Netherlands
Post Re: sensorDigitalIn weird values
Quote:
Sorry for the long wait on the response; have you checked your flux capacitor values on the NXTCam?

Yes, I even tried switching it off and back on, no dice, I'm still stuck 2012.

Quote:
But in all seriousness, I'm guessing this is probably an issue with the 3.13 build (betas are fun), I'll make sure Tim and some of the more code-savvy members get a look at this and get it taken care of.

I'll wait for a new build, I hope Dick recovers from the last compiler bomb I sent him :)

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


Fri Jul 06, 2012 12:03 pm
Profile WWW
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 556
Post Re: sensorDigitalIn weird values
"Compiler bomb". I like that term so much, I may just steal it from you and start using it in my everyday speech. :)

_________________
Check out our Blog! And our Facebook page!
Need help? Take a look at our Wiki and our Forums.

I just met you,
And this is crazy,
But here's my code now,
So fix it, maybe?
~ Carly Rae Jepsen parody


Fri Jul 06, 2012 1:05 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3164
Location: Rotterdam, The Netherlands
Post Re: sensorDigitalIn weird values
My driver suite is the real reason Dick's hair has been thinning out!

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


Fri Jul 06, 2012 2:02 pm
Profile WWW
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.