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
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
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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started