Thread: Problem coding Banner sensor interrupt...

  1. #1
    Registered User
    Join Date
    Feb 2005
    Posts
    1

    Question Problem coding Banner sensor interrupt...

    We are trying to program a banner sensor interrupt in C. There are three possible positions(numbered 1, 2 &3) for the banner sensor to see and two directions that it can travel (forward and reverse). We have no problem with the sensor seeing the targets. Our problem comes when we stop between target 1 & 2 or between target 2 & 3 and then reverse direction. The program seems to get confused as to where it is and what the count is so that if it stops between target 2 & 3and reverses direction it thinks it sees target number 3 when it is actually seeing target number 2.

    I am certain we are missing something simple. Can anyone help??

  2. #2
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    So do you get either of
    - the current direction of travel
    - the ID of the target being detected
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. WS_POPUP, continuation of old problem
    By blurrymadness in forum Windows Programming
    Replies: 1
    Last Post: 04-20-2007, 06:54 PM
  2. Laptop Problem
    By Boomba in forum Tech Board
    Replies: 1
    Last Post: 03-07-2006, 06:24 PM
  3. Replies: 16
    Last Post: 01-26-2006, 02:38 PM
  4. Replies: 5
    Last Post: 11-07-2005, 11:34 PM
  5. half ADT (nested struct) problem...
    By CyC|OpS in forum C Programming
    Replies: 1
    Last Post: 10-26-2002, 08:37 AM