edit this : #include <FastLED.h> #include <Arduino.h> #define LEDPIN 5 #define NUMLEDS…
- User
edit this : #include <FastLED.h> #include <Arduino.h>
#define LED_PIN 5 #define NUM_LEDS 432 #define SENS_PIN A0 #define THRESHOLD 4
void setup() {
pinMode(SENS_PIN, INPUT); Serial.begin(57600); FastLED.setBrightness(38); }
void loop() { int A0Voltage = analogRead(SENS_PIN); Serial.println(A0Voltage);
}
Edit it to so evrytime threshold is hit it's turning on a series of pixels(depending how long threshold is hit)scrolling from start to end of the strip , even hit multiple yimes shortly one after the other, use advanced techniques, avoid delays
- Assistant
- User
this lines hgenerates an error for (int i = NUM_LEDS - 1; i >= segmentLength; i–) {
- Assistant
The issue with the line you're referring to is likely due to the incorrect usage of the decrement operator. Instead of using a long en-dash (
i–), you should be using the standard decrement operator (i--). Here's the corrected code:cpp - User
the lenght of the segment of on leds must be determined by how lon threshold is it (while is hit add leds)
- Assistant
- User
for (int i = NUM_LEDS - 1; i >= segmentLength; i–) error with i-
- Assistant
Apologies for the oversight; there was a typographical error in the decrement operator for the for loop. The correct decrement operator is . Here's the corrected version of the loop along with the entire code:
- User
again error with for (int i = NUM_LEDS - 1; i >= segmentLength; i–) i- is the problem
- Assistant