Pages: [1]   Go Down
Author Topic: Vex Optical Shaft Encoders  (Read 1554 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well, I've got all my Vex sensors and motors running flawlessly .... except the Optical Shaft Encoders. I think the stumbling block is simply that I'm not really sure how they are designed to operate.

I've read online about other rotary encoders but they seem to have some sort of internal counter whereas I don't believe the Vex model is that sophisticated.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33358
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

So provide a link to the sensor you are using, post a diagram of how you have wired it up and post the code of how you are trying to read them saying what it does and what you would expect it to do.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

http://www.vexrobotics.com/276-2156.html

The wiring seems trivial enough.
 
- Red to +5V
- Black to ground
- White to a digital port configured as Input.

As for the code I haven't the foggiest idea where to start as I don't clearly understand how the device is intended to operate.

Logged

0
Offline Offline
Shannon Member
****
Karma: 200
Posts: 11672
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Look at the inventors guide on their website for the encoder - explains how it works...
Logged

[ I won't respond to messages, use the forum please ]

Offline Offline
Newbie
*
Karma: 0
Posts: 21
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Arg!. Thanks. I missed the link.

It appears as if I have to constantly monitor the ports I attach it two and based on counting the pulses, calculate the distance, speed and direction traveled.

Yuck! I guess I was hoping that there was a more elegant way of using it than constantly monitoring a port every time through the loop.
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 602
Posts: 33358
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You can use interrupts generated by the signals. There are examples in the playground.
Logged

Pages: [1]   Go Up
Jump to: