Go Down

Topic: Re: Hi Peeps (Read 1 time) previous topic - next topic

Pizstonenumb

As there isn't a intro section I just thought I'd say hello and pre warn everyone that I am about to embark on my first project. Done the blink and a few other bits so I know I can push a little spike into a hole and press a computer key.
How hard can the rest be?

Im getting into animatronics as I am the arty farty type but not yet into the computermibob so I need to brush up on my swear words and collect enough things to throw at the dog.

Ill be running servos mostly and cant wait to get things working together and on occasion against each other. My first thing is to get two servos working off a joystick (easy) along with two off push buttons so they assume a position interdependently when a button is pressed and then return to rest when the button is released. This also seems easy but I need to get my head around joining sketches up so the program runs several things together.

Hope to knock heads with some of you as the learning begins. Oh and dont be gentle with me. I often keep a sharp stone in m y shoe. Its the way I roll MF.  :)

Robin2

Welcome.

Be kind to the dog.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

Henry_Best

Welcome.

Be kind to the dog.
Here it's dogmatic. But please don't feed it beagle bones.

Robin2

Our byte is every bit as bad as our bark.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

ChrisTenone

Hiya 'pist on emun'!

Couple* words of advice:

  • stay away from the bar if you ever want to take any of these characters seriously again!
  • start out slowly. Don't try to make your final project first. It WILL take longer that way.
  • HAVE FUN!


As there isn't a intro section I just thought I'd say hello and pre warn everyone that I am about to embark on my first project. Done the blink and a few other bits so I know I can push a little spike into a hole and press a computer key.
How hard can the rest be?

Im getting into animatronics as I am the arty farty type but not yet into the computermibob so I need to brush up on my swear words and collect enough things to throw at the dog.

Ill be running servos mostly and cant wait to get things working together and on occasion against each other. My first thing is to get two servos working off a joystick (easy) along with two off push buttons so they assume a position interdependently when a button is pressed and then return to rest when the button is released. This also seems easy but I need to get my head around joining sketches up so the program runs several things together.

Hope to knock heads with some of you as the learning begins. Oh and dont be gentle with me. I often keep a sharp stone in m y shoe. Its the way I roll MF.  :)
* for large values of 'couple'
What, I need to say something else too?

Pizstonenumb

Isn't this section of the Forum devoted to taking the P ?

...R
.....and your all failing miserably :)


Pis stone numb by the way. Its after a local saying about special people that lack brightness in, well in anything.

Pizstonenumb

Oh by the way I have just completed my first serious project. It even worked to my amazement.
Knocked up a box that tests trailer lights for a friend. It simply plugs into the truck trailer and runs a short program to switch the lights on in a sequence so he can do a visual check as he walks round the unit. He is a mechanic and works for a supermarket/superstore chain.
Used one of the circuit boards with 8 relays on it. Very pleased with the outcome.

Pizstonenumb

Hiya 'pist on emun'!

Couple* words of advice:

  • stay away from the bar if you ever want to take any of these characters seriously again!
  • start out slowly. Don't try to make your final project first. It WILL take longer that way.
  • HAVE FUN!





* for large values of 'couple'
Not sure about slowly. As most others launching into this type of thing I needed a solution to a specific problem and need to get there at speed.
Being British and obviously as daft as a box of frogs I have inadvertently become involved with a steampunk group. Its basically people dressing in victorian costume and making idiots of themselves. Think of the film 'The Wild Wild West' without cowboys.
My costume includes a coal fire and boiler back pack, a steam driven shoulder parrot and a large Stevenson's Rocket type chimney that blows out smoke rings. All driven by an arduino.

I know, I know. Numb as a p stone.

Robin2

Not sure about slowly. As most others launching into this type of thing I needed a solution to a specific problem and need to get there at speed.
Maybe "systematically" would be a better word than "slowly".

We see lots of people who seem to start at the back of a project and then wonder why it does not work.


If you go at something slowly there is probably a better chance that you will also be systematic. But you could be systematic without being slow.

...R
Two or three hours spent thinking and reading documentation solves most programming problems.

TomGeorge

Oh by the way I have just completed my first serious project. It even worked to my amazement.
Knocked up a box that tests trailer lights for a friend. It simply plugs into the truck trailer and runs a short program to switch the lights on in a sequence so he can do a visual check as he walks round the unit. He is a mechanic and works for a supermarket/superstore chain.
Used one of the circuit boards with 8 relays on it. Very pleased with the outcome.
Good project to start with, power supply, basic I/O and output interfacing.
The next step would be some current sensing as each light is lit.
So without even looking at the lights you can tell if any light circuit is open circuit, ie blown, or open lamp/LED.
Even calculate wattage of each circuit, to see if correct lamp/LED being used.
Tom.. :)
Everything runs on smoke, let the smoke out, it stops running....

Pizstonenumb

Wasn't my idea, I was just building to his requirements. I did consider wireless switching rather than a set sequence but then you have the issues on site of remote control, batteries, filth. He may require an upgrade in the future but his only other option is a very unreliable industrial unit they have on site that cost about 4 grand. Rarely working and the size of a washing machine.

This was my little contribution.







Pizstonenumb

Im avin a mare with my next project. I thought servos would be a doddle.

