极客工坊

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 19625|回复: 0

抱抱大佬的大腿,遥控器上按键值显示在lcd1602的显示屏上,结果却显示不对

[复制链接]
发表于 2018-8-17 23:08:46 | 显示全部楼层 |阅读模式
本帖最后由 弘毅 于 2018-8-18 08:38 编辑
  1. #include "lcd1602.h"
  2. #include <LiquidCrystal.h>
  3. #include <boarddefs.h>
  4. #include <IRremote.h>
  5. #include <IRremoteInt.h>
  6. #include <ir_Lego_PF_BitStreamEncoder.h>
  7. const int irReceiverPin = 12;
  8. IRrecv irrecv(irReceiverPin);// 设置irReceiverPin定义的端口为红外信号接收端口
  9. decode_results results;// 定义results变量为红外结果存放位置   
  10. LiquidCrystal  lcd(12,11,2,3,4,5,6,7,8,9,10);
  11. void setup() {
  12.   irrecv.enableIRIn();

  13. }

  14. void loop() {
  15. irrecv.decode(&results);
  16. LcdCommandWrite(0x80);
  17. if(results.value==0XFF6897)
  18. lcd.print('0');
  19. if(results.value==0XFF30CF)
  20. lcd.print('1');

  21. }


  22.   
  23.   // put your main code here, to run repeatedly:
复制代码


本帖子中包含更多资源

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

x
回复

使用道具 举报

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

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

Archiver|联系我们|极客工坊

GMT+8, 2024-4-20 04:11 , Processed in 0.040346 second(s), 18 queries .

Powered by Discuz! X3.4 Licensed

Copyright © 2001-2021, Tencent Cloud.

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