ROBOTC.net forums
http://robotc.net/forums/

sensorDigitalIn weird values
http://robotc.net/forums/viewtopic.php?f=11&t=4659
Page 1 of 1

Author:  mightor [ Fri Jun 29, 2012 3:27 pm ]
Post subject:  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

Author:  JohnWatson [ Fri Jul 06, 2012 11:11 am ]
Post subject:  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

Author:  mightor [ Fri Jul 06, 2012 12:03 pm ]
Post subject:  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

Author:  JohnWatson [ Fri Jul 06, 2012 1:05 pm ]
Post subject:  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. :)

Author:  mightor [ Fri Jul 06, 2012 2:02 pm ]
Post subject:  Re: sensorDigitalIn weird values

My driver suite is the real reason Dick's hair has been thinning out!

- Xander

Page 1 of 1 All times are UTC - 5 hours [ DST ]
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/