云题海 - 专业文章范例文档资料分享平台

当前位置:首页 > Arduino红外遥控实验例子

Arduino红外遥控实验例子

  • 62 次阅读
  • 3 次下载
  • 2025/6/7 1:19:09

long off1 = 0x00FFE01F; long on2 = 0x00FF629D; long off2 = 0x00FFA857; long on3 = 0x00FFE21D; long off3 = 0x00FF906F; long on4 = 0x00FF22DD; long off4 = 0x00FF6897; long on5 = 0x00FF02FD; long off5 = 0x00FF9867; long on6 = 0x00FFC23D; long off6 = 0x00FFB047; IRrecv irrecv(RECV_PIN); decode_results results;

// Dumps out the decode_results structure. // Call this after IRrecv::decode() // void * to work around compiler issue //void dump(void *v) {

// decode_results *results = (decode_results *) void dump(decode_results *results) { int count = results->rawlen;

if (results->decode_type == UNKNOWN) {

Serial.println(\ } else {

if (results->decode_type == NEC) {

Serial.print(\ }

else if (results->decode_type == SONY) {

Serial.print(\ }

else if (results->decode_type == RC5) {

Serial.print(\ }

else if (results->decode_type == RC6) {

Serial.print(\ }

Serial.print(results->value, HEX); Serial.print(\

Serial.print(results->bits, DEC); Serial.println(\ }

Serial.print(\ Serial.print(count, DEC); Serial.print(\

for (int i = 0; i < count; i++) {

if ((i % 2) == 1) {

Serial.print(results->rawbuf[i]*USECPERTICK, DEC); } else {

Serial.print(-(int)results->rawbuf[i]*USECPERTICK, DEC); }

Serial.print(\ }

Serial.println(\ }

void setup()

{

pinMode(RECV_PIN, INPUT); pinMode(LED1, OUTPUT); pinMode(LED2, OUTPUT); pinMode(LED3, OUTPUT); pinMode(LED4, OUTPUT); pinMode(LED5, OUTPUT); pinMode(LED6, OUTPUT); pinMode(13, OUTPUT); Serial.begin(9600);

irrecv.enableIRIn(); // Start the receiver }

int on = 0;

unsigned long last = millis();

void loop() {

if (irrecv.decode(&results)) {

// If it's been at least 1/4 second since the last

搜索更多关于: Arduino红外遥控实验例子 的文档
  • 收藏
  • 违规举报
  • 版权认领
下载文档10.00 元 加入VIP免费下载
推荐下载
本文作者:...

共分享92篇相关文档

文档简介:

long off1 = 0x00FFE01F; long on2 = 0x00FF629D; long off2 = 0x00FFA857; long on3 = 0x00FFE21D; long off3 = 0x00FF906F; long on4 = 0x00FF22DD; long off4 = 0x00FF6897; long on5 = 0x00FF02FD; long off5 = 0x00FF9867; long on6 = 0x00FFC23D; long off6 = 0x00FFB047; IRrecv irrecv(RECV_PIN); decode_results results; // Dumps out the decode_results structure. // Call this after IRrecv::decode() //

× 游客快捷下载通道(下载后可以自由复制和排版)
单篇付费下载
限时特价:10 元/份 原价:20元
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
VIP包月下载
特价:29 元/月 原价:99元
低至 0.3 元/份 每月下载150
全站内容免费自由复制
注:下载文档有可能“只有目录或者内容不全”等情况,请下载之前注意辨别,如果您已付费且无法下载或内容有问题,请联系我们协助你处理。
微信:fanwen365 QQ:370150219
Copyright © 云题海 All Rights Reserved. 苏ICP备16052595号-3 网站地图 客服QQ:370150219 邮箱:370150219@qq.com