Answers.Body: <p>Your code handling the behaviours like "Shoot 3 times if the touch sensor is triggered" or "Shoot if the light sensor is triggered" should use 'if' statements.</p>
  
  <p><img src="https://i.sstatic.net/naANh.jpg" alt="enter image description here"></p>
  
  <p>Then, instead of always being called, the "shooting" code would append only on sensor events.  After shooting, the robot would then go back to the "Driving around" part of the code.</p>
  
  <p><a href="http://llk.media.mit.edu/projects/cricket/doc/help/logoblocks/ref-rcx.html" rel="nofollow noreferrer">This page</a> is a good visual reference for all the RCX programming components</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-12-18T14:30:00.100Z
Answers.Text: @ewelina does this help in any way?
Answers.UserDisplayName: pcantin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2012-12-14T13:21:57.533Z
Answers.LastActivityDate: 2012-12-14T13:21:57.533Z
Answers.UserDisplayName: pcantin
Body: <p>I just build the RCX Gunner Bot using the instructions from <a href="http://www.legomylegobot.com/lego%20nxt%20rcx%20projects_007.htm" rel="nofollow">this</a> web site.</p>
  
  <p>I had to build something different to the one we built in the class, I added a touch sensor and light sensor, so the bot will avoid any obstacles on its way, and shoot when it sees a black dot. </p>
  
  <p>I am wondering if anyone has a program for a basic gunner bot, or at least for shooting the bullets. If somebody can help me, It would really appreciated.
  I am not an engineering person but I need to pass that class.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2012-12-10T19:22:42.143Z
Comments.Text: Are you setup to use NQC?
Comments.UserDisplayName: pcantin
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2012-12-10T19:24:30.377Z
Comments.Text: no, I have to use RCX Code
Comments.UserDisplayName: Ewelina
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2012-12-11T16:20:54.637Z
Comments.Text: Please state clearly what problems you have as well as what you have tried.
Comments.UserDisplayName: Ambo100
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2012-12-12T02:59:33.293Z
Comments.Text: I used: ON motor B then Set Direction Bv then Set Power B(8) and the bot is shooting but non stop. How to make it drive then shoot two times if it hits something or shoot if it sees a black spot?
Comments.UserDisplayName: Ewelina
Tags: <programming><rcx>
Title: Gunner bot programing
UserDisplayName: Ewelina
ThreadText: # Gunner bot programing
  
  (Asked by: username_0 on 2012-12-10)
  
  I just build the RCX Gunner Bot using the instructions from [this](http://www.legomylegobot.com/lego%20nxt%20rcx%20projects_007.htm) web site.
  
  I had to build something different to the one we built in the class, I added a touch sensor and light sensor, so the bot will avoid any obstacles on its way, and shoot when it sees a black dot.
  
  I am wondering if anyone has a program for a basic gunner bot, or at least for shooting the bullets. If somebody can help me, It would really appreciated.
  I am not an engineering person but I need to pass that class.
  
  **Tags:** programming, rcx
  
  > **Comments:**
  > **username_1**: Are you setup to use NQC?  
  > **username_0**: no, I have to use RCX Code  
  > **username_2**: Please state clearly what problems you have as well as what you have tried.  
  > **username_0**: I used: ON motor B then Set Direction Bv then Set Power B(8) and the bot is shooting but non stop. How to make it drive then shoot two times if it hits something or shoot if it sees a black spot?  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2012-12-14. Score: 6
  
  Your code handling the behaviours like "Shoot 3 times if the touch sensor is triggered" or "Shoot if the light sensor is triggered" should use 'if' statements.
  
  ![enter image description here](https://i.sstatic.net/naANh.jpg)
  
  Then, instead of always being called, the "shooting" code would append only on sensor events. After shooting, the robot would then go back to the "Driving around" part of the code.
  
  [This page](http://llk.media.mit.edu/projects/cricket/doc/help/logoblocks/ref-rcx.html) is a good visual reference for all the RCX programming components
  
  > **Comments:**
  > **username_1**: @username_0 does this help in any way?  
  
  ---
  
  