For a beginner, the best system to choose is the one there's the most user support for-- and that's the Arduino. They have their own discussion forums, where you'll find all the help you could possibly need.
Check out the Halloween-L group on Facebook. You’ll find many projects animating skeletons or other props using an Arduino and RC servos.Honestly not well experienced in C+ basic but I’m learning more all the time by reading and experimenting with different commandS
Any single core processor that you pick is only going to be able to do "one thing at a time". The thing is that it can do so many things one thing at a time, that on timescales within our perception it looks like they are happening simultaneously.
We have a reaction time to a visual stimulus on the order of 0.25 seconds.
In that 0.25 seconds, an ATmega328 running with a 16 MHz. clock can execute 4,000,000 instructions because each "one thing at a time" instruction takes only 62.5 nanoseconds. I know that you might not be familiar with nanoseconds, but there are one billion of them in one second or 250,000,000 in one quarter of a second. I think it is a pretty big stretch to conclude that an Arduino will have trouble performing what seems like a series of simple choreographed tasks.
If you are still not convinced then, maybe you cold think about doing the servos with one and doing the pneumatics with another. They could even communicate with each other on when certain events are scheduled to happen and finish.
What @Papabravo is saying, is that your concern about "only doing one thing at a time" is misplaced. All microcontrollers (incl this propeller) "only do one thing at a time," and they all do it so blazing fast that it's (for all practical purposes) simultaneous.Ok. makes. What is your opinion on the parallax propeller?
They specifically claim simultaneous multi tasking.
Processor cores: Eight 32-bit cores
You are correct. Now if you can explain what that means to a 5y/o (no offense meant to OP) then please go ahead. Otherwise it only serves make an already overwhelmed newbie even more befuddled.The propeller has
My earlier reply was too brief. I think the Parallax propeller is overkill.Ok. makes. What is your opinion on the parallax propeller?
They specifically claim simultaneous multi tasking.
It’s not even that difficult. He has the Adafruit shield. This is a co-processor dedicated to operating 16 servos simultaneously. A servo is given a command via a library function over I2C and then your sketch goes on its own way while the shield performs servo control. No need to assign any pins for each servo. No need to repeat the PWM servo signal fifty times a second, no need to maintain the control signal. Just command the servo to change positions.I'm not going to try and sell Parallax, as I was an employee there for 10 years and after 10 years quite frankly have a bad taste in my mouth.
However, I will explain the multi core .... Imagine a 1 lane road as a normal processor (once kind of car). Now imagine an 8 core processor as having 8 lanes with the possibility of having 8 unique different cars in each lane. Each car has independent functionality within each car (passengers doing stuff inside of the car... playing games, singing, etc.) but you also have the ability to communicate and share information from one car to the other, i.e blinker, horn, brakes, yelling out the window, etc.
I have been a PIC assembly programmer for nearly 30 years and actually prefer that over anything at the moment, but what your asking for mostly comes down to technique and experience and can be accomplished on any micro controller in just about any language.
Bear with me, I am a little old-school, but I firmly believe in creating a flow chart of what it is that you want to do. Then convert the flowchart into a state machine (or treat it as a state machine from the beginning).
You could stop there, or you can take this a step further. Design each node in your flowchart as a fall-through module meaning that no part of the flow chart will result in an endless loop or delay, instead allow the flow chart to facilitate the advancement of a state machine index when certain conditions are met in each node. In this way you can process the flow chart (state machine) in such a way that you can integrate more state machines.... this only works if the state machine is index based where each additional state machine has it's own independent index counter. Even a step further you can take the index counters into a dispatch mode where each node returns to a common dispatcher that directs the next node to execute but not necessary for this application. Again each level is based on experience.
In your case for example utilize your servo "dead time" ... A servo only requires a position pulse of 1-2 ms every 20ms. During that 20 ms of dead time, you could be doing a bunch of other stuff, where the perception would be simultaneous action. The Servo handler would be one "state machine", and the other stuff would be a second, third, or fourth "state machine", as I briefly mentioned above.
Excellent example to illustrate the point!Have you seen a hobbyist level 3D printer operate? Guess what? They are typically controlled by an Arduino. Does it look like it is doing only one thing at a time?
Bob
thank you for the input.So, @navyguy , have we managed to totaly confuse you ?
If so i'm sorry , its a feature of the forum, we always try to be "correct" , but like all legal correct wording, its is confusing and may not be of help.
I think we have all agreed that the Arduino is the beast for you.
its how you program it that is the next thing,
Unfortunately , its almost 60 years since I learnt how to program , so i dont have any links to hand as to how to learn robotics, and most of my books have disintegrated over the decades.
There are many different ways you could implement a program for this sort of job, I have a good idea how I'd do it,
but
a) Im certain others will spend great amount of time shouting us down,
b) I'd find it very hard to describe on a forum
May be , you could post on the arduino forum, ask about any books / sites to get into arduino robotics,
And remember , no matter how you end up doing it, if it works then thats what matters,
best of luck
#include <Servo.h>
Servo myservo1; // create servo object to control a servo1
Servo myservo2; // create servo object to control a servo2
Servo myservo3; // create servo object to control a servo3
// twelve servo objects can be created on most boards but here we use only 3 servo motors.
int pos1 = 0; // variable to store the servo1 position
int pos2 = 0; // variable to store the servo2 position
int pos3 = 0 // variable to store the servo3 position
void setup() {
myservo1.attach(9); // attaches the servo1 on pin 9 to the servo object
myservo2.attach(10); // attaches the servo2 on pin 10 to the servo object
myservo1.attach(11); // attaches the servo3 on pin 11 to the servo object
}
void loop() {
for (pos1 = 0; pos1 <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos1); // tell servo to go to position in variable 'pos1'
for (pos2 = 0; pos2 <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos2); // tell servo to go to position in variable 'pos2'
for (pos3 = 0; pos3 <= 180; pos += 1) { // goes from 0 degrees to 180 degrees
// in steps of 1 degree
myservo.write(pos3); // tell servo to go to position in variable 'pos3'
delay(15); // waits 15ms for the servo to reach the position
}
for (pos1 = 180; pos1 >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos1); // tell servo to go to position in variable 'pos1'
for (pos2 = 180; pos2 >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos2); // tell servo to go to position in variable 'pos2'
for (pos3 = 180; pos3 >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo.write(pos3); // tell servo to go to position in variable 'pos3'
delay(15); // waits 15ms for the servo to reach the position
}
}
If examples of code are how you learn, I strongly recommend you join the Halloween-L group on Facebook.thank you for the input.
i think the comments are clear that I just need to learn how to program. I’m rampant ADD so sitting down and really learning it out of a book is very difficult for me to do.
the only programming I’ve ever done prior to this is my parallax micro processor which was super easy even for me.
Appreciate the feed back
This came up before and I recall the thread. Here it is. I know this stuff can be a little confusing and I am well aware as we age things do not sink in quite as quick as they once did. Believe me you can get this done with an Arduino Uno.
Here is an example:
Try running that code and I am willing to bet all 3 servos will respond about equally, any lag between servo 1 & 3 won't be noticeable. All of this was covered back in April the same way. All the above code does is run the servos 180 degrees and back over and over again. Written for an Arduino Uno and originally for a single servo. I do not have three servos to actually try it out and if anyone sees a problem with it feel free to critique it.Code:#include <Servo.h> Servo myservo1; // create servo object to control a servo1 Servo myservo2; // create servo object to control a servo2 Servo myservo3; // create servo object to control a servo3 // twelve servo objects can be created on most boards but here we use only 3 servo motors. int pos1 = 0; // variable to store the servo1 position int pos2 = 0; // variable to store the servo2 position int pos3 = 0 // variable to store the servo3 position void setup() { myservo1.attach(9); // attaches the servo1 on pin 9 to the servo object myservo2.attach(10); // attaches the servo2 on pin 10 to the servo object myservo1.attach(11); // attaches the servo3 on pin 11 to the servo object } void loop() { for (pos1 = 0; pos1 <= 180; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos1); // tell servo to go to position in variable 'pos1' for (pos2 = 0; pos2 <= 180; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos2); // tell servo to go to position in variable 'pos2' for (pos3 = 0; pos3 <= 180; pos += 1) { // goes from 0 degrees to 180 degrees // in steps of 1 degree myservo.write(pos3); // tell servo to go to position in variable 'pos3' delay(15); // waits 15ms for the servo to reach the position } for (pos1 = 180; pos1 >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos1); // tell servo to go to position in variable 'pos1' for (pos2 = 180; pos2 >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos2); // tell servo to go to position in variable 'pos2' for (pos3 = 180; pos3 >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees myservo.write(pos3); // tell servo to go to position in variable 'pos3' delay(15); // waits 15ms for the servo to reach the position } }
Ron
Thanks. I didn’t know that existed.If examples of code are how you learn, I strongly recommend you join the Halloween-L group on Facebook.
i previously mentioned it in post #22Thanks. I didn’t know that existed.
Thread starter | Similar threads | Forum | Replies | Date |
---|---|---|---|---|
M | RTOS uC / Micro-processor | Microcontrollers | 9 | |
A | how micro-controller or processor boot ? | Microcontrollers | 1 | |
M | Micro Processor | General Electronics Chat | 13 | |
Difference between micro processor and Micro controller | General Electronics Chat | 9 | ||
B | micro processor | Microcontrollers | 7 |
by Jake Hertz
by Aaron Carman
by Aaron Carman