Controlsystem for compact sporting (clay shooting)


Closed Thread
Results 1 to 12 of 12

Hybrid View

  1. #1
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187

    Default Controlsystem for compact sporting (clay shooting)

    Hi

    Iīm trying to to make a control system for 8 clay throwers for compact sporting.

    This is how a compact sporting place can look like.


    Exampel taken from this PDF http://www.fitasc.com/public/regleme...g230908_UK.pdf
    (We do not shoot whit 6 shooters as in the example)




    4.4 Shooting sequence for a round
    Shooters position (See Annex 3):
    The shooters in the squad go to on the stands in the order set out on the score sheet.
    The shooter waits behind stand # 1, is ready to take the shooter’s place, once the
    shooter at stand 5 has finished shooting the clays on his/her menu.
    The shotgun position is free at the time of calling for the target (at the shoulder or
    not).
    All the targets must be fired at with the gun at the shoulder.
    The shooters fire in turns at each single and double target in the order on the menu.
    A time lapse of 10 seconds at most is allowed for each shooter to call for his target
    or targets after the shooter at the previous stand has finished firing.
    The Referee must announce to the shooter at the station # 1 when it has to shoot.
    When the shooter at stand # 5 has finished firing at the targets on his menu:
    • He moves to stand # 1 and waits behind it
    • The other shooters move to the next stand on their right
    • The shooter who was waiting previously takes his place on stand # 1.
    It is always the shooter on stand # 1 who starts the round of five targets
    The control system I want to make is a box with 2 buttons THROW and REVERSE.
    Now we have a big box whit 8 buttons for each thrower and manual push the different combinations for each stand, I want to make this by steep throw a program whit just one button.

    I tried to make this whit 20 loops and wait for the throw button to be pressed and just jump to the next loop or back to the previous loop if REVERSE button what pressed.

    This works for 5 shooters but I also want to tell the program if the number of shooters for example is only 1, 2, 3, or 4, I will store number of shooters in a variable that is set by the user via a LCD before the game starts (1 to 5 shooters)

    If three shooters they will start on stand 1, 2, 3 and after the menu move to 2, 3 and 4 and then to 3, 4, 5 and then to 4, 5, 1 and that last shooting on stand 5, 1, 2.

    How do i do that, should I still use 20 different loops and write a lot of IF THEN ELSE within them to decide witch loop that should be the next to jump to?

    Or how do I do it in a good way?

    My English is not perfect so I hope you understand what I trying to do here.

  2. #2
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    If three shooters they will start on stand 1, 2, 3 and after the menu move to 2, 3 and 4 and then to 3, 4, 5 and then to 4, 5, 1 and that last shooting on stand 5, 1, 2.
    Do I understand correctly . . . You want to DeSelect the unused stands from automatically throwing the clay? So you would throw in sequence 123, 234, 345, 451, 512 for 3 shooters . . . 1234, 2345, 3451, 4512, 5123 for four shooters . . . ? You should be able to do that using an array and shift the bits over.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  3. #3
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    Yes thatīs correct.
    How do i do an Array and shift bits, do you have an short example?

  4. #4
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Fredrick View Post
    Yes thatīs correct.
    How do i do an Array and shift bits, do you have an short example?
    Got 1 ready now, incomplete but it serves as example, change the shooters var to change lights lit
    Code:
    @MyConfig = _INTRC_OSC_NOCLKOUT & _WDT_OFF & _PWRTE_ON  
    @MyConfig = MyConfig & _MCLRE_ON & _BOR_OFF 
    @ __config  MyConfig 
    include "modedefs.bas"
    DEFINE OSC 4
    PortA = 0
    PortB = 0
    PortC = 0
    TRISA = 1
    TRISB = 0
    TRISC = %00000000
    i var word 'locks up @ 255 with byte
    ANSEL = 0
    ANSELH = 0
    CM1CON0 = 0
    CM2CON0 = 0
    shooters var byte
    total var byte
    serout PortA.2,t9600,["enter shooters"]
    ' too lazy to do input routine
    shooters = 2
    
    lookup shooters -1,[1,3,7,15,31],total
    main:
    portc = 0
    'pause 200
    for i = total  to 255
    portC = i
    i=i  << 1-1
    pause 500
    next i
    i=0
    portC = i
    pause 500
    
    goto main
    end
    not a typical array as we normally see them, but it works using pickit2 & lowpin demo board
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

  5. #5
    Join Date
    Jan 2008
    Location
    Sweden
    Posts
    187


    Did you find this post helpful? Yes | No

    Default

    Sorry... but I donīt understand how to do the program with the lookup function.

    Where comes the numbers [1,3,7,15,31] from and what does it do?

    How to i use the lookup to point the program to the right loop that contains the right clay combination?

  6. #6
    Join Date
    Aug 2006
    Location
    Look, behind you.
    Posts
    2,818


    Did you find this post helpful? Yes | No

    Default

    Quote Originally Posted by Fredrick View Post
    Sorry... but I donīt understand how to do the program with the lookup function.

    Where comes the numbers [1,3,7,15,31] from and what does it do?

    How to i use the lookup to point the program to the right loop that contains the right clay combination?
    What does it do . . . It tells your program how many shooters are there, from the input I was too lazy to code for you. You get that input from a key routine or waste 5 ports as inputs, either way you answer the question, how many shooters. I answered it by coding shooters = 2, you I expect will want to select 1 to 5 at will.
    The numbers in the lookup table are decimal representations of their binary equivalent. Think of PortC as a 8 digit binary display, 1 would light just bit 0, 3 would light bits.0:1, 7 lights bits 1:3 . . . I urge you to try this code snippet and alter the numbers and see what it does. The lookup table just makes the counter count read differently, when it sees 1 it reports 1, 2 it reports 3, 3 it reports 7 . . . in binary. The -1 in the lookup just makes 0 invalid as you would never have 0 shooters.
    Last edited by Archangel; - 27th July 2009 at 07:47.
    If you do not believe in MAGIC, Consider how currency has value simply by printing it, and is then traded for real assets.
    .
    Gold is the money of kings, silver is the money of gentlemen, barter is the money of peasants - but debt is the money of slaves
    .
    There simply is no "Happy Spam" If you do it you will disappear from this forum.

Members who have read this thread : 1

You do not have permission to view the list of names.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts