servo help
Sigma X
Posts: 38
Hi I'm in need of some help I'm currently working on a project
it's really simple i'm tring to control servos via push buttons and or pressure sensors
for example: they're 4 buttons in all one is a device button (4) the operation is simple
when button 1 is pressed servo 1 runs clockwise when released it runs counterclockwise
same for button 2 and 3
but for button 4 to work either button 1,2,or3 must be pressed
any and all help will be apperciated
sorry for poor grammer it is pretty late
it's really simple i'm tring to control servos via push buttons and or pressure sensors
for example: they're 4 buttons in all one is a device button (4) the operation is simple
when button 1 is pressed servo 1 runs clockwise when released it runs counterclockwise
same for button 2 and 3
but for button 4 to work either button 1,2,or3 must be pressed
any and all help will be apperciated
sorry for poor grammer it is pretty late
Comments
You can ask as many questions as you like here.
All members are willing to help. How fast the help helps depends
on the amount of information you give in.
From what you describe this could be a hardware-problem
push-buttons wired in a strange way or a software-problem
Without providing your code that you have so far
forum-members would have to code a whole new program to help you.
It will be much faster if you attach your code to a posting that you have so far. That experienced programmers can take a look inside your code.
And you will learn much more on that way than copy and paste a working solution.
look at the attached picture how your COMPLETE code can be attached to a posting by a few mouse-clicks
Further on I would like to comment on your posting-style:
It seems to be a very quick written posting. My personal experience is:
If you want the things to go superfast it turns out to be superslow.
You posted a little information and now it takes a posting back and forwards to add information that was left out in the first posting.
So the saving of 15 minutes to find out how to attach propeller code and
write a few sentences more turned out to waste several hours until the forum can help you
best regards
Stefan
I didn't have a schematic,(just a flow chart) I was just mainly asking for advice and tips to get started Mike Green helped there. I'll post what I have once I get started.
I was also wondering if it is possible to use MPLAB to program the propeller?
or use the .ASM language rather than spin to program? I thought I seen it done before, but I feel better to ask. If so how can it be done?
the Servo32-object itself is written in assembler but has a interface to
SPIN. For reading buttons SPIN is fast enough. Assembler is only needed if have high speed-requirements. If you are new to programming I recommend
to learn SPIN first. I think SPIN is easier than assembler.
So the next step is that you write a small piece of code yourself
and play around with it. And then come back with questions.
As far as I see it if you have concrete questions about a few lines of code
you will get an answer quickly.
best regards
Stefan
You can't use MATLAB to program the Propeller
Stefan:
Thanks! Although I am not the poster, you just showed me something I didn't know! I will (I am sure) be starting to code my project very soon and I would have made forum postings the hard (wrong) way. I wasn't aware of the archive feature in the "tool".
I love this forum!! :idea:
Mike B.
Second, you're setting ServoPos from two cogs and there's no way to tell which cog is going to get to it first. Probably the main cog will get to it since it takes about 100us to start up a new cog, but I don't know how long the 3202 method takes to execute. It's best to arrange things so that only one cog sets a variable, then one or more other cogs reads it. There are other ways for two cogs to communicate that don't require locks (semaphores), but you can use locks if you want.
I'll post the new code soon
and it is but I have one problem the propeller isn't recieving the configuration
it open the port but could not recieve config does any one have any tips?
same as always: please provide a DETAILED description of what you have tried so far
which propeller-board?
what kind of power-supply?
what kind of serial connection?
what did you do install in which sequence?
what is the EXACT message that you do receive?
best regards
Stefan
9v battery
usb connection
I installed 12 blocks trial to experiment around before I buy
the error messages is:
Cannot connect to Propeller
DETAIL
Unable to recieve configuration
Timed Out
COM:3 opened port, but could not recieve configuration
TIP
Verfy that your device is well connected and has a good power supply (checked)
Verfy that your your program's clock settings match your hardware (checked at 5 Mhz)
Verfy that your vp. share at the start of your program (???)
1) The Propeller is not powered or not adequately powered. The Propeller must be working. It doesn't need the crystal for downloading.
2) There's something wrong with the serial connection. Most commonly you might be using a USB to serial adapter that doesn't properly implement the control lines like DTR. Most adapters that use the FTDI chips work. You have to have the manufacturer's driver installed. The default Windows driver doesn't work for downloading.
Massimo
but what I can do is get the code on 12blocks and run them in the tool which works fine
but I have no schematic of the demo board to know which pins do what
and I must say the results are quite good I just may order 12 blocks it's simple quick and easy to program although more blocks are needed to give the user more to work with this is still a amazing program