Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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<>

image text in transcribed

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Autonomous Database In Enterprise Architecture

Authors: Bal Mukund Sharma, Krishnakumar KM, Rashmi Panda

1st Edition

1801072248, 978-1801072243

Students also viewed these Databases questions