Its all goin sarf...............  :smiley-confuse:

TomGeorge

#12
Jun 04, 2018, 02:37 pm Last Edit: Jun 04, 2018, 02:38 pm by TomGeorge
Hi,
OPs pic;

Very nice.
Servos can be a doddle.

  • Servos can require more an an AMP to run, check specs.
  • Servo needs separate supply from the controller.
  • The Controller gnd MUST be connected to the Servo Supply gnd.
  • Servos consume current even when signaled to a fixed position if the servo has to work against a load torque.
  • The cheaper the servo, the less each servo behave to spec, in particular, 0 to 180, might be 10 to 170.


Tom... :)
Everything runs on smoke, let the smoke out, it stops running....

Pizstonenumb

Hi,
OPs pic;

Very nice.
Servos can be a doddle.

  • Servos can require more an an AMP to run, check specs.
  • Servo needs separate supply from the controller.
  • The Controller gnd MUST be connected to the Servo Supply gnd.
  • Servos consume current even when signaled to a fixed position if the servo has to work against a load torque.
  • The cheaper the servo, the less each servo behave to spec, in particular, 0 to 180, might be 10 to 170.


Tom... :)

I can make one spin at will...............lol

The problem is I have built a parrot. Yes a mechanical burd... It has 4 kit servos (SG90s) I had to install as the build went on and are now inaccessible. How did I know they dont actually start at 0 Lol..........

I need two to run off a joystick (look left and right/ Look up and down).
I need one to run off the press button in the joystick (mouth open and close) and one separate button to flap the wings.
The nearest I could find program wise was this with lines added for the 'W' axis but Im having trouble getting rid of the serial monitor bit. everytime I try and delete it the damn thing wont verify. If I leave it in the damn thing comes up with faults on my W axis. Its driving me to distraction.

Code: [Select]

  Projeto Arduino - Como ligar um joystick no Arduino

  ----------------------------------------
  --=<| www.ComoFazerAsCoisas.com.br |>=--
  ----------------------------------------
*/

// including library for servomotor control
#include <Servo.h>

//Creating a Servo Class Object
Servo servoMotorObjX;
Servo servoMotorObjY;
Servo servoMotorObjZ;
Servo servoMotorObjW;

//pin (PWM) associated with servomotor control
int const servoMotorX = 4;
int const servoMotorY = 5;
int const servoMotorZ = 3;
int const servoMotorW = 2;

//stores the read position
// on the joystickstick axes
int joystickX = 0;
int joystickY = 0;
int joystickZ = 0;
int joystickW = 0;

//Assigning the analog pins
int axisX = A3;

int axisY = A2;

//Assigning the digital pins
int axisZ = 9;

int axisM = 8;


void setup() {
  //associated with the digital control pin of the
  // servo to the Servo class object
  servoMotorObjX.attach(servoMotorX);
  servoMotorObjY.attach(servoMotorY);
  servoMotorObjZ.attach(servoMotorZ);
  servoMotorObjW.attach(servoMotorW);

  // Defining Z and M axis as an input pin
  pinMode(axisZ, INPUT);
  pinMode(axisM, INPUT);
 
  servoMotorObjX.write(80);
  servoMotorObjY.write(80);
  servoMotorObjY.write(170);
  servoMotorObjW.write(170);

  // Activating the Serial Monitor that will display the
  // values ​​read on Joystick
  Serial.begin(9600);
}

void loop() {
  // Read the value of the X axis
  joystickX = analogRead(axisX);

  // Read the value of the Y axis
  joystickY = analogRead(axisY);

  // Read the value of the Z axis
  joystickZ = digitalRead(axisZ);

  // Read the value of the W axis
  joystickW = digitalRead(axisW);

  printAxis();

  // mapping the value read on the joystick to the scale of the
  // servo (between 0 and 180)
  joystickX = map(joystickX, 0, 1023, 0, 180);
  joystickY = map(joystickY, 0, 1023, 0, 180);
  joystickZ = map(joystickZ, 0, 1, 0, 180);
  joystickW = map(joystickW, 0, 1, 0, 180);

  // defining the value / position of the servomotor
  servoMotorObjX.write(joystickX);
  servoMotorObjY.write(joystickY);
  servoMotorObjZ.write(joystickZ);
  servoMotorObjW.write(joystickW);

  // wait 20 milliseconds.
  delay(20);
}

// This method is responsible only for printing on the
// Serial Monitor the values ​​of the X, Y and Z axes.
void imprimeEixos() {
  //imprime o valor do eixoX
  Serial.print("  X=");
  Serial.print(joystickX);

  //imprime o valor do eixoY
  Serial.print("   Y=");
  Serial.print(joystickY);

  //imprime o valor do eixoZ
  Serial.print("   Z=");
  Serial.println(joystickZ);

  Serial.print("   W=");
  Serial.println(joystickW);
}



I dont think it helped it was in Portuguese  :)

What do you think........... Am I onto a loser  :( 

TomGeorge

Hi,
Start a post in Programming Questions.
You will be better off starting from scratch with your own code.

Do the servo library examples first, they will give you about 80% of what you need.
Post a circuit diagram as well, showing how you power everything, especially your servos.

Tom.... :)
Everything runs on smoke, let the smoke out, it stops running....

Go Up