Community Question

Hello,

i have a problem with my inmoov.

I add a "talking servo" i adjust the servo - everything is fine i have only one problem:

After a sentence the inmoov leave is mouth open. Nevermind how long or short the sentence is... the mouth is in the end still open.

I canĀ“t find any option to say after a sentence got to this servo postion.


User-inserted image


Thanx for help.


Boris
rentaprinta
Commented September 2015
@steve


Thanks
also to you! You help me also a lot!

Yeah this roboter is a so big buildplace ;-) But i hope until X-mas he will be born complitly


Boris
rentaprinta
Commented September 2015
@Bob

maybe
you know a trick, how to loop a script for the neopixel ring?

I have a script for the arduino called "fade in/fade out" . Works fine solo on the Arduino ( in a loop!)

I make a Script in EZ what send a serial info to the Arduino and the script starts, but only one time and then stops!


How i make a loop?

Code:

void pulseColor(uint32_t c, uint8_t wait) {
//Increase Brightness / Fade In
for(int i=minBrightness; i<maxBrightness; i++) {
strip.setBrightness(i);
for(int x=0; x<strip.numPixels(); x++){
strip.setPixelColor(x,c);
}
strip.show();
delay(wait);
}
//Lower Brightness / Fade Out
for(int i=maxBrightness; i>minBrightness; i--) {
strip.setBrightness(i);
for(int x=0; x<strip.numPixels(); x++){
strip.setPixelColor(x,c);
}
strip.show();
delay(wait);
}
}



This is the fade in / fade out code

How i can loop this code?



Here is the full code:

Code:

#include <Adafruit_NeoPixel.h>


#define PIN 6
#define STRIPSIZE 24

// Parameter 1 = number of pixels in strip
// Parameter 2 = Arduino 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(24, PIN, NEO_GRB + NEO_KHZ800);

// IMPORTANT: To reduce NeoPixel burnout risk, add 1000 uF capacitor across
// pixel power leads, add 300 - 500 Ohm resistor on first pixel's data input
// and minimize distance between Arduino and first pixel. Avoid connecting
// on a live circuit...if you must, connect GND first.


// Change These Variables
int maxBrightness = 120;
int minBrightness = 15;
int fadeSpeed = 15;

void setup() {
Serial.begin(9600);

strip.begin();
strip.show(); // Initialize all pixels to 'off'
}

void loop() {


if (Serial.available())
{ int ib = 0;
ib = Serial.read();

// Stop All display
if (ib == 66) {
colorWipe(strip.Color(0, 0, 255), 50); // Blau
}
if (ib == 80){
colorWipe(strip.Color(255, 255, 255), 50); // Weiss
}
if (ib == 82) {
colorWipe(strip.Color(255, 0, 0), 50); // Rot
}
if (ib == 71) {
colorWipe(strip.Color(0, 255, 0), 50); // Grün
}
if (ib == 87){
colorWipe(strip.Color(0, 0, 0), 0); // Licht aus
}
if (ib == 110){
colorWipe(strip.Color(255, 255, 0), 50); // gelb
}
if (ib == 120){
colorWipe(strip.Color(255, 0, 255), 50); // magenta
}
if (ib == 130){
colorWipe(strip.Color(0, 255, 255), 50); // cyan
}
if (ib == 140){
colorWipe(strip.Color(255, 127, 0), 50); // orange
}
if (ib == 150){
colorWipe(strip.Color(224, 102, 255), 50); // flida
}



if (ib == 160){
pulseColor(strip.Color(0, 0, 255), fadeSpeed); //Set the color with Red, Gree, Blue values

}
}
}
void colorWipe(uint32_t c, uint8_t wait) {
for (uint16_t i = 0; i < strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(wait);
}
}

void pulseColor(uint32_t c, uint8_t wait) {
//Increase Brightness / Fade In
for(int i=minBrightness; i<maxBrightness; i++) {
strip.setBrightness(i);
for(int x=0; x<strip.numPixels(); x++){
strip.setPixelColor(x,c);
}
strip.show();
delay(wait);
}
//Lower Brightness / Fade Out
for(int i=maxBrightness; i>minBrightness; i--) {
strip.setBrightness(i);
for(int x=0; x<strip.numPixels(); x++){
strip.setPixelColor(x,c);
}
strip.show();
delay(wait);
}
}

rentaprinta
Commented September 2015
@Bob

Forget
my question!

Who can read has more possibilities! ;-)

I rode now the hole treath and now i have "best of" working neopixel ring!

https://www.ez-robot.com/Community/Forum/Thread?threadId=6767&page=6


Thanx Bob!



Boris
bhouston
Commented September 2015
Good, glad you got it all figured out. Sorry I didn't get back to you - I had to take a day off of retirement and work today!
rentaprinta
Commented September 2015
@Bob

no
prob, sometimes its better to found out yourself - you learn a lot!

Tomorrow i will make a video of the hole lightshow!

See yaa!

Boo
Question
Avatarrentaprinta
Asked on Saturday, July 25, 2015