ive been reading up and i understand that this means it returned 1 error but i'm not sure how to locate it on my own.i'm hoping someone with more experience can help
int sensor_pin=A0;
int output_value;
const int motorIn1 = 9;
const int motorIn2 = 10;
char val;
void setup() {
Serial.begin(9600);
{
pinMode(motorIn1,OUTPUT);
pinMode(motorIn2,OUTPUT);
}
}
void loop() {
output_value= analogRead(sensor_pin);
output_value= map(output_value,
550,0,0,100);
if(Serial.available())
{
val =Serial.read();
}
if( val == 'A' )
{
analogWrite(motorIn1,400);
}
if( val == 'B' )
{
analogWrite(motorIn1,0);
}
if(output_value < 30)
{
analogWrite(motorIn1,400);
}
}
smart_plant_water2.ino (561 Bytes)
I just tried the code configured for an Uno and it had no errors compiling. Can you post your exact error?
Arduino: 1.8.3 (Mac OS X), Board: "Arduino/Genuino Uno"
/Applications/Arduino.app/Contents/Java/arduino-builder -dump-prefs -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/chrisfisher/Documents/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path /var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849 -warnings=none -build-cache /var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_cache_147696 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/chrisfisher/Documents/Arduino/smart_plant_water2/smart_plant_water2.ino
/Applications/Arduino.app/Contents/Java/arduino-builder -compile -logger=machine -hardware /Applications/Arduino.app/Contents/Java/hardware -tools /Applications/Arduino.app/Contents/Java/tools-builder -tools /Applications/Arduino.app/Contents/Java/hardware/tools/avr -built-in-libraries /Applications/Arduino.app/Contents/Java/libraries -libraries /Users/chrisfisher/Documents/Arduino/libraries -fqbn=arduino:avr:uno -ide-version=10803 -build-path /var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849 -warnings=none -build-cache /var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_cache_147696 -prefs=build.warn_data_percentage=75 -prefs=runtime.tools.avrdude.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.avr-gcc.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -prefs=runtime.tools.arduinoOTA.path=/Applications/Arduino.app/Contents/Java/hardware/tools/avr -verbose /Users/chrisfisher/Documents/Arduino/smart_plant_water2/smart_plant_water2.ino
Using board 'uno' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Using core 'arduino' from platform in folder: /Applications/Arduino.app/Contents/Java/hardware/arduino/avr
Detecting libraries used...
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849/sketch/smart_plant_water2.ino.cpp" -o "/dev/null"
Generating function prototypes...
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -flto -w -x c++ -E -CC -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849/sketch/smart_plant_water2.ino.cpp" -o "/var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849/preproc/ctags_target_for_gcc_minus_e.cpp"
"/Applications/Arduino.app/Contents/Java/tools-builder/ctags/5.8-arduino11/ctags" -u --language-force=c++ -f - --c++-kinds=svpf --fields=KSTtzns --line-directives "/var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849/preproc/ctags_target_for_gcc_minus_e.cpp"
Compiling sketch...
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-g++" -c -g -Os -w -std=gnu++11 -fpermissive -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -flto -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10803 -DARDUINO_AVR_UNO -DARDUINO_ARCH_AVR "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/cores/arduino" "-I/Applications/Arduino.app/Contents/Java/hardware/arduino/avr/variants/standard" "/var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849/sketch/smart_plant_water2.ino.cpp" -o "/var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849/sketch/smart_plant_water2.ino.cpp.o"
Compiling libraries...
Compiling core...
Using precompiled core
Linking everything together...
"/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/avr-gcc" -w -Os -g -flto -fuse-linker-plugin -Wl,--gc-sections -mmcu=atmega328p -o "/var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849/smart_plant_water2.ino.elf" "/var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849/sketch/smart_plant_water2.ino.cpp.o" "/var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849/../arduino_cache_147696/core/core_arduino_avr_uno_51f02b7210b938436b779d1c032618e1.a" "-L/var/folders/vq/93q1xgpx4v30m70p7zmzhn_w0000gn/T/arduino_build_378849" -lm
/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../lib/gcc/avr/4.9.2/../../../../avr/bin/ld: /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so: error loading plugin: dlopen(/Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so, 2): Symbol not found: _environ
Referenced from: /Applications/Arduino.app/Contents/Java/hardware/tools/avr/bin/../libexec/gcc/avr/4.9.2/liblto_plugin.so
Expected in: /usr/lib/libSystem.B.dylib
collect2: error: ld returned 1 exit status
exit status 1
Error compiling for board Arduino/Genuino Uno.
Looks like this has been asked before.
That reply was a while ago. If you happen to have the same older version, maybe try updating instead of downgrading the board. Works in v1.6.18 for me.
bDeters:
Looks like this has been asked before.
That reply was a while ago. If you happen to have the same older version, maybe try updating instead of downgrading the board. Works in v1.6.18 for me.
Yeah..... I had weird stuff like that happening when I was using an older version of arduino IDE ... like 1.6.5 or something on my win 8 system. And then.... after a heck of a lot of time trying to figure out the issue... I updated to 1.8 .... and magically everything was ok after that.
i've got 1.8.3. If i go online and verify it with arduino create i don't have a problem, but the downloaded software for arduino create don't work, it has an error when installing.
crash111f:
i've got 1.8.3.
I wasn't talking about the IDE. The version number I was referring to was the board profile version as shown in that post I linked. I was using v1.6.18 but the latest is v1.6.19 for the Uno.
i have the latest version. i even went into board mngr and tried downloading some of the older versions but none of them worked.
pert
July 9, 2017, 3:08pm
9
Try Arduino IDE 1.6.9 with Arduino AVR Boards 1.6.11