Sorry for this
Ive looked and looked and according to the left hand pane others are asking similar,
While I'm an Automotive engineer and have a basic knowledge. I have never tried programming. I have used C++ for basic CFG analysis air flows etc
So Ive built an led strip for the Indicators for my car as a test, ( following this youtube video https://www.youtube.com/watch?v=gqaCwqRQ3gE&t=97s )
but as soon as I upload his sketch I run into all sorts of errors and of course don't know what they mean
Could someone point me in the right direction, either the correct place for this post or nudge in the right direction as to the error messages.
Kind regards
Stephen
PS I have dropped the sketch below and the error codes Just in case hope this is the right thing to do; thank you in advance
home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:1:5: error: found ':' in nested-name-specifier, expected '::'
Name: CarInterface.ino
^
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:1:1: error: 'Name' does not name a type
Name: CarInterface.ino
^~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:65:25: error: variable or field 'indicatorAnimation' declared void
void indicatorAnimation(CRGB *leds) {
^~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:65:25: error: 'CRGB' was not declared in this scope
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:65:25: note: suggested alternative: 'OCR0B'
void indicatorAnimation(CRGB *leds) {
^~~~
OCR0B
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:65:31: error: 'leds' was not declared in this scope
void indicatorAnimation(CRGB *leds) {
^~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:65:31: note: suggested alternative: 'gets'
void indicatorAnimation(CRGB *leds) {
^~~~
gets
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino: In function 'void setup()':
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:32:2: error: 'FastLED' was not declared in this scope
FastLED.addLeds<WS2812B, L_INDICATOR_LED_PIN, GRB>(L_Indicator_leds, 3).setCorrection(TypicalLEDStrip);
^~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:32:18: error: 'WS2812B' was not declared in this scope
FastLED.addLeds<WS2812B, L_INDICATOR_LED_PIN, GRB>(L_Indicator_leds, 3).setCorrection(TypicalLEDStrip);
^~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:32:27: error: 'L_INDICATOR_LED_PIN' was not declared in this scope
FastLED.addLeds<WS2812B, L_INDICATOR_LED_PIN, GRB>(L_Indicator_leds, 3).setCorrection(TypicalLEDStrip);
^~~~~~~~~~~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:32:48: error: 'GRB' was not declared in this scope
FastLED.addLeds<WS2812B, L_INDICATOR_LED_PIN, GRB>(L_Indicator_leds, 3).setCorrection(TypicalLEDStrip);
^~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:32:48: note: suggested alternative: 'DDRB'
FastLED.addLeds<WS2812B, L_INDICATOR_LED_PIN, GRB>(L_Indicator_leds, 3).setCorrection(TypicalLEDStrip);
^~~
DDRB
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:32:53: error: 'L_Indicator_leds' was not declared in this scope
FastLED.addLeds<WS2812B, L_INDICATOR_LED_PIN, GRB>(L_Indicator_leds, 3).setCorrection(TypicalLEDStrip);
^~~~~~~~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:32:88: error: 'TypicalLEDStrip' was not declared in this scope
FastLED.addLeds<WS2812B, L_INDICATOR_LED_PIN, GRB>(L_Indicator_leds, 3).setCorrection(TypicalLEDStrip);
^~~~~~~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:34:24: error: 'BRIGHTNESS' was not declared in this scope
FastLED.setBrightness(BRIGHTNESS);
^~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:36:11: error: 'L_INDICATOR_INPUT' was not declared in this scope
pinMode(L_INDICATOR_INPUT, INPUT);
^~~~~~~~~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino: In function 'void loop()':
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:43:39: error: 'L_INDICATOR_INPUT' was not declared in this scope
bool L_IndicatorInput = digitalRead(L_INDICATOR_INPUT);
^~~~~~~~~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:49:22: error: 'L_Indicator_leds' was not declared in this scope
indicatorAnimation(L_Indicator_leds);
^~~~~~~~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:49:22: note: suggested alternative: 'L_IndicatorInput'
indicatorAnimation(L_Indicator_leds);
^~~~~~~~~~~~~~~~
L_IndicatorInput
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:49:3: error: 'indicatorAnimation' was not declared in this scope
indicatorAnimation(L_Indicator_leds);
^~~~~~~~~~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:49:3: note: suggested alternative: 'indicatorLEDsLit'
indicatorAnimation(L_Indicator_leds);
^~~~~~~~~~~~~~~~~~
indicatorLEDsLit
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:53:22: error: 'L_Indicator_leds' was not declared in this scope
indicatorAnimation(L_Indicator_leds);
^~~~~~~~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:53:22: note: suggested alternative: 'L_IndicatorInput'
indicatorAnimation(L_Indicator_leds);
^~~~~~~~~~~~~~~~
L_IndicatorInput
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:53:3: error: 'indicatorAnimation' was not declared in this scope
indicatorAnimation(L_Indicator_leds);
^~~~~~~~~~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:53:3: note: suggested alternative: 'indicatorLEDsLit'
indicatorAnimation(L_Indicator_leds);
^~~~~~~~~~~~~~~~~~
indicatorLEDsLit
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:58:14: error: 'L_Indicator_leds' has not been declared
fill_solid(L_Indicator_leds:: 3, CRGB::Black);
^~~~~~~~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:58:33: error: expected unqualified-id before numeric constant
fill_solid(L_Indicator_leds:: 3, CRGB::Black);
^
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:58:36: error: 'CRGB' has not been declared
fill_solid(L_Indicator_leds:: 3, CRGB::Black);
^~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:58:3: error: 'fill_solid' was not declared in this scope
fill_solid(L_Indicator_leds:: 3, CRGB::Black);
^~~~~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:62:2: error: 'FastLED' was not declared in this scope
FastLED.show();
^~~~~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino: At global scope:
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:65:25: error: variable or field 'indicatorAnimation' declared void
void indicatorAnimation(CRGB *leds) {
^~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:65:25: error: 'CRGB' was not declared in this scope
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:65:25: note: suggested alternative: 'OCR0B'
void indicatorAnimation(CRGB *leds) {
^~~~
OCR0B
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:65:31: error: 'leds' was not declared in this scope
void indicatorAnimation(CRGB *leds) {
^~~~
/home/s/Arduino/CarInterface_copy_1/CarInterface_copy_1.ino:65:31: note: suggested alternative: 'gets'
void indicatorAnimation(CRGB *leds) {
^~~~
gets
exit status 1
Compilation error: found ':' in nested-name-specifier, expected '::'
/
from this sketch;
Name: CarInterface.ino
Created: 3/17/2021 4:15:11 PM
Author: Mr Monkey
Code and schematic demonstrating how to interface an Arduino with 12V signals
from a vehicle. This code is for educational purposes only, and should not be
used on public roads unless you know it is legal where you live.
*/
include <FastLED.h>
define NUM_LEDS 3
define INDICATOR_MS 30
define BRIGHTNESS 200
// Connections to the 12V signals from vehicle
define L_INDICATOR_INPUT 3
// Connections to the LED strips
define L_INDICATOR_LED_PIN 7
// LED arrays for the lights
define CRGB L_INDICATOR_LEDS[3];
// Used for indicator animation
uint8_t indicatorLEDsLit = 3;
void setup() {
FastLED.addLeds<WS2812B, L_INDICATOR_LED_PIN, GRB>(L_Indicator_leds, 3).setCorrection(TypicalLEDStrip);
FastLED.setBrightness(BRIGHTNESS);
pinMode(L_INDICATOR_INPUT, INPUT);
}
void loop() {
// Read the state of the inputs
bool L_IndicatorInput = digitalRead(L_INDICATOR_INPUT);
// Brake lights
// Indicators
if (L_IndicatorInput ) {
indicatorAnimation(L_Indicator_leds);
}
else if (!L_IndicatorInput) {
indicatorAnimation(L_Indicator_leds);
}
else {
fill_solid(L_Indicator_leds:: 3, CRGB::Black);
indicatorLEDsLit = 3;
}
FastLED.show();
}
void indicatorAnimation(CRGB *leds) {
for (int i = 0; i < indicatorLEDsLit; i++) {
leds[i] = CRGB::Orange;
}
EVERY_N_MILLISECONDS(INDICATOR_MS) {
indicatorLEDsLit++;
if (indicatorLEDsLit > 3) indicatorLEDsLit = 3;
}
}