Hi , id like some help ,my goal is to write this code so the sequence is- key on , pump runs for 15sec, then off till it gets signal from a source then linear 12-0v pmw till shut down, I'm sure its a awful, but I've spent days trying to write this code, they'll (the individual pieces of the master sequence) compile separately just fine. its when i try to put them together its a failure. I've watched you tube , consulted the reference page, and stack-Exchange. and no one has built something like this that works and i will happily list this on the project hub after its finished to prevent any one else from asking this
''current code-----error msg 'expected ( before int ''
int ledPin1 = 6; // LED connected to digital pin 6
int potentiometerPin = A0;
// constants won't change. They're used here to set pin numbers:
const int buttonPin = 2; // the number of the engine pin
const int ledPin = 6; // the number of the LED pin
const int val potValue = potentiometerValue();
// variables will change:
int buttonState = 0; // variable for reading engine status
void setup() {
//function to calculate potentiometer value
int potentiometerValue();
int potentiometerValue();
for int fadeValue = map(potValue, 1023, , 0, 255); // sets the value (range from 0 to 255):
int val = analogRead(potentiometerPin);
return val;
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);
// check if engine on . If it is, the buttonState is HIGH:
if (buttonState == HIGH) {
// turn LED on:
digitalWrite(ledPin, HIGH);
} else {
// turn pump off:
digitalWrite(ledPin, LOW);'
Arduino: 1.8.18 (Windows 10), Board: "Arduino Mini, ATmega328P"
C:\Program Files (x86)\Arduino\arduino-builder -dump-prefs -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\weldh\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\weldh\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\weldh\Documents\Arduino\libraries -fqbn=arduino:avr:mini:cpu=atmega328 -vid-pid=067B_2303 -ide-version=10818 -build-path C:\Users\weldh\AppData\Local\Temp\arduino_build_644885 -warnings=all -build-cache C:\Users\weldh\AppData\Local\Temp\arduino_cache_810629 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Users\weldh\Documents\Arduino\sketch_jan08b\sketch_jan08b.ino
C:\Program Files (x86)\Arduino\arduino-builder -compile -logger=machine -hardware C:\Program Files (x86)\Arduino\hardware -hardware C:\Users\weldh\AppData\Local\Arduino15\packages -tools C:\Program Files (x86)\Arduino\tools-builder -tools C:\Program Files (x86)\Arduino\hardware\tools\avr -tools C:\Users\weldh\AppData\Local\Arduino15\packages -built-in-libraries C:\Program Files (x86)\Arduino\libraries -libraries C:\Users\weldh\Documents\Arduino\libraries -fqbn=arduino:avr:mini:cpu=atmega328 -vid-pid=067B_2303 -ide-version=10818 -build-path C:\Users\weldh\AppData\Local\Temp\arduino_build_644885 -warnings=all -build-cache C:\Users\weldh\AppData\Local\Temp\arduino_cache_810629 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avrdude-6.3.0-arduino17.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\avrdude\6.3.0-arduino17 -prefs=runtime.tools.avr-gcc.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.avr-gcc-7.3.0-atmel3.6.1-arduino7.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\avr-gcc\7.3.0-atmel3.6.1-arduino7 -prefs=runtime.tools.arduinoOTA.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -prefs=runtime.tools.arduinoOTA-1.3.0.path=C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\tools\arduinoOTA\1.3.0 -verbose C:\Users\weldh\Documents\Arduino\sketch_jan08b\sketch_jan08b.ino
Using board 'mini' from platform in folder: C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.4
Using core 'arduino' from platform in folder: C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.4
Detecting libraries used...
"C:\\Users\\weldh\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_MINI -DARDUINO_ARCH_AVR "-IC:\\Users\\weldh\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.4\\cores\\arduino" "-IC:\\Users\\weldh\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.4\\variants\\eightanaloginputs" "C:\\Users\\weldh\\AppData\\Local\\Temp\\arduino_build_644885\\sketch\\sketch_jan08b.ino.cpp" -o nul
Generating function prototypes...
"C:\\Users\\weldh\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_MINI -DARDUINO_ARCH_AVR "-IC:\\Users\\weldh\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.4\\cores\\arduino" "-IC:\\Users\\weldh\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.4\\variants\\eightanaloginputs" "C:\\Users\\weldh\\AppData\\Local\\Temp\\arduino_build_644885\\sketch\\sketch_jan08b.ino.cpp" -o "C:\\Users\\weldh\\AppData\\Local\\Temp\\arduino_build_644885\\preproc\\ctags_target_for_gcc_minus_e.cpp"
"C:\\Program Files (x86)\\Arduino\\tools-builder\\ctags\\5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "C:\\Users\\weldh\\AppData\\Local\\Temp\\arduino_build_644885\\preproc\\ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"C:\\Users\\weldh\\AppData\\Local\\Arduino15\\packages\\arduino\\tools\\avr-gcc\\7.3.0-atmel3.6.1-arduino7/bin/avr-g++" -c -g -Os -Wall -Wextra -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -Wno-error=narrowing -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10818 -DARDUINO_AVR_MINI -DARDUINO_ARCH_AVR "-IC:\\Users\\weldh\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.4\\cores\\arduino" "-IC:\\Users\\weldh\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.8.4\\variants\\eightanaloginputs" "C:\\Users\\weldh\\AppData\\Local\\Temp\\arduino_build_644885\\sketch\\sketch_jan08b.ino.cpp" -o "C:\\Users\\weldh\\AppData\\Local\\Temp\\arduino_build_644885\\sketch\\sketch_jan08b.ino.cpp.o"
C:\Users\weldh\Documents\Arduino\sketch_jan08b\sketch_jan08b.ino: In function 'void setup()':
sketch_jan08b:15:5: error: expected '(' before 'int'
for int fadeValue = map,potValue, 1023, , 0, 255); // sets the value (range from 0 to 255):
^~~
C:\Users\weldh\Documents\Arduino\sketch_jan08b\sketch_jan08b.ino:15:21: warning: invalid conversion from 'long int (*)(long int, long int, long int, long int, long int)' to 'int' [-fpermissive]
for int fadeValue = map,potValue, 1023, , 0, 255); // sets the value (range from 0 to 255):
^~~
sketch_jan08b:15:35: error: expected unqualified-id before numeric constant
for int fadeValue = map,potValue, 1023, , 0, 255); // sets the value (range from 0 to 255):
^~~~
sketch_jan08b:15:35: error: expected ';' before numeric constant
sketch_jan08b:15:41: error: expected primary-expression before ',' token
for int fadeValue = map,potValue, 1023, , 0, 255); // sets the value (range from 0 to 255):
^
sketch_jan08b:15:49: error: expected ';' before ')' token
for int fadeValue = map,potValue, 1023, , 0, 255); // sets the value (range from 0 to 255):
^
C:\Users\weldh\Documents\Arduino\sketch_jan08b\sketch_jan08b.ino:15:9: warning: unused variable 'fadeValue' [-Wunused-variable]
for int fadeValue = map,potValue, 1023, , 0, 255); // sets the value (range from 0 to 255):
^~~~~~~~~
C:\Users\weldh\Documents\Arduino\sketch_jan08b\sketch_jan08b.ino:15:25: warning: unused variable 'potValue' [-Wunused-variable]
for int fadeValue = map,potValue, 1023, , 0, 255); // sets the value (range from 0 to 255):
^~~~~~~~
In file included from C:\Users\weldh\AppData\Local\Temp\arduino_build_644885\sketch\sketch_jan08b.ino.cpp:1:0:
C:\Users\weldh\Documents\Arduino\sketch_jan08b\sketch_jan08b.ino: At global scope:
C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.4\cores\arduino/Arduino.h:44:16: error: expected unqualified-id before numeric constant
#define OUTPUT 0x1
^
C:\Users\weldh\Documents\Arduino\sketch_jan08b\sketch_jan08b.ino:22:1: note: in expansion of macro 'OUTPUT'
OUTPUT pinMode(ledPin, );
^~~~~~
C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.4\cores\arduino/Arduino.h:43:15: error: expected unqualified-id before numeric constant
#define INPUT 0x0
^
C:\Users\weldh\Documents\Arduino\sketch_jan08b\sketch_jan08b.ino:24:1: note: in expansion of macro 'INPUT'
INPUT pinMode(buttonPin, );
^~~~~
C:\Users\weldh\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.4\cores\arduino/Arduino.h:40:14: error: expected unqualified-id before numeric constant
#define HIGH 0x1
^
C:\Users\weldh\Documents\Arduino\sketch_jan08b\sketch_jan08b.ino:30:2: note: in expansion of macro 'HIGH'
HIGH(buttonState = ) {
^~~~
exit status 1
expected '(' before 'int'
