View unanswered posts | View active topics It is currently Wed Jul 23, 2014 11:45 am






Reply to topic  [ 9 posts ] 
Programming with sensors 
Author Message
Rookie

Joined: Sat Oct 13, 2012 6:00 pm
Posts: 5
Post Programming with sensors
i was wondering if it is possible to use non-vex sensors to program with the the cortex microcontroller


Sat Oct 13, 2012 6:02 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Programming with sensors
Yes, it is possible to program for some non-VEX sensors. For analog sensors, you can configure the port as a potentiometer or light sensor. For simple digital sensors, a digital in can be used. For more advanced sensors that require communication, you might be able to use UART,I2C, or, if neither of those work, bit bang things out using digital in and out What sensors were you thinking about using in particular? Perhaps someone here can help you out.

_________________
sudo rm -rf /


Sat Oct 13, 2012 6:14 pm
Profile
Rookie

Joined: Sat Oct 13, 2012 6:00 pm
Posts: 5
Post Re: Programming with sensors
thank you for the response, i was thinking of using the vex optical shaft encoder but there are some concerns with the autonomy with it. if the robot collide with another robot or object the sensor will lose its position and it wouldnt get accurate data. right now im looking at other sensors that could help me with the navigation during the autonomy section


Sat Oct 13, 2012 8:04 pm
Profile
Site Admin
Site Admin

Joined: Thu May 24, 2012 12:15 pm
Posts: 556
Post Re: Programming with sensors
If you are planning to use these components in a competition, I would take another look at the VEX Sack Attack Manual (found here), specifically sections <R5> to <R7>:

Quote:
<R5> Robots may be built ONLY from Official Robot Components from the VEX Robotics Design System unless otherwise specifically noted within these rules.


There may be exceptions to this, though, and I would suggest posting your question (with the specific parts you plan to use) in VEX's Q&A section for an official answer, as it is the only way to know for sure if a part is legal or not.

_________________
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


Mon Oct 15, 2012 4:37 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Programming with sensors
Yep, you can't use your own sensors in the competition unless you're in the college division.

_________________
sudo rm -rf /


Mon Oct 15, 2012 5:35 pm
Profile
Rookie

Joined: Sat Oct 13, 2012 6:00 pm
Posts: 5
Post Re: Programming with sensors
i am in the college division. is there a way to program the ultrasonic sensor to only detect the signal that you emitted? if the opposition is also using an ultrasonic sensor, wouldnt it affects the the unwanted signals.


Tue Oct 30, 2012 10:54 pm
Profile
Moderator
Moderator
User avatar

Joined: Tue Sep 14, 2010 9:19 pm
Posts: 496
Post Re: Programming with sensors
If your rangefinder is operating on the same frequency as that of the opposition's, then yes, the signals can interfere with each other. While there are ultrasoinics that operate at different frequencies, most on the market use 40 kHz. Unfortunately, I don't think that there is any easy way (past the calibration that is already done in the sensor) to differentiate between the echo from your ping, and the ping of another sensor *. What you can do however, is write a filter to weed out the erroneous values. It can be as simple as a low pass filter, or you can work up to something like a kalman filter. Take a look at the Wikipedia page on digital filters to lean more: http://en.wikipedia.org/wiki/Digital_filter

*It's possible to build your own sensor, and modulate a unique output signal over the ping, but that's probably a lot more trouble than it's worth. It would certainly be an interesting project though, and the necessary parts are available online if you with to try.

_________________
sudo rm -rf /


Fri Nov 02, 2012 11:22 pm
Profile
Rookie

Joined: Sat Oct 13, 2012 6:00 pm
Posts: 5
Post Re: Programming with sensors
are there any sample code for the i2c port?


Wed Nov 07, 2012 5:11 pm
Profile
Rookie

Joined: Thu May 31, 2012 4:06 pm
Posts: 22
Location: Pittsburgh, Pa
Post Re: Programming with sensors
I know that this is a bit late, but did you think of using a laser sensor? http://www.pololu.com/catalog/product/136 or http://www.pololu.com/catalog/product/1132. This ultrasound uses 42KHz, https://www.sparkfun.com/products/9491.

_________________
SHARP
Sarah Heinz Advanced Robotics Program

VEX 889A and FIRST 3260

Pittsburgh Champions Aerial Assist 2014
Pittsburgh and Buckeye Finalist Ultimate Ascent 2013
Toss Up Champions and Excellence-Pittsburgh
Toss Up Champions-Northwest Maryland VRC


Thu Nov 22, 2012 7:53 pm
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 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.