Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Arduino Serial Read , Integer primary expression error #949

Open
aesopp99319 opened this issue Jan 6, 2020 · 0 comments
Open

Arduino Serial Read , Integer primary expression error #949

aesopp99319 opened this issue Jan 6, 2020 · 0 comments

Comments

@aesopp99319
Copy link

@aesopp99319 aesopp99319 commented Jan 6, 2020

Hello i am new to FastLed and I am trying to control a WS2812 with ardunio firefly & grasshopper. I want to control the LED to light up according to the integer value from serial read from firefly.

However the error message display primary expression before int.

Please advice how to fix this issue, Thank you!

#include <FastLED.h>
#include "FastLED.h"
#define NUM_LEDS 30
#define DATA_PIN 9
#define BRIGHTNESS 1000
#define NUM_LEDS 30
#define DATA_PIN 9
#define CLOCK_PIN 13

CRGB leds[NUM_LEDS];

void loop() {

while (Serial.available() == 0);
int val = Serial.read()-'0';

for(int led > 0; led < 30; ) {
// Turn the LED on, then pause
leds[int] = CRGB::Blue;

FastLED.show();
delay(500);
// Now turn the LED off, then pause
leds[0] = CRGB::Black;
FastLED.show();
delay(500);
}
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
1 participant
You can’t perform that action at this time.