I just got my Arduino and have almost no experience with it. I bought a beginners book with some C coding basics and several Arduino projects to get started. I am in my fifth project (a set of 10 LED's that turn on and off in a sequence) and, for the first time, I am getting a compiling code error that I cannot figure out how to solve. This is my code:
//proyect 5 - LED Chase Effect
byte ledPin[] = {4,5,6,7,8,9,10,11,12,13};
//create array for LED pins
int ledDelay(65);
//delay between changes
int direction = 1;
int currentLED = 0;
unsigned long changeTime;
void setup() {
for (int x=0; x<10; x++)
{ //set all pins to output
pinMode(ledPin[ x ]. OUTPUT);
}
changeTime = millis();
}
void loop(){
if((millis() - changeTime) > ledDelay) {
//if it has been ledDelay ms since last change
changeLED();
changeTime = millis();
}
}
void changeLED(){
for (int x=0; x<10; x++)
{ //turn off all LED's
digitalWrite(ledPin[ x ], LOW);
}
digitalWrite(ledPin[currentLED], HIGH);
//turn on the current LED
currentLED += direction;
//increment by the direction value
//change direction if we reach end
if (currentLED == 9)
{direction = -1;}
if (currentLED == 0)
{direction = 1;}
}
And this is the error that I get:
exit status 1
Error compiling for board Arduino/Genuino Uno.
How can I solve this?
Thanks for the help!
And this is the error that I get:
exit status 1
Error compiling for board Arduino/Genuino Uno.
That is not the complete error because it should give you the line number of the error.
Please read the post by Nick Gammon at the top of this Forum about the proper way to post code using code tags. Also, before posting, use Ctrl-T in the IDE to reformat your code into a standard style. These changes will help us help you.
You have a period where a comma should be:
...
pinMode(ledPin[ x ]. OUTPUT);
...
Except for using code tags. the following
Place your cursor in the output window, scroll up and look at ALL orange lines to determine what goes wrong. Copy and paste them here.
In file included from C:\Users\sterretje\AppData\Local\Temp\build23a1ad29cfbc8c1befc710952816a949.tmp\sketch\sketch_jul03a.ino.cpp:1:0:
C:\Users\sterretje\AppData\Local\Temp\arduino_23a1ad29cfbc8c1befc710952816a949\sketch_jul03a.ino: In function 'void setup()':
C:\Program Files (x86)\Arduino\hardware\arduino\avr\cores\arduino/Arduino.h:44:16: error: expected unqualified-id before numeric constant
#define OUTPUT 0x1
^
C:\Users\sterretje\AppData\Local\Temp\arduino_23a1ad29cfbc8c1befc710952816a949\sketch_jul03a.ino:14:26: note: in expansion of macro 'OUTPUT'
pinMode(ledPin[ x ]. OUTPUT);
^
exit status 1
Error compiling.
Although one usually handles errors from top to bottom, in this case you have to turn it around and have a look at the 'pinMode' line. Hint: pinMode takes two arguments, you only pass it one.
ChrisTenone, you solved the problem! I had a dot instead of a comma here:
...
pinMode(ledPin[ x ]. OUTPUT);
...
Stupid mistake, but it wasn't showing up in the error window, I don't know why. Anyways, thanks for the help!
It deos show up in the error window as I showed in reply #4
#include <LiquidCrystal.h> //Include LCD library
#include <GSM.h> // Include the GSM library
#include <SoftwareSerial.h>
SoftwareSerial mySerial(9, 10); // RX,TX
LiquidCrystal lcd(12, 11, 5, 4, 3, 2); // initialize the library with the numbers of the interface pins
GSM gsmAccess; // initialize the library instance
GSM_SMS sms;
void SetAlert()
{
int sms_count = 1;
float Fire_Set;
while (sms_count < 3) //Number of SMS Alerts to be sent
{
SendTextMessage(); // Function to send AT Commands to GSM module
}
Fire_Set = 1;
lcd.setCursor(0, 1);
lcd.print("Gas Alert!SMS Sent");
}
void SendTextMessage()
{
int sms_count;
mySerial.println("AT+CMGF=1"); //To send SMS in Text Mode
delay(2000);
mySerial.println("AT+CMGS=\"+96171797525\"\r"); // change to the phone number you using
delay(2000);
mySerial.println("GAS IN THE KITCHEN HURRY UP");//the content of the message
delay(200);
mySerial.println((char)50);//the stopping character
delay(5000);
sms_count++;
}
int potPin = A4;
int potValue = 0;
int buzzer = 6;
int sms_count = 0;
void setup() {
lcd.begin(16, 2); // lcd rows and columns
lcd.print("GAS SENSOR");
pinMode(6, OUTPUT);
mySerial.begin(9600);
Serial.begin(9600);
lcd.begin(16, 2);
delay(500);
}
void loop() {
potValue = analogRead(potPin);
lcd.setCursor(0, 1);
lcd.print("Value = ");
lcd.print(potValue);
delay(1000);
lcd.print(" ");
delay(1);
if (potValue > 200)
{
SetAlert(); // Function to send SMS Alerts
digitalWrite(6, HIGH); // 6 is the digital pin on arduino connected to buzzer
delay(100);
}
}
i got this error
When I compiled your code, I got:
SoftwareSerial\SoftwareSerial.cpp.o: In function `__vector_3':
C:\Users\PaulS\Documents\Arduino_160\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:227: multiple definition of `__vector_3'
GSM\GSM3SoftSerial.cpp.o:C:\Users\PaulS\Documents\Arduino_160\libraries\GSM\src/GSM3SoftSerial.cpp:499: first defined here
SoftwareSerial\SoftwareSerial.cpp.o: In function `SoftwareSerial::read()':
C:\Users\PaulS\Documents\Arduino_160\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:392: multiple definition of `__vector_4'
GSM\GSM3SoftSerial.cpp.o:C:\Users\PaulS\Documents\Arduino_160\libraries\GSM\src/GSM3SoftSerial.cpp:487: first defined here
SoftwareSerial\SoftwareSerial.cpp.o: In function `SoftwareSerial::read()':
C:\Users\PaulS\Documents\Arduino_160\hardware\arduino\avr\libraries\SoftwareSerial/SoftwareSerial.cpp:392: multiple definition of `__vector_5'
GSM\GSM3SoftSerial.cpp.o:C:\Users\PaulS\Documents\Arduino_160\libraries\GSM\src/GSM3SoftSerial.cpp:487: first defined here
collect2.exe: error: ld returned 1 exit status
Error compiling.
You can NOT use SoftwareSerial and GSM at the same time.
Hi George, please do not hijack someone else's thread. Start your own and read the guidelines.
Thanks.
Using Arduino 1.8, uninstalled and re-installed Arduino
6 core, 16 gig RAM, 4k monitor, 8 gig video. Windows 10, McAafee .
just purchased 2 Adruino UNO (not clone or knock offs, original)
getting the following error when trying to verify (or compile) the "blink" program
or any other one as well.
A-HA, THE ISSUE IS THE McAfee VIRUS DETECTION PROGRAM
TURNED IT OFF AND EVERYTHING WORKS GREAT
Arduino: 1.8.0 (Windows 10), Board: "Arduino/Genuino Uno"
.
.
c:\arduino\hardware\tools\avr\bin\../lib/gcc/avr/4.9.2/../../../../avr/bin/ar.exe:
unable to rename
'C:\Users\JAZYCO~1\AppData\Local\Temp\arduino_build_641869\core\core.a';
reason: Permission denied
exit status 1
Error compiling for board Arduino/Genuino Uno.
Thanks for any input
Howzit guys I am having the same problem. tried everything here but no luck getting it to work. Any advice???
I am using an Arduino Uno R3 and an Elecfreaks CANBUS shield.
I am not sure whats going on whether I need to upload another library (got the code off a site where they used a sparkfun CANBUS shield)
My code is as follows:
#include <Canbus.h> // don't forget to include these
#include <defaults.h>
#include <global.h>
#include <mcp2515.h>
#include <mcp2515_defs.h>
void setup() {
Serial.begin(9600); // For debug use
Serial.println("CAN Read - Testing receival of CAN Bus message");
delay(1000);
if (Canbus.init(CANSPEED_500)) //Initialise MCP2515 CAN controller at the specified speed
Serial.println("CAN Init ok");
else
Serial.println("Can't init CAN");
delay(1000);
}
void loop() {
tCAN message;
if (mcp2515_check_message())
{
if (mcp2515_get_message(&message))
{
if (message.id == 0x620 and message.data[2] == 0xFF) //uncomment when you want to filter
{
Serial.print("ID: ");
Serial.print(message.id, HEX);
Serial.print(", ");
Serial.print("Data: ");
Serial.print(message.header.length, DEC);
for (int i = 0; i < message.header.length; i++)
{
Serial.print(message.data, HEX);
Serial.print(" ");
}
Serial.println("");
}
}
}
}
The error code is as follows:
Arduino: 1.6.13 (Windows 10), Board: "Arduino/Genuino Uno"
fatal error: Canbus.h: No such file or directory
#include <Canbus.h> // don't forget to include these
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
@JacquesNel
Please post code using code tags so the code does not randomly changes to italics and info falls away. Please edit your post.
You have not installed the library or installed it incorrectly.
Apologies for that will do that in the future.
I have installed the CAN BUS library and have been sending messeges over CANBUS from one arduino to the other as a test and everything worked perfectly. Could it be that I need another library added?
I have read that some guys install the Seeed library do you think this will fix my problem
thanks for the reply
Arduino: 1.8.1 (Windows Store 1.8.1.0) (Windows 10), Board: "Arduino/Genuino Uno"
C:\Users\noupa\AppData\Local\Temp\Temp1_RFIDuinoLibrary-master.zip\RFIDuinoLibrary-master\RFIDuino\examples\RFIDuino_helloWorld\RFIDuino_helloWorld.ino:36:53: fatal error: RFIDuino.h: No such file or directory
#include <RFIDuino.h> //include the RFIDuino Library
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
I am new to this stuff but love it.
Does anyone know why this error show and I am unable to compile or upload Hello World and Demo3 for IFID project. Please help! Thanks,
@MyNameIsNoukane
It looks like you're directly opening the ino file from within the zip file; I might be wrong. Not sure if that will work.
If you're indeed opening the ino file in the zip file, extract the zip file to a directory of choice first and next open the ino file in that directory; next compile.
#include
int RECV_PIN = 3;
IRrecv irrecv(RECV_PIN);
decode-results results;
void setup()
{
Serial.begin(9600);
irrecv.enableIRIn();
pinMode(13,OUTPUT);
}
void loop()
{
if (irrecv.decode(&results)) {// irrecv.decode(&results)
Serial.println(results.value, HEX);
if(results.value==0xFA08F7)
{
digitalWrite(13,HIGH);
else
digitalWrite(13,LOW);
delay(300);
irrecv.resume ();
}
}
Exit status 1
Error compiling for board arduino/genuino uno
#include
Include what?
not sure why
but I removed the in-line comments and now I can compile.
Guys,
I'm a newbie and trying to do a home-security system for school project. I did research on the internet an found a site with subject. Unfortunately, when I tried to run mine, I keep getting compile error (exit 1). I went line by line and could not find anything.
Can you pleas help? Thank you in advance.
#include <Keypad.h>
#include<LiquidCrystal.h>
#include<EEPROM.h>
LiquidCrystal lcd(9, 8, 7, 6, 5, 4);
char password[4];
char pass[4], pass1[4];
int i = 0;
char customKey = 0;
const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
char hexaKeys[ROWS][COLS] = {
{'1', '2', '3', 'A'},
{'4', '5', '6', 'B'},
{'7', '8', '9', 'C'},
{'*', '0', '#', 'D'}
};
byte rowPins[ROWS] = {A0, A1, A2, A3}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {A4, A5, 3, 2}; //connect to the column pinouts of the keypad
//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS);
int led;
int buzzer = 10;
int m11;
int m12;
void setup()
{
Serial.begin(9600);
pinMode(11, OUTPUT);
lcd.begin(16, 2);
pinMode(led, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(m11, OUTPUT);
pinMode(m12, OUTPUT);
lcd.print(" Electronic ");
Serial.print(" Electronic ");
lcd.setCursor(0, 1);
lcd.print(" Keypad Lock ");
Serial.print(" Keypad Lock ");
delay(2000);
lcd.clear();
lcd.print("Enter Ur Passkey:");
Serial.println("Enter Ur Passkey:");
lcd.setCursor(0, 1);
for (int j = 0; j < 4; j++)
EEPROM.write(j, j + 49);
for (int j = 0; j < 4; j++)
pass[j] = EEPROM.read(j);
}
void loop()
{
digitalWrite(11, HIGH);
customKey = customKeypad.getKey();
if (customKey == '#')
change();
if (customKey)
{
password[i++] = customKey;
lcd.print(customKey);
Serial.print(customKey);
beep();
}
if (i == 4)
{
delay(200);
for (int j = 0; j < 4; j++)
pass[j] = EEPROM.read(j);
if (!(strncmp(password, pass, 4)))
{
digitalWrite(led, HIGH);
beep();
lcd.clear();
lcd.print("Passkey Accepted");
Serial.println("Passkey Accepted");
digitalWrite(11, LOW);
delay(2000);
lcd.setCursor(0, 1);
lcd.print("#.Change Passkey");
Serial.println("#.Change Passkey");
delay(2000);
lcd.clear();
lcd.print("Enter Passkey:");
Serial.println("Enter Passkey:");
lcd.setCursor(0, 1);
i = 0;
digitalWrite(led, LOW);
}
else
{
digitalWrite(11, HIGH);
digitalWrite(buzzer, HIGH);
lcd.clear();
lcd.print("Access Denied...");
Serial.println("Access Denied...");
lcd.setCursor(0, 1);
lcd.print("#.Change Passkey");
Serial.println("#.Change Passkey");
delay(2000);
lcd.clear();
lcd.print("Enter Passkey:");
Serial.println("Enter Passkey:");
lcd.setCursor(0, 1);
i = 0;
digitalWrite(buzzer, LOW);
}
}
}
void change()
{
int j = 0;
lcd.clear();
lcd.print("UR Current Passk");
Serial.println("UR Current Passk");
lcd.setCursor(0, 1);
while (j < 4)
{
char key = customKeypad.getKey();
if (key)
{
pass1[j++] = key;
lcd.print(key);
Serial.print(key);
beep();
}
key = 0;
}
delay(500);
if ((strncmp(pass1, pass, 4)))
{
lcd.clear();
lcd.print("Wrong Passkey...");
Serial.println("Wrong Passkey...");
lcd.setCursor(0, 1);
lcd.print("Better Luck Again");
Serial.println("Better Luck Again");
delay(1000);
}
else
{
j = 0;
lcd.clear();
lcd.print("Enter New Passk:");
Serial.println("Enter New Passk:");
lcd.setCursor(0, 1);
while (j < 4)
{
char key = customKeypad.getKey();
if (key)
{
pass[j] = key;
lcd.print(key);
Serial.print(key);
EEPROM.write(j, key);
j++;
beep();
}
}
lcd.print(" Done......");
Serial.println(" Done......");
delay(1000);
}
lcd.clear();
lcd.print("Enter Ur Passk:");
Serial.println("Enter Ur Passk:");
lcd.setCursor(0, 1);
customKey = 0;
}
void beep()
{
digitalWrite(buzzer, HIGH);
delay(20);
digitalWrite(buzzer, LOW);
}
dglnk,
Generally folks here are glad to help with school projects, but you should start a new thread that just focusses on your project. It was GREAT that you posted your code, but there is a better way to do that. Please read the "asking-for-help" guidelines in the thread called "How to use this forum - please read. (http://forum.arduino.cc/index.php?topic=149014.0)". That way your project will attract the best, and most encouraging help.
Good luck, and welcome to the forum!
I keep getting compile error (exit 1).
There is almost certainly more to the error message than that
When I compile it for a Uno using IDE 1.5.6-r2 on Windows 7 the only message that I get is
Sketch uses 6,822 bytes (21%) of program storage space. Maximum is 32,256 bytes.
Global variables use 596 bytes (29%) of dynamic memory, leaving 1,452 bytes for local variables. Maximum is 2,048 bytes.
in other words, no error
use Ctrl-T in the IDE to reformat your code into a standard style.
Thanks. It really helped me in another code thought.
look i have the same proplem can someone please help me?
//Use pushbotton as a toggle switch.
//When the pushbotton is pressed, the pushbotton pin reads a
//high voltage and then a low voltage, and then ledOn is set
//to the opposite of its current value (either false or true).
//Based on Starter Kit Project 02.
#include "pitches.h"
const int piezoPin = 12; //piezo
const int rPin = 5; //red LED
const int gPin = 4; //green LED
const int bPin = 3; //blue LED
const int pPin = 2; //pushbutton
int ledState = 0;
int ledOn = false;
// notes
int melody[] = {
NOTE_F5,NOTE_D5,NOTE_AS4,NOTE_D5,NOTE_F5,NOTE_AS5,NOTE_D6,NOTE_C6,NOTE_AS5,NOTE_D5,NOTE_E5,NOTE_F5,
NOTE_F5,NOTE_F5,NOTE_D6,NOTE_C6,NOTE_AS5,NOTE_A5,NOTE_G5,NOTE_A5,NOTE_AS5,NOTE_AS5,NOTE_F5,NOTE_D5,NOTE_AS4,
NOTE_D6,NOTE_D6,NOTE_D6,NOTE_DS6,NOTE_F6,NOTE_F6,NOTE_DS6,NOTE_D6,NOTE_C6,NOTE_D6,NOTE_DS6,NOTE_DS6,
0,NOTE_DS6,NOTE_D6,NOTE_C6,NOTE_AS5,NOTE_A5,NOTE_G5,NOTE_A5,NOTE_AS5,NOTE_D5,NOTE_E5,NOTE_F5,
NOTE_F5,NOTE_AS5,NOTE_AS5,NOTE_AS5,NOTE_A5,NOTE_G5,NOTE_G5,NOTE_G5,NOTE_C6,NOTE_DS6,NOTE_D6,NOTE_C6,NOTE_AS5,NOTE_AS5,NOTE_A5,
NOTE_F5,NOTE_F5,NOTE_AS5,NOTE_C6,NOTE_D6,NOTE_DS6,NOTE_F6,NOTE_AS5,NOTE_C6,NOTE_D6,NOTE_DS6,NOTE_C6,NOTE_AS5
};
// durations: 2 = half note, and 8/3,4,6,8,12. It appears that 8/2.9 is more accurate than 8/3.
float noteDurations[] = {
6,12,4,4,4,2,6,12,4,4,4,2,
8,8,8/2.9,8,4,2,8,8,4,4,4,4,4,
6,12,4,4,4,2,8,8,4,4,4,2,
8,8,8/2.9,8,4,2,8,8,4,4,4,2,
4,4,4,8,8,4,4,4,4,8,8,8,8,4,4,
8,8,8/2.9,8,8,8,2,8,8,4,4,4,2
};
// calculates the number of elements in the melody array.
int musicLength=sizeof(melody)/sizeof('NOTE_F5');
void setup() {
pinMode(pPin, INPUT);
pinMode(rPin, OUTPUT);
pinMode(gPin, OUTPUT);
pinMode(bPin, OUTPUT);
}
void loop() {
int pPinState=digitalRead(pPin);
if(pPinState==HIGH) {
ledState = 1;
}
if (pPinState==LOW and ledState ==1) {
ledState = 2;
ledOn = not ledOn;
}
if (ledOn && pPinState!=HIGH) {
for (int thisNote = 0; thisNote < musicLength; thisNote++) {
// blink the three LEDs in sequence
if (thisNote%3==0){
digitalWrite(rPin, HIGH);
digitalWrite(gPin, LOW);
digitalWrite(bPin, LOW);
}
else if (thisNote%3==1){
digitalWrite(rPin, LOW);
digitalWrite(gPin, HIGH);
digitalWrite(bPin, LOW);
}
else if (thisNote%3==2){
digitalWrite(rPin, LOW);
digitalWrite(gPin, LOW);
digitalWrite(bPin, HIGH);
}
// calculate the note duration. change tempo by changing 2000 to other values
int noteDuration = 2000/noteDurations[thisNote];
tone(piezoPin, melody[thisNote],noteDuration);
// to distinguish the notes, set a minimum time between them.
// the note's duration + 30% seems to work well
float pauseBetweenNotes = noteDuration * 1.30;
//split the delay into two parts and check to see
//whether the pushbutton is pressed to turn off
//the sound and light
delay(pauseBetweenNotes/2);
if(digitalRead(pPin)==HIGH) {
break;
}
delay(pauseBetweenNotes/2);
if(digitalRead(pPin)==HIGH) {
break;
}
}
}
else if (not ledOn) {
digitalWrite(rPin, LOW);
digitalWrite(gPin, LOW);
digitalWrite(bPin, LOW);
}
}
look i have the same proplem can someone please help me?
What problem would that be ?
What problem would that be ?
One of his problems is that he didn't read the earlier post that asks posters to read Nick Gammon's
How To Use This Site post at the top of the Forum, or using code tags to post their code.
I don't know of a help for that problem though.
Doesn't that same post say to start yer own thread, rather than just hijack one (especially if it says "solved", cause then nobody will read it.)
Why am I getting error compiling for arduino/genuino uno*// NeoPixel Ring simple sketch (c) 2013 Shae Erisson
// released under the GPLv3 license to match the rest of the AdaFruit NeoPixel library
#include <Adafruit_NeoPixel.h>
#ifdef __AVR__
#include <avr/power.h>
#endif
// Which pin on the Arduino is connected to the NeoPixels?
// On a Trinket or Gemma we suggest changing this to 1
#define PIN 6
// How many NeoPixels are attached to the Arduino?
#define NUMPIXELS 24
// When we setup the NeoPixel library, we tell it how many pixels, and which pin to use to send signals.
// Note that for older NeoPixel strips you might need to change the third parameter--see the strandtest
// example for more information on possible values.
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);
int delayval = 500; // delay for half a second
void setup() {
// This is for Trinket 5V 16MHz, you can remove these three lines if you are not using a Trinket
#if defined (__AVR_ATtiny85__)
if (F_CPU == 16000000) clock_prescale_set(clock_div_1);
#endif
// End of trinket special code
pixels.begin(); // This initializes the NeoPixel library.
}
void loop() {
// For a set of NeoPixels the first NeoPixel is 0, second is 1, all the way up to the count of pixels minus one.
for(int i=0;i<NUMPIXELS;i++){
// pixels.Color takes RGB values, from 0,0,0 up to 255,255,255
pixels.setPixelColor(i, pixels.Color(0,150,0)); // Moderately bright green color.
pixels.show(); // This sends the updated pixel color to the hardware.
delay(delayval); // Delay for a period of time (in milliseconds).
}
}
*/
void setup() {
}
void loop() {
}
2 setup() and 2 loop() functions will cause a problem to start with
and what is this all about ?
*/
Seems like a block comment went wrong
2 setup() and 2 loop() functions will cause a problem to start with
and what is this all about ?
*/
Seems like a block comment went wrong
But, but Bob! This is the reading comprehension thread!
Arduino:1.6.12 (Windows 10), 板子:"Arduino/Genuino Uno"
C:\Users\user\Desktop\Arduino\colcor_led_ctrl\colcor_led_ctrl.ino:1:28: fatal error: softwareserial.h: No such file or directory
#include <softwareserial.h>
^
compilation terminated.
exit status 1
板子Arduino/Genuino Uno編譯錯誤
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
HOW DO I DO ?
TELL ME WHAT HAPPEND?
SoftwareSerial.h
/Users/Amelnychuk/Documents/Arduino/sketch_sep15a/sketch_sep15a.ino:7:31: fatal error: Adafruit_NeoPixel.h: No such file or directory
#include <Adafruit_NeoPixel.h>
^
compilation terminated.
exit status 1
Error compiling for board Arduino/Genuino Uno.
@amelnychuk
Looks like you did not install (or incorrectly installed) the library.
Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"
open sketch\sketch_oct25a.ino.cpp: Access is denied.
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Arduino: 1.8.5 (Windows 10), Board: "Arduino/Genuino Uno"
open sketch\sketch_oct25a.ino.cpp: Access is denied.
Error compiling for board Arduino/Genuino Uno.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
Check permissions on the folders in question. Check that no overzealous security/antivirus software is blocking it.
Verbose upload output will show the full path to the file before the error; that may be useful.
Also, in the future, do not hijack threads with unrelated issues (though it seems like you're not the first person doing that in this thread ::) ); you are getting a totally different error than the other posters here.
YOU FORGOT TO PUT THE IRLibrairy in the doc folder...
i have same error
#include <Servo.h> //call servo library
#include <boarddefs.h> //call ir library
#include <IRremote.h>//call ir library
#include <IRremoteInt.h>//call ir library
#include <ir_Lego_PF_BitStreamEncoder.h>//call ir library
Servo myservo; //for declear 1st servo
Servo myservo1; //for declear 2nd servo
int RECV_PIN = 2; // the pin where you connect the output pin of TSOP4838
int itsONled[] = {0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0};
int ledPin0 = 13; //bot 1 yellow
int ledPin1 = 12; //bot2 red
int ledPin2 = 11; // bot3 whie
int redLed = 4; // alert for gas environment
int greenLed = 3; // normal environment
int smokeA0 = A5; // gas sensor input
int sensorThres = 400; //gas sensor
int buzzer = 9; // for gas sensor alert
char data = 0;
int state ;
int flag = 0; // for bluetooth to send signals
int pos = 0;
int inputPin = 6; // choose the input pin (for PIR sensor)
int pirState = LOW; // we start, assuming no motion detected
int val = 1; // variable for reading the pin status
int ledPin00 = 5; // choose the pin for the LED
#define code1 12495 // code received from button A
#define code2 6375 // code received from button B
#define code3 31365 // code received from button C
#define code7 41565 // code received from button C
IRrecv irrecv(RECV_PIN);
decode_results results;
void setup() {
irrecv.enableIRIn(); // Start the receiver
Serial.begin(9600); // Default communication rate of the Bluetooth module
pinMode(ledPin0, OUTPUT);
digitalWrite(ledPin0, LOW);
pinMode(ledPin1, OUTPUT);
digitalWrite(ledPin1, LOW);
pinMode(ledPin2, OUTPUT);
digitalWrite(ledPin2, LOW);
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
pinMode(redLed, OUTPUT);
pinMode(greenLed, OUTPUT);
pinMode(buzzer, OUTPUT);
pinMode(smokeA0, INPUT);
myservo.attach(2);
myservo1.attach(4);
myservo.write(90);
myservo1.write(90);
delay(0);
pinMode(ledPin00, OUTPUT); // declare LED as output
}
void loop() {
{
val = digitalRead(inputPin); // read input value
if (val == HIGH) { // check if the input is HIGH
digitalWrite(ledPin00, HIGH); // turn LED ON
if (pirState == LOW) {
// we have just turned on
tone(buzzer, 1000, 200);
Serial.println("Motion detected!");
// We only want to print on the output change, not state
pirState = HIGH;
}
} else {
digitalWrite(ledPin00, LOW); // turn LED OFF
if (pirState == HIGH) {
// we have just turned of
Serial.println("Motion ended!");
// We only want to print on the output change, not state
pirState = LOW;
noTone(buzzer);
}
if (Serial.available() > 0) { // Checks whether data is comming from the serial port
state = Serial.read(); // Reads the data from the serial port
}
if (state == '0') {
digitalWrite(ledPin0, LOW); // Turn LED OFF
Serial.println("LED: OFF"); // Send back, to the phone, the String "LED: ON"
state = 0;
}
else if (state == '1') {
digitalWrite(ledPin0, HIGH);
Serial.println("LED: ON");;
state = 0;
}
{
if (Serial.available() > 0) { // Checks whether data is comming from the serial port
state = Serial.read(); // Reads the data from the serial port
}
if (state == '2') {
digitalWrite(ledPin1, LOW); // Turn LED OFF
Serial.println("LED: OFF"); // Send back, to the phone, the String "LED: ON"
state = 0;
}
else if (state == '3') {
digitalWrite(ledPin1, HIGH);
Serial.println("LED: ON");;
state = 0;
}
{
if (Serial.available() > 0) { // Checks whether data is comming from the serial port
state = Serial.read(); // Reads the data from the serial port
}
if (state == '4') {
digitalWrite(ledPin2, LOW); // Turn LED OFF
Serial.println("LED: OFF"); // Send back, to the phone, the String "LED: ON"
state = 0;
}
else if (state == '5') {
digitalWrite(ledPin2, HIGH);
Serial.println("LED: ON");;
state = 0;
}
{
int analogSensor = analogRead(smokeA0);
Serial.print("Pin A0: ");
Serial.println(analogSensor);
// Checks if it has reached the threshold value
if (analogSensor > sensorThres)
{
digitalWrite(redLed, HIGH);
digitalWrite(greenLed, LOW);
tone(buzzer, 1000, 200);
}
else
{
digitalWrite(redLed, LOW);
digitalWrite(greenLed, HIGH);
noTone(buzzer);
}
delay(100);
}
{
if (Serial.available() > 0)
{
state = Serial.read();
flag = 0;
} // if the state is '0' the DC motor will turn off
if (state == '6')
{
myservo.write(8);
delay(0);
Serial.println("Door Locked");
}
else if (state == '7')
{
myservo.write(360);
delay(0);
Serial.println("Door UnLocked");
}
{
if (Serial.available() > 0)
{
state = Serial.read();
flag = 0;
} // if the state is '0' the DC motor will turn off
if (state == '8')
{
myservo1.write(8);
delay(0);
Serial.println("Door Locked");
}
else if (state == '9')
{
myservo1.write(360);
delay(0);
Serial.println("Door UnLocked");
{
if (irrecv.decode(&results)) {
unsigned int value = results.value;
switch (value) {
case code1:
if (itsONled[1] == 1) { // if first led is on then
digitalWrite(ledPin0, LOW); // turn it off when button is pressed
itsONled[1] = 0; // and set its state as off
} else { // else if first led is off
digitalWrite(ledPin0, HIGH); // turn it on when the button is pressed
itsONled[1] = 1; // and set its state as on
}
break;
case code2:
if (itsONled[2] == 1) {
digitalWrite(ledPin1, LOW);
itsONled[2] = 0;
} else {
digitalWrite(ledPin1, HIGH);
itsONled[2] = 1;
}
break;
case code3:
if (itsONled[3] == 1) {
digitalWrite(ledPin2, LOW);
itsONled[3] = 0;
} else {
digitalWrite(ledPin2, HIGH);
itsONled[3] = 1;
}
break;
case code7:
if (itsONled[1, 2, 3, 5, 6] == 1) { // if first led is on then
digitalWrite(ledPin0, LOW); // turn it off when button is pressed
digitalWrite(ledPin1, LOW);
digitalWrite(ledPin2, LOW);
itsONled[1, 2, 3, 4, 5, 6] = 0; // and set its state as off
} else { // else if first led is off
digitalWrite(ledPin0, HIGH); // turn it on when the button is pressed
digitalWrite(ledPin1, HIGH);
digitalWrite(ledPin2, HIGH);
itsONled[1, 2, 3, 5, 6] = 1; // and set its state as on
}
break;
}
Serial.println(value); // you can comment this line
irrecv.resume(); // Receive the next value
}
}
}
}
}
}
}
}
}
}
i have same error
...
Wow! That's a lot of code! Please read the "How to use this forum" thread, follow the directions, and you will likely get some help with yout problem.
i have same error
I somehow doubt you have the same error. It happily compiles on my system but does not link.
Linking everything together...
...
...
Tone.cpp.o (symbol from plugin): In function `timer0_pin_port':
(.text+0x0): multiple definition of `__vector_7'
C:\Users\sterretje\AppData\Local\Temp\arduino_build_878941\libraries\IRremote\IRremote.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Using library Servo at version 1.1.2 in folder: C:\Program Files (x86)\Arduino\libraries\Servo
Using library IRremote at version 2.2.3 in folder: C:\Users\sterretje\Documents\Arduino\libraries\IRremote
exit status 1
Error compiling for board Arduino/Genuino Uno.
Once you manage to fix that, you get
Linking everything together...
...
...
C:\Users\sterretje\AppData\Local\Temp\arduino_build_878941\libraries\IRremote\IRremote.cpp.o (symbol from plugin): In function `MATCH(int, int)':
(.text+0x0): multiple definition of `__vector_11'
C:\Users\sterretje\AppData\Local\Temp\arduino_build_878941\libraries\Servo\avr\Servo.cpp.o (symbol from plugin):(.text+0x0): first defined here
collect2.exe: error: ld returned 1 exit status
Using library Servo at version 1.1.2 in folder: C:\Program Files (x86)\Arduino\libraries\Servo
Using library IRremote at version 2.2.3 in folder: C:\Users\sterretje\Documents\Arduino\libraries\IRremote
exit status 1
Error compiling for board Arduino/Genuino Uno.
I'm not sure if there is a way around those two interrupts conflicts. Getting rid of tone functions is one option; using a board with a CPU that has more timers (e.g. Leonardo, Mega) is another one.
hello! i started doing a project on lcd_game this is how it came out. please help!
Arduino: 1.8.5 (Mac OS X), Board: "Arduino/Genuino Uno"
Sketch uses 3792 bytes (11%) of program storage space. Maximum is 32256 bytes.
Global variables use 163 bytes (7%) of dynamic memory, leaving 1885 bytes for local variables. Maximum is 2048 bytes.
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 1 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 2 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 3 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 4 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 5 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 6 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 7 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 8 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 9 of 10: not in sync: resp=0x00
avrdude: stk500_recv(): programmer is not responding
avrdude: stk500_getsync() attempt 10 of 10: not in sync: resp=0x00
Problem uploading to board. See http://www.arduino.cc/en/Guide/Troubleshooting#upload for suggestions.
This report would have more information with
"Show verbose output during compilation"
option enabled in File -> Preferences.
@srisowmya
Correct port selected?
And this is not a programming question.