|
Post by chromewrecker on Sept 12, 2016 1:07:12 GMT
Hello I am a total noob when it comes to this stuff and looking for some help or direction a couple weeks ago I bought a 3D printer and printed out a iron man helmet. The face plate and jaw are both hinged. I went to micro center today and bought a uno board a mini 5v board a bread board and various LEDs wires and such this it all because I seen animatronic iron man mark III helmet on instructibals. Well no the only problem is I have no idea how to wire this or code it I seen some stuff but only got more confused I have three servos for this also I would like to wire this up to work the face plate jaw and eyes if possible are there any wire diagrams and coding insturctions out there I can fab stuff all day but this electronic stuff is a bit over welming.
|
|
|
Post by Honus on Sept 12, 2016 6:05:46 GMT
|
|
|
Post by chromewrecker on Sept 12, 2016 11:49:09 GMT
Ok that is a ton of very well written information the work is pretty amazing but I do have a question when reviewing the helmet diagram and code I noticed that you used a pro mini 3.3 I bought a pro mini 5 is this not going to work or is there just something different I meet to do as far as the wiring goes thanks for the help
|
|
|
Post by Honus on Sept 12, 2016 18:46:08 GMT
The wiring hookup is the same for a 3.3V or 5V version regarding your connection pins. The only difference is in the input power. If you're using 6V servos use a 6V battery pack to power the servos and then connect the battery pack to a 3.3V voltage regulator to drop the voltage to the Arduino- you will connect the regulator output to the pin marked Vcc on the 3.3V Pro Mini.
|
|
|
Post by chromewrecker on Sept 13, 2016 0:41:55 GMT
Ok cool makes since one last question I see my uno board have a hook up for a usb how do I send the coding to the mini 5 and thanks for all the help
|
|
|
Post by Honus on Sept 13, 2016 3:39:17 GMT
|
|
|
Post by chromewrecker on Sept 13, 2016 10:44:04 GMT
Ok so I think I'm understanding this a little bit more but I have on last question my servos are 5 volt and I have a pro mini 5v will I need converter or since there both 5 volt do I just need to make sure my battery pack is 5 volt once again thanks for the help
|
|
|
Post by Honus on Sept 14, 2016 3:49:50 GMT
In that case you will want to power the servos using the battery pack and use a step up voltage regulator to power the Pro Mini as the Pro Mini can handle input voltage up to 12V. You want to connect the output of the regulator to the RAW input pin on the Pro Mini. I'd use a regulator like this one- www.pololu.com/product/2095
|
|
|
Post by chromewrecker on Sept 16, 2016 23:36:36 GMT
Ok so I now have everything I need and found some cool rob led boards what do I have to do in the coding to chose the color I have no one at my house tomorrow and I plan to attempt to get this working thanks for the help so far
|
|
|
Post by Honus on Sept 18, 2016 6:09:48 GMT
|
|
|
Post by chromewrecker on Sept 18, 2016 21:18:50 GMT
Ok this helps out for sure but I'm using the neopixels guess I should have mentioned that. This is the code for the helmet I'm using
#include <Servo.h> int button = 2; //button, connect to ground int press = 0; Servo servo; Servo servo1; boolean toggle = true;
void setup() { pinMode(button, INPUT); //arduino monitor pin state
servo.write(30); servo.attach(9); //pin for servo 1 on pin 9
servo1.write(95); servo1.attach(10); //pin for servo 2 on pin 10 digitalWrite(2, HIGH); //allows pullup for pin high }
void loop() { press = digitalRead(button); if (press == LOW) { if(toggle) { servo.write(30); servo1.write(95); toggle = !toggle; } else { servo.write(148); servo1.write(10); toggle = !toggle; } } delay(500); //debounce delay }
And this is the code I got to work on the neopixels
/** * Sample blink code for NeoPixels. * Completely free to use and distribute. Get to know NeoPixels! * * @author SeiRruf MalaWolSki * */
#include <Adafruit_NeoPixel.h>
#define PIN 7 #define PIXELS 8
// Parameter 1 = number of pixels in strip // Parameter 2 = pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() { strip.begin (); //initiate pixels strip.setBrightness ( 255 ); //0-255, 255=max brightness strip.show (); }
void loop() { //for each pixel, light it blue for ( int i=0; i<strip.numPixels(); i++ ) { strip.setPixelColor ( i, 0, 0, 255 ); //pixel, blue } //then display to NeoPixels strip.show (); //wait a second delay ( 0 ); //now switch each pixel to black (off) for ( int i=0; i<strip.numPixels(); i++ ) { strip.setPixelColor ( i, 0, 0, 0 ); } //and display it strip.show (); //another second of waiting delay ( 0 ); }
Can this be combined with the servos I can find other codes but can understand how to make the servos function the way I want for the helmet any thoughts thanks.... this should hopefully be the last thing I have to bug you with I appreciate the help it's been awesome learned a ton about this stuff so far.
|
|
|
Post by chromewrecker on Sept 18, 2016 23:42:14 GMT
Ok quick update I combined the two codes the servos move and the leds light up the requested color but now they blink and the turn on befor the trigger is switched any thoughts
|
|
|
Post by Honus on Sept 20, 2016 6:43:14 GMT
What does your combined code look like?
|
|
|
Post by chromewrecker on Sept 20, 2016 14:55:39 GMT
#include <Servo.h> #include <Adafruit_NeoPixel.h>
int button = 2; //button, connect to ground int press = 0; Servo servo; Servo servo1; boolean toggle = true;
#define PIN 6 #define PIXELS 8
// Parameter 1 = number of pixels in strip // Parameter 2 = pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXELS, PIN, NEO_GRB + NEO_KHZ800);
void setup() { pinMode(button, INPUT); //arduino monitor pin state
servo.write(30); servo.attach(9); //pin for servo 1 on pin 9
servo1.write(95); servo1.attach(10); //pin for servo 2 on pin 10 digitalWrite(2, HIGH); //allows pullup for pin 6 strip.begin (); //initiate pixels strip.setBrightness ( 255 ); //0-255, 255=max brightness strip.show (); }
void loop() { press = digitalRead(button); if (press == LOW) { if(toggle) { servo.write(30); servo1.write(95); toggle = !toggle; } else { servo.write(148); servo1.write(10); toggle = !toggle; } } delay(0); //debounce delay //for each pixel, light it red for ( int i=0; i<strip.numPixels(); i++ ) { strip.setPixelColor ( i, 0, 0, 255 ); //pixel, red, green, blue
} //then display to NeoPixels strip.show (); //wait a second delay ( 0 ); //now switch each pixel to black (off) for ( int i=0; i<strip.numPixels(); i++ ) { strip.setPixelColor ( i, 0, 0, 0 ); } //and display it strip.show (); //another second of waiting delay ( 0 ); }
|
|
|
Post by chromewrecker on Sept 20, 2016 18:54:28 GMT
I feel like the issue is in the void loop section it's trying to function the servos with the reed switch while keeping the lights on when I set the delay to say 500 the lights blink but the servos function correctly if this helps any seems to be confusing the board at that time
|
|