Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   GearTooth Sensor Destroying Hopes of Autonomous~!!!!!! (http://www.chiefdelphi.com/forums/showthread.php?t=44428)

Denz 28-02-2006 17:02

Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!
 
My current setup is using a push switch to simulate the gear tooth sensor. I have it hooked up to rc_dig_in11. I have it printing to screen, and when pushed it shows up as 0, otherwise as 1, so looks like the hardware is working. I'm not sure what to do. The counter is still not counting, it just stays at 0. Thanks again for all the help, it is very much appreciated :)!

phrontist 28-02-2006 17:50

Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!
 
Quote:

Originally Posted by Denz
My current setup is using a push switch to simulate the gear tooth sensor. I have it hooked up to rc_dig_in11. I have it printing to screen, and when pushed it shows up as 0, otherwise as 1, so looks like the hardware is working. I'm not sure what to do. The counter is still not counting, it just stays at 0. Thanks again for all the help, it is very much appreciated :)!

You mean a mechanical switch?! That won't last long... but if you've got a lot of spares. :D

Denz 28-02-2006 18:11

Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!
 
Quote:

Originally Posted by phrontist
You mean a mechanical switch?! That won't last long... but if you've got a lot of spares. :D

It's only for testing purposes, since our robot is shipped, I only have a RC and an OI, so I have to make good use of it.

Alan Anderson 28-02-2006 18:33

Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!
 
Quote:

Originally Posted by Denz
My current setup is using a push switch to simulate the gear tooth sensor. I have it hooked up to rc_dig_in11.

Sigh.

As I explained yesterday morning, if you want to trigger the encoder interrupt when the switch changes state, you have to put it on digital input 1.

Denz 28-02-2006 18:38

Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!
 
Quote:

Originally Posted by Alan Anderson
Sigh.

As I explained yesterday morning, if you want to trigger the encoder interrupt when the switch changes state, you have to put it on digital input 1.

I will try that. Sorry, I remember seeing that now, however in Kevin's default code it was assigned to rc_dig_in11.

EDIT: YOU GUYS ARE WONDERFUL! I'm so happy it worked!!! THANKS!

Alan Anderson 28-02-2006 18:53

Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!
 
Quote:

Originally Posted by Denz
I will try that. Sorry, I remember seeing that now, however in Kevin's default code it was assigned to rc_dig_in11.

You misunderstood the part of the code that deals with configuring quadrature encoders.

Phase A of encoder 1 has always been documented as rc_dig_in_01, and phase A of encoder 2 has always been documented as rc_dig_in_02. The "B" phases for a quadrature encoder can be connected to any other digital inputs, but there is no phase B on a gear tooth sensor, which is why that part of the interrupt code is simply removed to handle a GTS.

Digital input 1 on the RC goes to one hardware interrupt on the PIC. Digital input 2 on the RC goes to another hardware interrupt. Changes on digital inputs 3-6 can be configured to cause a third hardware interrupt. If you want to use interrupts, you must use the input pins that support interrupts. (Now why am I suddenly having deja vu?)

Congratulations on getting it to work.

Denz 28-02-2006 19:07

Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!
 
Well, I guess you learn something new everyday (or maybe sometimes it takes a couple of days to understand it) but anyways, this is my first year programming anything, and I was in charge or programming the robot. I had alot on my plate I guess so I'm sorry if some of my questions seemed stupid. I really appreciate all the help, our team didn't have any mentors who knew programming, so I'm really glad I could find an e-mentor! Thanks again, now I just have to finish the rest of the autonomous before Rochester!


All times are GMT -5. The time now is 12:50.

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi