programming help!!! SOMEBODY plz
HI, I have been working on what i thought would be a fairly easy project for some time now. However, i now find myself with a BS2 and a entire list of strange alien commands. Basically, I need help writing the script for my chip.
The purpose of my project is to mod an xbox controller to do a particullar rythem of buttons, with the push of ONE newly installed BUTTON. I have all the mechanics worked out. i just need to record the sequence of buttons and there timing then save that info, and program it to perform that sequence onscreen. Like i said all the inputs and outputs work correctly just the timing is off. so i must record myself manually on the controller to get the propper timing down. any help on how i can do this would be much appreciated. thank you.
-avitus
The purpose of my project is to mod an xbox controller to do a particullar rythem of buttons, with the push of ONE newly installed BUTTON. I have all the mechanics worked out. i just need to record the sequence of buttons and there timing then save that info, and program it to perform that sequence onscreen. Like i said all the inputs and outputs work correctly just the timing is off. so i must record myself manually on the controller to get the propper timing down. any help on how i can do this would be much appreciated. thank you.
-avitus
Comments
2. How much time is a sequence of button pushes maximum
3. How many button pushes in a sequence maximum
4. How many button sequences do you want to store
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
Someone would have to do the reverse engineering to determine signal compatability in order to do it yourself.
It is very difficult to jump into a language you don't know for the purpose of completing a dream project without first going through a learning curve.
I have projects that I want to do with the BS2, but I don't know how to program that well. So I am stepping through WAM and Robotics with the BoeBot in order to learn.
If you know some, others can help where you are lacking. If you know nothing, then what you're really asking is for others to do it for you.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
(Frequently heard from other's)
Tommy, I know it wasn't designed to·x, but can you make it·do x·anyway?
·
as for the macro controller it wont do what i am looking to do.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
(Frequently heard from other's)
Tommy, I know it wasn't designed to·x, but can you make it·do x·anyway?
·
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
StampPlot - Graphical Data Acquisition and Control
AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
TO record:
WAit for the input to pressed to record a sequence (in10?) and this will store 8 seconds worth at·100mS intervals approximately.
FOR X = 0 to 80
· WRITE X, INA··· ' store in EEPROM
· OUTB = INA····· ' pass to output now if needed
··PAUSE 100
NEXT
When you are ready to replay, let say you press a button IN11 and·it does this:
FOR X = 0 to 80
· READ·X,OUTB··· '·read from·EEPROM
··PAUSE 100
NEXT
·THe samples at 100mSec are needed to try to reproduce the timing involved and ensure a button press is not mixed.· There's other ways it could be done, but this is a fairly simple method.· Just ensure you program memory is above address 80 or it will be written over.
My keyboard is acting up, think I need a reboot....
-Martin
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Martin Hebel
StampPlot - Graphical Data Acquisition and Control
AppBee -·2.4GHz Wireless Adapters & transceivers·for the BASIC Stamp & Other controllers·
If you post your code it may help others to see where your problem is. Your initial post gives too little information detail for somebody to offer suggestions.
Also, keep in mind that people posting here are very willing to help others, but are generally not willing to do the work for them.
The posts that raise the most red flags, and get the least responses, are those that are 1) post number 1, 2) asking how to do something fairly complex with no solid indication of what has already been accomplished by the poster, and 3) demanding help.
As long as your posts aren't coming across that way, you shouldn't have any trouble getting responses.
Thank you for your help and advise.
I dont mean to sound incompetent, but i am having trouble.
so this is where i am at...
pin11, pin12, pin13 are my inputs
pin0, pin1 are my outputs.
what i am wanting to do is record 2 seperate sequences of inputs and place one on each output.
then be able to play the sequence on the outputs by pushing the buttons i've installed each output.
i know this cant be very difficult. i am just missing something terribly simple im afraid.
I am still tamperring with your code Martin, and thank you again for your advise
can this be stored in the EEPROM or is it to big. and or is there an easier way
HIGH 14
PAUSE 100
LOW 14
PAUSE 400
HIGH 12
PAUSE 100
LOW 12
PAUSE 100
HIGH 14
PAUSE 100
LOW 14
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
when you say..
"TO record:
WAit for the input to pressed to record a sequence (in10?) and this will store 8 seconds worth at 100mS intervals approximately."
(what do you mean by "in10?"?)
FOR X = 0 to 80
also, why am i getting an "expect a variable" error?
do i need to replace X? and with what? so far nothing works
By IN10, I mean some button on P10 acting as input you are using to signal when to start recording your sequence.
X needs to be defined previously
X Var Byte.
I gave only some snippits since most BS2 programmers understand the fundementals.
-Martin
No, this isn't a terribly hard project, but that depends on your level. It does require some higher level understanding, but again, the burden need to be on the poster to grasp as much as they can without asking a responder to write the program for them. Using variables is one of the most basic things you need to be able to do. I really recommend working your way though "WHat's a Microcontroller".
-Martin
I will keep you posted on my progress
thnk you in advance
There has been some other discussion about using a Stamp with Xbox devices. Start with something simple like just being able to read the information from an Xbox device, then a separate program that just sends Xbox commands to the Xbox in place of a peripheral device. Process control and robotics (which is where most of Parallax's educational material is oriented) is the same kind of application, just with different devices involved.
Post Edited (Mike Green) : 10/30/2006 6:39:36 PM GMT
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Truly Understand the Fundamentals and the Path will be so much easier...
1. How many buttons are input that you need to record
A. two
2. How much time is a sequence of button pushes maximum
A. 8 Seconds
3. How many button pushes in a sequence maximum
A. Three
4. How many button sequences do you want to store
A. assuming one
If you start recording from the first button press you can record the time between press 1 and release of button 1
Setting up a program to record would look like
Timer=0
Array_pointer=0
Loop:
Wait for either button to be pressed
Loop1: 'Button has been pressed so we wait for it to be released
increment timer
if timer>8000 then set error flag-> and exit 'Assuming approximatly 1 mS for each time through the loop on BS2, may be closer to 4000 as it is 3 instructions
if button is still pressed goto loop1
record button number and time
increment array pointer
if array_pointer is less than 3 then goto Loop ' Get next button press.
Now I would think you would need a start time of the event that causes one to press the first button but you dont have any way to know that so all you have is the three button presses and the time on to the time off.
Button Time on
1 300
2 1000
1 2300
You would then see that time 1 is 300. Time for second button is 1000-300 = 700, and time button 3 is pressed 2300-1000 = 1300
You can also set up a second timer to record the time between the end of press 1 release to start of press 2 and the time between press2 release and press3 start.
that would take 8 bytes to store all the data necessary to play back the same sequence of button presses.
So to trigger the two buttons from the basic stamp you would perhaps use two fets in parallal to the two existing switches, the stamp would then open and close those two fets in the same time pattern as its last recorded input when you press button 3. Course you have to program that part as well.
I should note the BS2 executes about 2 instructions per millisecond so a loop that increments a word variable that has 2 instructions can count to about 1000 per second, If you need more resolution you would need a faster processor but for button presses I think you can at least be in the 2mS resolution range.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Think outside the BOX!
Post Edited (metron9) : 10/30/2006 7:30:25 PM GMT
thank you buddy you along with everyone have been a great help.
HIGH 4
PAUSE 100
LOW 14
PAUSE 400
HIGH 12
PAUSE 100
LOW 12
PAUSE 100
HIGH 14
PAUSE 100
LOW 14