9034浏览
查看: 9034|回复: 6

[求助] (SKU:DFR0009)LCD Keypad Shield的例子程序在我的板子上不work

[复制链接]
我把LCD的例子程序,烧写到我的板子上,不work。然后用别人的笔记本,编译烧写到我的Edison板子上,可以work。

wiring_digital-error: digitalWrite: can't index pinState with pin 9

wiring_digital-error: digitalWrite: can't index pinState with pin 8

variant-error: turnOffPWM: unknown pin4
wiring_digital-error: pinMode: can't set mux for pin4

wiring_digital-error: digitalWrite: can't index pinState with pin 4

variant-error: turnOffPWM: unknown pin5
wiring_digital-error: pinMode: can't set mux for pin5

wiring_digital-error: digitalWrite: can't index pinState with pin 5

variant-error: turnOffPWM: unknown pin6
wiring_digital-error: pinMode: can't set mux for pin6

wiring_digital-error: digitalWrite: can't index pinState with pin 6

variant-error: turnOffPWM: unknown pin7
wiring_digital-error: pinMode: can't set mux for pin7

wiring_digital-error: digitalWrite: can't index pinState with pin 7

wiring_digital-error: digitalWrite: can't index pinState with pin 9

wiring_digital-error: digitalWrite: can't index pinState with pin 9

wiring_digital-error: digitalWrite: can't index pinState with pin 9

variant-error: turnOffPWM: unknown pin4
wiring_digital-error: pinMode: can't set mux for pin4

wiring_digital-error: digitalWrite: can't index pinState with pin 4

variant-error: turnOffPWM: unknown pin5
wiring_digital-error: pinMode: can't set mux for pin5

wiring_digital-error: digitalWrite: can't index pinState with pin 5

variant-error: turnOffPWM: unknown pin6
wiring_digital-error: pinMode: can't set mux for pin6

wiring_digital-error: digitalWrite: can't index pinState with pin 6

variant-error: turnOffPWM: unknown pin7
wiring_digital-error: pinMode: can't set mux for pin7

wiring_digital-error: digitalWrite: can't index pinState with pin 7

wiring_digital-error: digitalWrite: can't index pinState with pin 9

wiring_digital-error: digitalWrite: can't index pinState with pin 9

wiring_digital-error: digitalWrite: can't index pinState with pin 9


hellovictoria  见习技师
 楼主|

发表于 2015-4-16 14:28:55

我的报错信息如上所述,我是直接./sketch.elf后,报的错误信息!
回复

使用道具 举报

Angelo  初级技匠

发表于 2015-4-16 15:26:08

应该是Arduino IDE的问题, 可以尝试重新安装一下:
http://www.intel.com/support/edison/sb/CS-035180.htm

另外Edison的固件也有更新过, 可以尝试跟着这个教程更新一下
http://www.intel.com/support/edison/sb/CS-035286.htm
回复

使用道具 举报

丄帝De咗臂  高级技匠

发表于 2015-4-16 15:37:15

我表示看不懂报错信息
回复

使用道具 举报

hellovictoria  见习技师
 楼主|

发表于 2015-4-16 15:55:25

奇葩的问题还真是奇葩的解决了
    问题出在: Arduino IDE,编译出问题。
                       我的Arduino IDE 是 arduino-1.6.0+Intel
                        换成arduino-1.5.3-Intel.1.0.4,就O了,真奇葩。
回复

使用道具 举报

Angelo  初级技匠

发表于 2015-5-21 14:31:47

本帖最后由 Angelo 于 2015-5-21 14:33 编辑
hellovictoria 发表于 2015-4-16 15:55
奇葩的问题还真是奇葩的解决了
    问题出在: Arduino IDE,编译出问题。
                       我的Ard ...

Edison 1.6.0 里面存在一个问题, LiquidCrystal这个类在构造函数里面调用了pinMode()函数,但此时 pinMode()函数还无法使用, 因此我们需要手动在 Setup 里面添加pinMode(), 让引脚变为输出模式

void LiquidCrystal::init(uint8_t fourbitmode, uint8_t rs, uint8_t rw, uint8_t enable,
                         uint8_t d0, uint8_t d1, uint8_t d2, uint8_t d3,
                         uint8_t d4, uint8_t d5, uint8_t d6, uint8_t d7)
{
  _rs_pin = rs;
  _rw_pin = rw;
  _enable_pin = enable;
  
  _data_pins[0] = d0;
  _data_pins[1] = d1;
  _data_pins[2] = d2;
  _data_pins[3] = d3;
  _data_pins[4] = d4;
  _data_pins[5] = d5;
  _data_pins[6] = d6;
  _data_pins[7] = d7;

  pinMode(_rs_pin, OUTPUT);
  // we can save 1 pin by not using RW. Indicate by passing 255 instead of pin#
  if (_rw_pin != 255) {
    pinMode(_rw_pin, OUTPUT);
  }
  pinMode(_enable_pin, OUTPUT);
  
  if (fourbitmode)
    _displayfunction = LCD_4BITMODE | LCD_1LINE | LCD_5x8DOTS;
  else
    _displayfunction = LCD_8BITMODE | LCD_1LINE | LCD_5x8DOTS;
  
  begin(16, 1);  
}
一下是测试代码:
  1. #include <LiquidCrystal.h>
  2. LiquidCrystal lcd(8, 9, 4, 5, 6, 7);        // 初始化LCD的引脚号
  3. void setup() {
  4.     pinMode(8, OUTPUT);
  5.     pinMode(9, OUTPUT);
  6.     pinMode(4, OUTPUT);
  7.     pinMode(5, OUTPUT);
  8.     pinMode(6, OUTPUT);
  9.     pinMode(7, OUTPUT);
  10.   lcd.begin(16, 2);  // 设置LCD为2行,每行16个字符
  11. }
  12. void loop() {
  13.   lcd.setCursor(0, 0);
  14.   lcd.print("Hello");
  15.   delay(500);
  16. }
复制代码



回复

使用道具 举报

hellovictoria  见习技师
 楼主|

发表于 2015-5-22 14:10:58

Angelo 发表于 2015-5-21 14:31
Edison 1.6.0 里面存在一个问题, LiquidCrystal这个类在构造函数里面调用了pinMode()函数,但此时 pinMode( ...

我测试了下,是这样子的。强!
回复

使用道具 举报

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

本版积分规则

为本项目制作心愿单
购买心愿单
心愿单 编辑
[[wsData.name]]

硬件清单

  • [[d.name]]
btnicon
我也要做!
点击进入购买页面
上海智位机器人股份有限公司 沪ICP备09038501号-4

© 2013-2024 Comsenz Inc. Powered by Discuz! X3.4 Licensed

mail