Question: NEED IT IN C++ / ARDUINO I NEED THIS CODE EDITED ACCORDING TO THE ATTACHED PEG. // Merged code //This is merged code, blinkNeoPixelStrip and

NEED IT IN C++ / ARDUINO

I NEED THIS CODE EDITED ACCORDING TO THE ATTACHED PEG.

// Merged code //This is merged code, blinkNeoPixelStrip and BasicPotentiometer // objective being to blink the NeoPixelStrip only when specific conditions from //the BasicPotentiometer are met #include // Library that provides NeoPixel functions // -- Create an instance of a neopixel object. See simple.ino from neopixel library #define NEOPIXELPIN 11 // Digital I/O pin to drive neopixel #define NUMPIXELS 5 // Number of NeoPixels; 5per neopixel strip Adafruit_NeoPixel pixelStrip = Adafruit_NeoPixel(NUMPIXELS, NEOPIXELPIN, NEO_GRB + NEO_KHZ800); // ---------------------------------------------------------------- void setup() { pixelStrip.begin(); // Initializes the NeoPixel object //initialize serial communication Serial.begin(115200); } // ---------------------------------------------------------------- void loop() { //declare reading and voltage here, then activate code for reading and displaying //them on the serial monitor //

int reading; float voltage; reading = analogRead(A0); // Read analog input channel 0 voltage = reading*(5.0/1023.0); // convert reading to voltage

Serial.print(reading); //print raw reading value Serial.print(" "); Serial.println(voltage); // print voltage value

int r=50, g=50, b=50; //insert conditions for blinking the NeoPixelStrip if (voltage

all_pixels_on(NUMPIXELS, r,g,b); // Turn on all pixels to the same color delay(1000); pixelStrip.clear(); pixelStrip.show(); delay(1000); // Set all pixels off // Update the pixel strip }else{ // //condition is not satisfied, so turn off the NeoPixelStrip // pixelStrip.clear(); } } // ---------------------------------------------------------------- // Turn all n NeoPixels on to the same RGB color combination // void all_pixels_on(int n, int r, int g, int b) { // -- Loop over the n NeoPixels, start with pixel number zero for (int i=0; i

NEED IT IN C++ / ARDUINO I NEED THIS CODE EDITED ACCORDING

Modify the merged blinkNeoPixelStrip and BasicPhotoresistor sketches so that you can blink the NeoPixelStrip according to the following conditions. When the voltage =1.85 and the voltage is 3.75, turn all pixels to a pleasant light of your choice When voltage >=3.75 turn off all pixels

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!