极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 51462|回复: 25

ESP8266 测试帖

[复制链接]
发表于 2014-11-30 12:17:32 | 显示全部楼层 |阅读模式
本帖最后由 szpapas 于 2014-11-30 12:28 编辑

串口波特率是9600. 用软串口的Demo。比现在网上的用Debug Serial的方式容易多了,很简单,在此共享一下。

直接在软串口中输入命令,就可以交互的执行AT命令了。

波特率设置成9600.

接线方式:

ESP-01   

VCC       -------- 3.3V
GND      -------- GND
CH-PD   -------- 3.3V (加不加10K电阻都可以)

TXD       ------   10  // 软串口的RX
RXD       -------  11  // 软串口的TX
               

UNO的代码:

#include <SoftwareSerial.h>

SoftwareSerial mySerial(10, 11); // RX, TX

void setup()  
{
  // Open serial communications and wait for port to open:
  Serial.begin(9600);
  while (!Serial) {
    ; // wait for serial port to connect. Needed for Leonardo only
  }


  Serial.println("Goodnight moon!");

  // set the data rate for the SoftwareSerial port
  mySerial.begin(9600);
  mySerial.println("Hello, world?");
}

void loop() // run over and over
{
  if (mySerial.available())
    Serial.write(mySerial.read());
  if (Serial.available())
    mySerial.write(Serial.read());
}



本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复

使用道具 举报

 楼主| 发表于 2014-11-30 14:08:59 | 显示全部楼层
用来测试温湿度Demo

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2014-12-1 07:36:05 | 显示全部楼层
恩不错,再上点例子,你用的esp8266的固件版本是多少
回复 支持 反对

使用道具 举报

发表于 2014-12-1 09:34:12 | 显示全部楼层
对了,还有这东西稳定性怎么样,有很多人说稳定性不好,散热量高。
回复 支持 反对

使用道具 举报

发表于 2014-12-1 12:30:10 | 显示全部楼层
高亮怎么改的??
回复 支持 反对

使用道具 举报

发表于 2014-12-1 12:32:03 | 显示全部楼层
本帖最后由 hardstudy12345 于 2014-12-1 12:33 编辑

你好,用了你的代码貌似还是不行。显示的是乱码,不知道怎么回事。看你的截图用的是Windows系统吗?
我的是这个板子

出现乱码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?注册

x
回复 支持 反对

使用道具 举报

发表于 2014-12-1 14:17:46 | 显示全部楼层
注意波特率,新版本的波特率是115200,

9600貌似是我以前改的一个版本,固件在ocrobot.com下载,如何刷,也有。。。

顺便问楼主,那个软串口丢字符的问题有没有出现?
回复 支持 反对

使用道具 举报

发表于 2014-12-1 17:08:11 | 显示全部楼层
学慧放弃 发表于 2014-12-1 12:30
高亮怎么改的??

应该是mac的吧。。。也想知道win下怎么改。目前再用textlime
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-12-1 18:43:20 | 显示全部楼层
Tottiii 发表于 2014-12-1 17:08
应该是mac的吧。。。也想知道win下怎么改。目前再用textlime

是的Mac版本的,很早以前修改的。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-12-1 18:44:17 | 显示全部楼层
Cupid 发表于 2014-12-1 09:34
对了,还有这东西稳定性怎么样,有很多人说稳定性不好,散热量高。

稳定性不错,测试了5-6个小时,都没有错
回复 支持 反对

使用道具 举报

发表于 2014-12-1 22:41:20 | 显示全部楼层
Tottiii 发表于 2014-12-1 17:08
应该是mac的吧。。。也想知道win下怎么改。目前再用textlime

我的使用极不方便
回复 支持 反对

使用道具 举报

发表于 2014-12-2 07:15:38 | 显示全部楼层
你在某宝哪儿家店买的?直接上ID号好了。
回复 支持 反对

使用道具 举报

 楼主| 发表于 2014-12-2 17:55:12 | 显示全部楼层
szpapas 发表于 2014-12-1 18:43
是的Mac版本的,很早以前修改的。

修改的是theme.txt 文件

Mac下面是这个文件:

/Applications/Arduino.app/Contents/Resources/Java/lib/theme/theme.txt

# GUI - STATUS
status.notice.fgcolor = #002325
status.notice.bgcolor = #17A1A5
status.error.fgcolor = #FFFFFF
status.error.bgcolor = #E34C00
status.edit.fgcolor = #000000
status.edit.bgcolor = #F1B500
status.font = SansSerif,plain,12

# GUI - TABS
# settings for the tabs at the top
# (tab images are stored in the lib/theme folder)
header.bgcolor = #17A1A5
header.text.selected.color = #005B5B
header.text.unselected.color = #007e82
header.text.font = SansSerif,plain,12

# GUI - CONSOLE
console.font = Monospaced,plain,11
console.font.macosx = Monaco,plain,10
console.color = #000000
console.output.color = #eeeeee
console.error.color = #E34C00

# GUI - BUTTONS
buttons.bgcolor = #006468
buttons.status.font = SansSerif,plain,12
buttons.status.color = #ffffff

# GUI - LINESTATUS   
linestatus.color = #ffffff
linestatus.bgcolor = #006468

# EDITOR - DETAILS

# foreground and background colors
editor.fgcolor = #ffffff
editor.bgcolor = #002040

# highlight for the current line
#editor.linehighlight.color=#e2e2e2
editor.linehighlight.color=#804030
# highlight for the current line
editor.linehighlight=true

# caret blinking and caret color
#editor.caret.color = #333300
editor.caret.color = #ffffff

# color to be used for background when 'external editor' enabled
editor.external.bgcolor = #c8d2dc

# selection color
#editor.selection.color = #ffcc00
editor.selection.color = #c08060

# area that's not in use by the text (replaced with tildes)
editor.invalid.style = #7e7e7e,bold

# little pooties at the end of lines that show where they finish
editor.eolmarkers = false
editor.eolmarkers.color = #999999

# bracket/brace highlighting
editor.brackethighlight = true
editor.brackethighlight.color = #006699


# TEXT - KEYWORDS

# e.g abstract, final, private
editor.keyword1.style = #ffd300,plain

# e.g. beginShape, point, line
editor.keyword2.style = #fd9d00,plain

# e.g. byte, char, short, color
editor.keyword3.style = #fd9d00,bold



# TEXT - LITERALS
# constants: e.g. null, true, this, RGB, TWO_PI
editor.literal1.style = #fb628c,plain

# p5 built in variables: e.g. mouseX, width, pixels
editor.literal2.style = #fd9d00,plain


# http://arduino.cc/
editor.url.style = #0000ff,underlined

# e.g. + - = /
editor.operator.style = #000000,plain

# ?? maybe this is for words followed by a colon
# like in case statements or goto
editor.label.style = #7e7e7e,bold


# TEXT - COMMENTS
editor.comment1.style = #0b88ff,plain
editor.comment2.style = #0b88ff,plain


# LINE STATUS - editor line number status bar at the bottom of the screen
linestatus.font           = SansSerif,plain,10
linestatus.height  = 20
回复 支持 反对

使用道具 举报

发表于 2014-12-3 18:07:19 | 显示全部楼层
关键速度多块- -
回复 支持 反对

使用道具 举报

发表于 2014-12-3 23:09:31 | 显示全部楼层
看样子我也想买个玩玩
回复 支持 反对

使用道具 举报

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

本版积分规则 需要先绑定手机号

Archiver|联系我们|极客工坊

GMT+8, 2024-5-1 12:18 , Processed in 0.051435 second(s), 25 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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