non standard devices

Does anyone have a tutorial on how to connect home made or non-VEX sensors/devices to the cortex and program with them?

Well for most simple stuff you just plug them into analog or digital ports and make them digital or analog input.

Out of curiosity do you need help with something specific?

That is what I was thinking. I would like to use a thermistor and I was thinking I could connect it like the potentiometer.

Ya it is going to be pretty much the same as a potentiometer.

Look into SPI, I2C, UART and just plain old digital I/O. I recommend this book if you feel like you need something tangible.

Sparkfun has some great guides online.

Well cortex couldn’t do Spi. But pretty much everything else you can get working with a cortex.

That’s right the SPI interface is used internally.


It can, sort of, you will need to use bit-banging.

As the big thing to keep in mind, the cortex is 5v! So don’t go plugging all ya’ll 3.3v sensors into it :slight_smile: Unless you like fried chips (or are willing to take that risk, at least). Take a look at the cortex PINOUT to make sure you aren’t shorting pins (like IDK, 5v and GND) and make sure you read the datasheet for the sensor your are plugging in to figure out what you are expecting to receive from it - as chances are that RobotC (or any other programming solution) hasn’t already done the heavy lifting for you and you will have to interpret and deal with the data in your own program.

Cortex Page.
Cortex PINOUT.

Of course. But running that in a ROBOTC task as opposed to a lower level is going to be pretty painfully slow.

Toggling a digital output takes about 3uS in ROBOTC, with other logic perhaps you could handle a bit every 10uS. So about 100 bits (12 bytes) in 1mS. Plenty fast enough for a simple sensor. Obviously you could do this much more efficiently in ConVEX or PROS, here’s a link to an example using a line array camera (if you can call it that) that I did a few years ago (not SPI but the concept is the same)