Hi there cool people
I am very new to this so I have a favour to ask
I have this idea for my project that works with Neopixel lights and Servos.
So far I coded the Neopixels lights that works with what I need. But the servos I have trouble coding them to work, I need 2 of them turns together 90° to the left and 90° to the right with push of the same button, the ons with the pin nr 10 & 11, both are Micro Servos 9g FS90. And the one with pin nr 9 to 90° also with a push of a button and to 0° with pushing it again, FS5106R (this I might have to change to only 180° servo). The last one I need it to turn a full circle also with also push of a button then to 0° with pushing it again, Continues servo FS90R.
I hope theres some one can help me with the coding I would really appreciate it
I attached the coding for the Neopixel and the sketch of what I have in my mind. Let me know if the sketch is wrong and how to fix it or i should change anything
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
 #include <avr/power.h>
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PINÂ Â Â Â Â Â 6
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELSÂ Â Â 60
#define TRACE_LENGTHÂ 5
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 25; // delay for half a second
void setup() {
 // This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
 if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
 // End of trinket special code
 pixels.begin(); // This initializes the NeoPixel library.
}
void loop() {
 // For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
 int i = 0;
 while(true) {
  // pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
  pixels.setPixelColor(i, pixels.Color(255,40,0)); // Orange color.
  pixels.setPixelColor(i - TRACE_LENGTH, pixels.Color(255,0,0)); // Bright red color.
  //pixels.setPixelColor(i, pixels.Color(0,90,255)); // Light blue color.
  //pixels.setPixelColor(i - TRACE_LENGTH, pixels.Color(0,0,255)); // Bright blue color.
  //pixels.setPixelColor(i, pixels.Color(0,150,50)); // Light blue color.
  //pixels.setPixelColor(i - TRACE_LENGTH, pixels.Color(0,255,0)); // Bright green color.
  pixels.show(); // This sends the updated pixel color to the hardware.
  delay(delayval); // Delay for a period of time (in milliseconds).
  i = (i + 1) % (NUMPIXELS + TRACE_LENGTH);
 }
}