number of sensor ports

As everyone becomes better at using sensors, we tend to use them for everything we can. Does anyone have tips to make the most efficient use of interrupt ports on the cortex microcontroller?

this is because we are planning to use multiple ultrasonic range sensors which have 2 wires (6 of them…) plus multiple limit and shaft encoders

is this for the autonomous challenge?
the 20 secs?
or even some in drivers control?
would you mind to share some of your “scripts”?

such as “detect if theres a tube in front and auto grab”, ect
thanks

hi

we are wanting to use this many ultrasonics to keep parrallel with walls, as if there is two each side you can be parrallel rather than just a certain distance away. as of now we dont have any scripts sorry :(.

We were just wondering how we get around the limit on ports as the mojority of sensor use the same type and as far as we know, we cant change them on the cortex like you can on PIC

I have run into similar issues with not having as many ports as I’d like. If you are using the cortex micro controller you have 12 digital/interrupt ports. I believe that there is really no way to get around this. I guess that means that you have to figure out which sensors are the most important.

There are ways to make those 12 ports go farther though.
-All of your limit and bumper switches can be used on analog ports.
-You can always plug only one of the two encoder wires in and use a quad encoder as if it were a normal one (of course it won’t give you directional information anymore).
-If you have multiple pneumatic pistons controlling the same mechanism, you can “Y” all the pistons into one solenoid.
-You may also want to implement analog sensors such as line trackers to help navigate the robot which may decrease the number of other sensors you need.

Thanks for your help Titan! we didnt realise that we could use our jumper and bumper switches in analog ports so now we can use jumper clips to change between autonomous like we had planned but thought we didnt have enough ports :). unfortunately we were already plugging only 1 encoder wire in and we have 3 of them, so we can only use 4 ultrasonic sensors :frowning:

may it be possible for the output cable to be connected together with other outputs? for example, for one bank of ultrasonics, have the two ultrasonics output cables y-ed and have the inputs separate?

I actually tried this a few months ago. Unfortunately it did not work.

I’d recommend using a single pot to change between modes, just have fixed (or marked) positions that you turn it to for each mode. its much easier, and should free up some ports.

Using only eight digital inputs/outputs you can scan up to sixteen VEX bumper switches or VEX limit switches. You can also scan a standard 4 X 4 numeric keypad to enter numeric data into the VEX Microcontroller. This leaves you six interrupt inputs and eight digital input/outputs for other purposes.

I agree with using a pot to control the modes because it is so efficiant. If that is not an option, you can use two limit switches. Click the starter switch, then click the second switch a certain number of times, and then click the starter switch to record that number. For example, if I wanted to execute autonomous mode number 4, I would click the starter switch, click the second switch 4 times, and click the starter switch again. I can provide code samples if you want.

This year I will be using an LCD screen to select between autonomous codes. I like it a lot because it doesn’t use any sensor ports and you can confirm which autonomous code will run by having it conveniently printed on the screen. I had to modify a Vex “Y” cable in order to use it on a UART port on the cortex controller.

Is this (modifying the Y cable) legal for VRC? That would be cool if it was…

The cable to connect the LCD to the Cortex is now available as a product:

http://www.vexrobotics.com/products/accessories/logic/276-1579.html