my first picaxe project help

Heya, i am new to picaxe programing, well ive done a bit at school but just the very basics like high 1 and low 1 and pause. Thats about all i know. i am trying to make my xbox 360 wireless controller rapid fire i have already make it rapidfire before on the bread board with the 555 timer chip and a couple of ressistor and capasitors but this was no way near and as good as what i have heard you can do with picaxe.

i am making three different modes for my rapid fire: slow fast and 3 bullet burst. for each one of theese modes a led will light up on the controller. The switch im going to use to change between the modes is a push to make switch (like a doorbell switch) what i need to know is how would i write a code for the modes.

I hear it was mode 1: but i dont know lol.
is it someting onlong the lines of if button = 1 then go to mode 1
If button = 2 then go to mode 2 and so on?
i want it to switch between modes each time the button is pressed pressed one mode 1, pressed again mode 2, pressed again mode 3, pressed again off.

thank you for all of your help :)

ps. i know i can just buy a chip off ebay for like a £10 but i want to achieve something by myself and learn a buit on the way. thanks =]
 

Andrew Cowan

Senior Member
Hi David - welcome to the forum.

i know i can just buy a chip off ebay for like a £10 but i want to achieve something by myself and learn a buit on the way. thanks =]
That's a great attitude to have - you'll have more fun with that attitude. The forum is good if you get stuck, but don't expect us to do all the work.

Most of the time the chip will have to cycle through a loop, checking for the button presses.
Code:
main:
if pin1=1 then mode1
if pin2=1 then mode2
if pin3=1 then mode3
goto main
You will then have to write a bit of code for each mode. This will just use high, low and pause commands. Eg:
Code:
mode1:
high 1     'LED on
hgh 2     'Trigger pressed
pause 80     'wait 80mS
low 2     'Trigger unpressed
pause 80    'wait 80mS
low 1     'LED off
goto main   'repeat
Have a read of manual 2 to see what these commands do and how to use them.

A
 

westaust55

Moderator
As well as searching this PICAXE forum as suggested by eclectic,

have a search on Google.

First search on XBOX, and then using the selector at the bottom to search within the results for PICAXE. Only 3410 entires to look throught.
 
Top