Go to Post Earlier this week it took me a little bit too long to realize that the reason my pen wasn't writing correctly was that it was actually a screwdriver. I'm going to have to ask for a few nights of honest sleep before signing off on a report. - EricVanWyk [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 03-02-2007, 16:07
RyanW RyanW is offline
Registered User
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: MD
Posts: 40
RyanW has a spectacular aura aboutRyanW has a spectacular aura about
Interrupts with CMUCam

For our robot, we want to use a quadrature encoder so that we can move our manipulator to preset heights on the arm. I read the "Quadratuer Encoders" white paper, and modified the example code to work with one interrupt.
This works fine with the default code, but I noticed that on Kevin's CMUCam code, the use of serial_ports means that user_Serialdrv.c and user_Serialdrv.h must be deleted. Where, then, do I put the interrupt code, and how do I hook the encoder up to the robot controller? I read through serial_ports.c, but I didn't really see a place for an interrupt handler where I could add the encoder code...
  #2   Spotlight this post!  
Unread 03-02-2007, 17:26
lukevanoort lukevanoort is offline
in between teams
AKA: Luke Van Oort
no team
 
Join Date: Oct 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 1,873
lukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond repute
Send a message via AIM to lukevanoort
Re: Interrupts with CMUCam

Look at Kevin's encoder code. It supports 8 interrupts for quadrature encoders, and is easily integrated with his camera code.
__________________
Team 1219: 2009 - Mentor
Team 587: 2005 - Animator, 2006-2008 - Team Captain
  #3   Spotlight this post!  
Unread 05-02-2007, 15:25
RyanW RyanW is offline
Registered User
FRC #0449 (Blair Robot Project)
Team Role: Programmer
 
Join Date: Feb 2007
Rookie Year: 2007
Location: MD
Posts: 40
RyanW has a spectacular aura aboutRyanW has a spectacular aura about
Re: Interrupts with CMUCam

Thank you! This is my first year programming in C, which still makes me one of the senior programmers this year...we're not exactly a rookie team, but a few years ago we lost everyone who knew what they were doing.

The encoders work fine now, and plugging in the camera doesn't give me a code error any more! Now if I could only get the camera to work...
  #4   Spotlight this post!  
Unread 05-02-2007, 16:08
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,186
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: Interrupts with CMUCam

Quote:
Originally Posted by RyanW View Post
Thank you! This is my first year programming in C, which still makes me one of the senior programmers this year...we're not exactly a rookie team, but a few years ago we lost everyone who knew what they were doing.

The encoders work fine now, and plugging in the camera doesn't give me a code error any more! Now if I could only get the camera to work...
You might want to try using EasyC. When you program using EasyC, you're actually just creating code that runs with the FRC library that team 190 wrote, WPILib. WPILib is very good at setting these kinds of things up, and you can set up the camera and encoders in just a few lines of code.

If you dont like using EasyC and would rather code by hand, you can download WPILib here and use it as you wish..
http://users.wpi.edu/~bamiller/WPILib/
  #5   Spotlight this post!  
Unread 08-02-2007, 14:46
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Interrupts with CMUCam

I thought the RC only has 6 interrupts. Where are the other 2?
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
  #6   Spotlight this post!  
Unread 08-02-2007, 15:34
lukevanoort lukevanoort is offline
in between teams
AKA: Luke Van Oort
no team
 
Join Date: Oct 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 1,873
lukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond reputelukevanoort has a reputation beyond repute
Send a message via AIM to lukevanoort
Re: Interrupts with CMUCam

Quote:
Originally Posted by Kingofl337 View Post
I thought the RC only has 6 interrupts. Where are the other 2?
That was a typo, six is correct.
__________________
Team 1219: 2009 - Mentor
Team 587: 2005 - Animator, 2006-2008 - Team Captain
  #7   Spotlight this post!  
Unread 08-02-2007, 23:32
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Interrupts with CMUCam

Oh good, I'm not going crazy. I was expecting something like, oh well if you use the relay ports and you change this and that boom 2 more.


Game On!
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading an encoder with interrupts GlennGraham FIRST Tech Challenge 4 25-08-2006 12:44
CMUcam Related Interrupts phrontist Programming 1 31-01-2006 23:01
Help with pots/interrupts mtrawls Programming 10 24-02-2004 17:01
help with Interrupts thoughtful Programming 5 08-01-2004 16:07
Problem with interrupts on the PIC Mike Betts Programming 7 16-12-2003 21:26


All times are GMT -5. The time now is 04:00.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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