Заранее прошу извинить, работаю в IDE только второй день.
Скачал с Github библиотеку IRremote. Пробовал её приссоединить сначала через Library Manager, потом с помошью инклуд ZIP.
В обоих случаях компилятор библиотеку не распознаёт. Думаю, что делаю тупую ошибку начинающего. Буду благодарен за любую помощь.
Правильно думаете.
Код надо выложить текстом и не как попало, а как написано в пустом окне сообщения.
Также текстом надо выложить ПОЛНЫЙ копипаст сообщения об ошибке.
Сделайте это, тогда поговорим.
1 лайк
‘’’
#include <IRremote.h>
IRsend irsend;
void setup()
{
Serial.begin(9600);
pinMode(5, INPUT_PULLUP); // SW1 connected to pin 5
pinMode(6, INPUT_PULLUP); // SW2 connected to pin 6
pinMode(7, INPUT_PULLUP); // SW3 connected to pin 7
pinMode(3, OUTPUT); // The IR LED is connected to pin 3 (PWM ~) on the Arduino
}
void loop()
{
if (digitalRead(5) == LOW) { // When SW1 is pressed
irsend.sendNEC(0x34895725, 32); // Replace with your own unique code
Serial.println(“Code sent!”);
delay(30);
}
else if (digitalRead(6) == LOW) { // When SW2 is pressed
irsend.sendNEC(0x56874159, 32); // Replace with your own unique code
Serial.println(“Code sent!”);
delay(30);
}
else if (digitalRead(7) == LOW) { // When SW3 is pressed
irsend.sendNEC(0x15467823, 32); // Replace with your own unique code
Serial.println(“Code sent!”);
delay(30);
}
else {
Serial.println(“Nothing to send”);
delay(30);
}
delay(100);
}
‘’’
Arduino: 1.8.19 (Windows 10), Board: “Arduino Uno”
IR_Trans:1:10: fatal error: IRremote.h: No such file or directory
Multiple libraries were found for “IRremote.h”
compilation terminated.
Used: C:\Users\97258\OneDrive\Документы\Arduino\libraries\IRremote
Not used: C:\Users\97258\OneDrive\Документы\Arduino\libraries\IRremote-4.4.1
exit status 1
IRremote.h: No such file or directory
This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.
Вообще мы тут не принимаем вставку текстовой информации картинками.
Хотя в твоем случае требования коллеги о вставке текстом - самодурство.
Но это никак не извиняет твое невнимание.
СМОТРИ ПРИМЕРЫ В БИБЛИОТЕКЕ!!!
в ней инклюд не IRremote.h
, а IRremote.hpp
Ну, Вам же сказали:
Код должен выглядеть примерно так.
void setup(void) {
}
void loop(void) {
}
Вставьте нормально. Без этого разговора не будет. И кстати, текст сообщения об ошибке лучше вставить также, чтобы были номера строк и на них можно было ссылатьс в разговоре.
1 лайк
Я пробовал, когда вставлял через ZIP, появлялся IRremot.h, но и в этом случае компилятор его не распознал. Спасибо за помощь.
Я имею ввиду, что пробовал и с IRremote.hpp
Тебя эта информация никак не напрягает?
Задача буриданова осла? Сейчас одну уберу.
efimius
25.Октябрь.2024 10:55:17
10
Оставил только последнюю библиотеку. Та же ошибка.
MMM
25.Октябрь.2024 10:56:31
11
перенесите папку libraries на обычный диск вместо OneDrive
1 лайк
какое это может иметь значение? Или это тоже милые особенности географии?
efimius
25.Октябрь.2024 11:14:21
14
Перенёс на С:. Не распознаёт
efimius
25.Октябрь.2024 11:15:52
15
Засомневался в библиотеке, но это всё таки GitHub
MMM
25.Октябрь.2024 11:15:55
16
милая дружба OneDrive с кириллическими символами
opened 07:00PM - 26 Dec 19 UTC
topic: code
type: imperfection
### Describe the problem
If a library is installed under a path that contains C… yrillic characters, Arduino CLI is unable to discover it.
Compilation of sketches with an `#include` directive for a header file of a valid library fails with a "`No such file or directory`" error.
### To reproduce
```text
$ arduino-cli version
arduino-cli.exe Version: git-snapshot Commit: 4b70e023 Date: 2023-01-31T03:19:27Z
$ export ARDUINO_DIRECTORIES_USER="/tmp/arduino-cli-directories/мікроконтролер"
$ arduino-cli lib install Arduino_JSON
[...]
$ mkdir /tmp/FooSketch
$ printf "#include <Arduino_JSON.h>\nvoid setup() {}\nvoid loop() {}" > /tmp/FooSketch/FooSketch.ino
$ arduino-cli compile --fqbn arduino:avr:uno /tmp/FooSketch/FooSketch.ino
C:\Users\per\AppData\Local\Temp\FooSketch\FooSketch.ino:1:10: fatal error: Arduino_JSON.h: No such file or directory
#include <Arduino_JSON.h>
^~~~~~~~~~~~~~~~
compilation terminated.
Used library Version Path
Arduino_JSON 0.2.0 C:\Users\per\AppData\Local\Temp\arduino-cli-directories\мікроконтролер\libraries\Arduino_JSON
Used platform Version Path
arduino:avr 1.8.6 C:\Users\per\AppData\Local\Arduino15\packages\arduino\hardware\avr\1.8.6
Error during build: exit status 1
```
### Expected behavior
Any path supported by the file system is also supported by the library discovery system
### Arduino CLI version
#### Original report
Arduino IDE 1.8.10
#### Last verified with
a527c7cdea0694da3034ba9995b7c9eaecfe074b
### Operating system
Windows
### Operating system version
- 10
- 11
### Additional context
The issue is not specific to Cyrillic. For example, it also occurs with a folder named `文` or `Κώστας`.
---
The fault only occurs on Windows. I am not able to reproduce it on Ubuntu 22.04 or macOS Ventura machines.
---
After changing system's locale from English to Bulgarian (win1251) + restart, the compilation succeeded. Unfortunately this is not viable solution, because we have many computers (>150) and changing system locale requires admin privileges.
My suggestion is that the IDE is not using the unicode version of the API when searching for libraries?
---
This is more likely to occur for those using [Microsoft **Onedrive**](https://en.wikipedia.org/wiki/OneDrive) because the default location of the sketchbook is:
```text
C:\Users\<username>\OneDrive\<localized "Documents">\Arduino
```
The `<localized "Documents">` in the path above is a placeholder the word "Documents" localized for the user's locale (e.g., `文档` or `Документы`)
#### Additional reports
- https://forum.arduino.cc/t/wemos-d1-mini-upload-problem/1084371
- https://forum.arduino.cc/t/no-such-file-or-directory-but-i-already-had-this-file/961118
- https://forum.arduino.cc/t/fatal-error-adafruit-neopixel-h-no-such-file-or-directory-but-i-have-it/1070069/15
- https://forum.arduino.cc/t/library-gives-error/1089633
- https://forum.arduino.cc/t/except-for-the-available-libraries-i-cant-use-other-libraries-even-though-i-have-downloaded-them/1092556
- https://forum.arduino.cc/t/compilation-error-due-to-library-hpp-file-not-being-detected/1127096
- https://forum.arduino.cc/t/which-arduino-nano-clone-i-have/1192347/11
- https://forum.arduino.cc/t/cannot-verify-the-arduino-code-because-the-installed-library-cannot-be-found/1215989
- https://forum.arduino.cc/t/10-fatal-error-onewire-h-no-such-file-or-directory/1223739
- https://forum.arduino.cc/t/unknown-error-for-arduino-1-8-19/1234260
- https://forum.arduino.cc/t/compilation-of-keypad-library-example-fails-key-h-no-such-file-or-directory/1241109
- https://forum.arduino.cc/t/mg135-library-please-answer/1254438
- https://forum.arduino.cc/t/i-keep-getting-library-compilation-error-despite-having-the-library/1255423
- https://forum.arduino.cc/t/no-such-file-or-directory/1255862/1
- https://forum.arduino.cc/t/no-such-file-or-directory/1255862/18
- https://forum.arduino.cc/t/arduino-ide-2-3-2-do-not-read-any-installed-library/1256849
- https://forum.arduino.cc/t/have-library-error-eventhough-installed/1258722
- https://forum.arduino.cc/t/arduino-ide-cannot-find-time-library-even-though-it-exists/1261462
- https://forum.arduino.cc/t/adafruit-bmp280-h-no-such-file-or-directory/1265651
- https://forum.arduino.cc/t/compilation-error-adafruit-mpu6050-h-no-such-file-or-directory/1279099
- https://forum.arduino.cc/t/pcm-h-no-such-file-or-directory/1282193
- https://forum.arduino.cc/t/no-such-file-directory-even-though-i-have-already-installed-the-related-library/1300806
- https://forum.arduino.cc/t/no-such-library-error-please-help/1302038
- https://forum.arduino.cc/t/fatal-error-no-such-file-or-directory/1304273
- https://forum.arduino.cc/t/compilation-error-for-missing-header-file-even-though-i-have-the-library-installed/1312514
- https://forum.arduino.cc/t/liquidcrystal-i2c-compile-error/1313541
<a name="workaround"></a>
#### Workaround
##### Arduino CLI
1. Configure Arduino CLI to use a `directories.user` location that does not contain any non-ASCII characters in its path:
https://arduino.github.io/arduino-cli/latest/configuration/
1. Move the contents of the folder at the previous `directories.user` location to the new location.
##### Arduino IDE
1. Select **File > Preferences...** (or **Arduino IDE > Settings...** for macOS users) from the Arduino IDE menus.
The "**Preferences**" dialog will open.
1. Set the path in the "**Sketchbook location**" preference to a location that does not contain any non-ASCII characters in its path.
1. Click the "**OK**" button.
The "**Preferences**" dialog will close.
1. Move the contents of the folder at the previous path of the "**Sketchbook location**" preference to the new location.
### Issue checklist
- [X] I searched for previous reports in [the issue tracker](https://github.com/arduino/arduino-cli/issues?q=)
- [X] I verified the problem still occurs when using the [nightly build](https://arduino.github.io/arduino-cli/dev/installation/#nightly-builds)
- [X] My report contains all necessary details
efimius
25.Октябрь.2024 11:18:48
18
Arduino: 1.8.19 (Windows 10), Board: “Arduino Uno”
IR_Trans:1:10: fatal error: IRremote.h: No such file or directory
Multiple libraries were found for “IRremote.h”
compilation terminated.
Used: C:\Users\97258\OneDrive\Документы\Arduino\libraries\IRremote
Not used: C:\Users\97258\OneDrive\Документы\Arduino\libraries\IRremote-4.4.1
exit status 1
IRremote.h: No such file or directory
This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.
[/quote]
MMM
25.Октябрь.2024 11:20:15
19
И где же видно, что вы перенесли библиотеку на С? - зачем врать?
efimius
25.Октябрь.2024 11:20:59
20
Arduino: 1.8.19 (Windows 10), Board: “Arduino Uno”
IR_Trans:1:10: fatal error: IRremote.hpp: No such file or directory
compilation terminated.
exit status 1
IRremote.hpp: No such file or directory
This report would have more information with
“Show verbose output during compilation”
option enabled in File → Preferences.