极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14499|回复: 9

DS1302报错

[复制链接]
发表于 2015-10-5 22:38:09 | 显示全部楼层 |阅读模式
我像这个帖子一样接法,接线没错,但在编译程序时Arduino IDE总是说编译错误,搞得我头都大了!我是按照这个教程弄的!http://www.geek-workshop.com/for ... mp;highlight=DS1302
以下是错误信息:
Arduino:1.6.5 (Windows XP), 板:"Arduino Nano, ATmega328"

构建选项已变更,全部重新构建

使用库 DS1302 在文件夹: D:\arduino-1.6.5-r5\Arduino\libraries\DS1302 (legacy)



D:\arduino-1.6.5-r5\Arduino\hardware\tools\avr/bin/avr-g++ -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -fno-threadsafe-statics -MMD -mmcu=atmega328p -DF_CPU=16000000L -DARDUINO=10605 -DARDUINO_AVR_NANO -DARDUINO_ARCH_AVR -ID:\arduino-1.6.5-r5\Arduino\hardware\arduino\avr\cores\arduino -ID:\arduino-1.6.5-r5\Arduino\hardware\arduino\avr\variants\eightanaloginputs -ID:\arduino-1.6.5-r5\Arduino\libraries\DS1302 C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build3424291655881570545.tmp\sketch_oct05a.cpp -o C:\DOCUME~1\ADMINI~1\LOCALS~1\Temp\build3424291655881570545.tmp\sketch_oct05a.cpp.o

In file included from sketch_oct05a.ino:3:0:
D:\arduino-1.6.5-r5\Arduino\libraries\DS1302/DS1302.h:31:22: fatal error: WProgram.h: No such file or directory
#include "WProgram.h"
                      ^
compilation terminated.
编译有误。
回复

使用道具 举报

发表于 2015-10-6 00:13:39 | 显示全部楼层
重新載新版本的DS1302庫就好
回复 支持 反对

使用道具 举报

发表于 2015-10-6 09:08:33 | 显示全部楼层
DS1302  是太老了,下载一个1.1+的版本就好了。
回复 支持 反对

使用道具 举报

发表于 2015-10-8 19:27:06 | 显示全部楼层
编译错误报错肯定不是接线问题。我用mini pro 经常不接外围设备下载完了再插到做好板子上用……
回复 支持 反对

使用道具 举报

发表于 2015-12-12 17:51:22 | 显示全部楼层
楼主,你的成功了吗?
回复 支持 反对

使用道具 举报

 楼主| 发表于 2015-12-12 23:07:24 | 显示全部楼层
可靠的中国小伙 发表于 2015-12-12 17:51
楼主,你的成功了吗?

从此再也不玩DS1302了!准备入手DS1307
回复 支持 反对

使用道具 举报

发表于 2015-12-19 12:27:50 | 显示全部楼层
因為想做1個鬧鐘的關係 DS1302我之前玩過1次
WProgram.h這個庫的問題
這是舊版的IDE用的
新版的好像是用Arduino.h庫來整合
不過後看論壇里說DS3231的精準度較高
改玩DS3231

不過我也才剛玩arduion才2個月左右的超白新手而已
回复 支持 反对

使用道具 举报

发表于 2015-12-19 13:09:42 | 显示全部楼层
可以考虑PCF8563,方便好用
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|联系我们|极客工坊

GMT+8, 2026-6-15 05:42 , Processed in 0.041213 second(s), 25 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表