上传程序的时候就弹出这个编译出错,这是出现了什么问题

Arduino:1.8.5 (Windows 10), 开发板:"Arduino/Genuino Uno"

D:\PS2娓告垙鎵嬫焺鎺у埗绋嬪簭\PS2X_ArmCar_Shield\PS2X_ArmCar_Shield.ino:1:34: fatal error: PS2X_lib.h: No such file or directory

compilation terminated.粗体文本

exit status 1
为开发板 Arduino/Genuino Uno 编译时出错。

`在此处键入或粘贴代码`

在文件 -> 首选项开启
“编译过程中显示详细输出”选项
这份报告会包含更多信息。

你没安装程序依赖的库,缺少“PS2X_lib.h”这个头文件

image

请问是这个文件吗

对,你按照这个指南的方法3“手动添加zip库”的方式把文件复制到指定的目录然后重启IDE就行了

http://www.taichi-maker.com/homepage/reference-index/arduino-library-index/install-arduino-library/#install16

好的,谢谢你

还是不行

The file PS2X_lib.h (and its associated parts, for example a matching .cpp file) must be copied into the same directory as your program PS2X_ArmCar_Shield.ino

我已经把文件放进资料库里面了

Google translated to English => I have put the file in the database

This is not clear where you have put the file PS2X_lib.h

The delimiters around the file name (marked in red below) are important.
The < > (chevron) marks indicate the file is in the normal library.
The " " (double quote) marks indicate the file is in the same directory as your main program.

The " " (double quote) marks indicate the file is in the same directory as your main program

Just to complement this:
with quotes, That’s where it will look first and then if it’s not in the current directory, it will look in the standard library folder.

Oh OK. Thanks. I have learned something as well.

I have merged your cross-posts @246732432.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide you will find at the top of every forum category. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.


我把程序和文件组成一个文件,放在我添加的Fast LED资料库里面,我试过了还是不行,不知道这样对不对

Google translated to English: I put the program and the file into a file and put it in the Fast LED database I added. I tried it and it still doesn’t work. I don’t know if it’s right.

No. The directory structure is not correct. The directory containing your program and the 2 PC2X_lib files should go directly under the directory "Arduino" .

请问我自己添加的那个fast led资料库是不是多余的,是不是直接把程序和2个PC2X_lib文件直接放目录"Arduino"下就可以了,不用添加那个fast led资料库呢?

Google translated to English.
Is the fast led library that I added by myself redundant? Can I just put the program and two PC2X_lib files directly under the directory "Arduino" instead of adding the fast led library?

Yes. Normally a program, written by a user, goes under the directory "Arduino".

好的谢谢