Arduinoによるリモコンコード解析について No1 | 秋葉は外神田ですがなにか?

秋葉は外神田ですがなにか?

ガッチャマン背景だったものを、映画不振とは関係なく、
ふつーのCoolTypeに変更しました。
少しは文字が読みやすくなったのではないでしょうか?
・・・と、思ったけど、やっぱりガッチャマンにもどしました。2013.10.15
※トップページ放置確認w2021.Aug

初めに

使用したスケッチ

START Arduino\libraries\Arduino-IRremote-master\examples\ReceiveDump\ReceiveDump.ino from May  5 2023
Using library version 4.1.0

 

ドライバのバージョンを落した。

別アプリで、使用しているIrRecieveのポートの番号を探り当てた。

サンプルスケッチを起動した。

 

その結果、

 

Ready to receive IR signals of protocols: NEC/NEC2/Onkyo/Apple, Panasonic/Kaseikyo, Denon/Sharp, Sony, RC5, RC6, LG, JVC, Samsung, FAST, Whynter, Lego Power Functions, Bosewave , MagiQuest, Universal Pulse Distance Width, Hash at pin 2
5000 us is the (minimum) gap, after which the start of a new IR packet is assumed
20
Because of the verbose output (>200 ms at 115200), repeats are probably not dumped correctly!Ready to receive IR signals of protocols: NEC/NEC2/Onkyo/Apple, Panasonic/Kaseikyo, Denon/Sharp, Sony, RC5, RC6, LG, JVC, Samsung, FAST, Whynter, Lego Power Functions, Bosewave , MagiQuest, Universal Pulse Distance Width, Hash at pin 2
5000 us is the (minimum) gap, after which the start of a new IR packet is assumed
20
Because of the verbose output (>200 ms at 115200), repeats are probably not dumped correctly!

 

上手くメッセージが出た。

 

 

ターゲットとするリモコンのコード解析について

リモコンの #1 キーを押した場合

 

Protocol=NEC Address=0x80 Command=0x2 Raw-Data=0xFD027F80 32 bits LSB first

Send with: IrSender.sendNEC(0x80, 0x2, <numberOfRepeats>);

Raw result in internal ticks (50 us) - with leading gap
rawData[68]: 
 -65535
 +179,-89
 +12,-10 +12,-11 +12,-10 +12,-11
 +12,-11 +12,-10 +12,-11 +12,-33
 +11,-33 +12,-33 +11,-33 +12,-33
 +12,-32 +12,-33 +11,-34 +11,-11
 +11,-12 +11,-33 +12,-11 +11,-11
 +12,-11 +11,-12 +11,-11 +11,-12
 +11,-33 +12,-11 +12,-32 +12,-33
 +12,-32 +13,-32 +12,-32 +13,-32
 +12
Sum: 1354
Raw result in microseconds - with leading gap
rawData[68]: 
 -3276750
 +8950,-4450
 + 600,- 500 + 600,- 550 + 600,- 500 + 600,- 550
 + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1650
 + 550,-1650 + 600,-1650 + 550,-1650 + 600,-1650
 + 600,-1600 + 600,-1650 + 550,-1700 + 550,- 550
 + 550,- 600 + 550,-1650 + 600,- 550 + 550,- 550
 + 600,- 550 + 550,- 600 + 550,- 550 + 550,- 600
 + 550,-1650 + 600,- 550 + 600,-1600 + 600,-1650
 + 600,-1600 + 650,-1600 + 600,-1600 + 650,-1600
 + 600
Sum: 67700

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[67] = {179,89, 12,10, 12,11, 12,10, 12,11, 12,11, 12,10, 12,11, 12,33, 11,33, 12,33, 11,33, 12,33, 12,32, 12,33, 11,34, 11,11, 11,12, 11,33, 12,11, 11,11, 12,11, 11,12, 11,11, 11,12, 11,33, 12,11, 12,32, 12,33, 12,32, 13,32, 12,32, 13,32, 12};  // Protocol=NEC Address=0x80 Command=0x2 Raw-Data=0xFD027F80 32 bits LSB first

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[67] = {8930,4470, 580,520, 580,570, 580,520, 580,570, 580,570, 580,520, 580,570, 580,1670, 530,1670, 580,1670, 530,1670, 580,1670, 580,1620, 580,1670, 530,1720, 530,570, 530,620, 530,1670, 580,570, 530,570, 580,570, 530,620, 530,570, 530,620, 530,1670, 580,570, 580,1620, 580,1670, 580,1620, 630,1620, 580,1620, 630,1620, 580};  // Protocol=NEC Address=0x80 Command=0x2 Raw-Data=0xFD027F80 32 bits LSB first

uint16_t address = 0x80;
uint16_t command = 0x2;
uint32_t rawData = 0xFD027F80;


Pronto Hex as string
char prontoData[] = "0000 006D 0022 0000 0159 00AA 0018 0012 0018 0014 0018 0012 0018 0014 0018 0014 0018 0012 0018 0014 0018 003F 0016 003F 0018 003F 0016 003F 0018 003F 0018 003D 0018 003F 0016 0041 0016 0014 0016 0016 0016 003F 0018 0014 0016 0014 0018 0014 0016 0016 0016 0014 0016 0016 0016 003F 0018 0014 0018 003D 0018 003F 0018 003D 001A 003D 0018 003D 001A 003D 0018 06C3 ";
 

 

リモコンの #2 キーを押した場合

Protocol=NEC Address=0x80 Command=0x4 Raw-Data=0xFB047F80 32 bits LSB first

Send with: IrSender.sendNEC(0x80, 0x4, <numberOfRepeats>);

Raw result in internal ticks (50 us) - with leading gap
rawData[68]: 
 -65535
 +181,-89
 +12,-11 +12,-10 +12,-11 +12,-10
 +12,-11 +12,-10 +12,-11 +12,-33
 +11,-33 +12,-33 +11,-33 +12,-33
 +12,-32 +12,-33 +12,-32 +12,-11
 +12,-10 +12,-11 +12,-33 +11,-11
 +12,-11 +11,-11 +12,-11 +12,-10
 +12,-33 +12,-32 +12,-11 +12,-32
 +12,-33 +12,-32 +12,-33 +12,-33
 +11
Sum: 1355
Raw result in microseconds - with leading gap
rawData[68]: 
 -3276750
 +9050,-4450
 + 600,- 550 + 600,- 500 + 600,- 550 + 600,- 500
 + 600,- 550 + 600,- 500 + 600,- 550 + 600,-1650
 + 550,-1650 + 600,-1650 + 550,-1650 + 600,-1650
 + 600,-1600 + 600,-1650 + 600,-1600 + 600,- 550
 + 600,- 500 + 600,- 550 + 600,-1650 + 550,- 550
 + 600,- 550 + 550,- 550 + 600,- 550 + 600,- 500
 + 600,-1650 + 600,-1600 + 600,- 550 + 600,-1600
 + 600,-1650 + 600,-1600 + 600,-1650 + 600,-1650
 + 550
Sum: 67750

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[67] = {181,89, 12,11, 12,10, 12,11, 12,10, 12,11, 12,10, 12,11, 12,33, 11,33, 12,33, 11,33, 12,33, 12,32, 12,33, 12,32, 12,11, 12,10, 12,11, 12,33, 11,11, 12,11, 11,11, 12,11, 12,10, 12,33, 12,32, 12,11, 12,32, 12,33, 12,32, 12,33, 12,33, 11};  // Protocol=NEC Address=0x80 Command=0x4 Raw-Data=0xFB047F80 32 bits LSB first

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[67] = {9030,4470, 580,570, 580,520, 580,570, 580,520, 580,570, 580,520, 580,570, 580,1670, 530,1670, 580,1670, 530,1670, 580,1670, 580,1620, 580,1670, 580,1620, 580,570, 580,520, 580,570, 580,1670, 530,570, 580,570, 530,570, 580,570, 580,520, 580,1670, 580,1620, 580,570, 580,1620, 580,1670, 580,1620, 580,1670, 580,1670, 530};  // Protocol=NEC Address=0x80 Command=0x4 Raw-Data=0xFB047F80 32 bits LSB first

uint16_t address = 0x80;
uint16_t command = 0x4;
uint32_t rawData = 0xFB047F80;


Pronto Hex as string
char prontoData[] = "0000 006D 0022 0000 015D 00AA 0018 0014 0018 0012 0018 0014 0018 0012 0018 0014 0018 0012 0018 0014 0018 003F 0016 003F 0018 003F 0016 003F 0018 003F 0018 003D 0018 003F 0018 003D 0018 0014 0018 0012 0018 0014 0018 003F 0016 0014 0018 0014 0016 0014 0018 0014 0018 0012 0018 003F 0018 003D 0018 0014 0018 003D 0018 003F 0018 003D 0018 003F 0018 003F 0016 06C3 ";
 

 

リモコンの #3 キーを押した場合



Protocol=NEC Address=0x80 Command=0x6 Raw-Data=0xF9067F80 32 bits LSB first

Send with: IrSender.sendNEC(0x80, 0x6, <numberOfRepeats>);

Raw result in internal ticks (50 us) - with leading gap
rawData[68]: 
 -65535
 +180,-90
 +12,-10 +12,-11 +12,-10 +12,-11
 +12,-10 +12,-11 +12,-10 +12,-33
 +12,-33 +11,-33 +12,-33 +11,-33
 +12,-33 +11,-33 +12,-33 +11,-11
 +12,-11 +12,-32 +12,-33 +12,-10
 +12,-11 +12,-10 +12,-11 +12,-10
 +12,-33 +12,-11 +11,-11 +12,-33
 +11,-33 +12,-33 +11,-33 +12,-33
 +11
Sum: 1354
Raw result in microseconds - with leading gap
rawData[68]: 
 -3276750
 +9000,-4500
 + 600,- 500 + 600,- 550 + 600,- 500 + 600,- 550
 + 600,- 500 + 600,- 550 + 600,- 500 + 600,-1650
 + 600,-1650 + 550,-1650 + 600,-1650 + 550,-1650
 + 600,-1650 + 550,-1650 + 600,-1650 + 550,- 550
 + 600,- 550 + 600,-1600 + 600,-1650 + 600,- 500
 + 600,- 550 + 600,- 500 + 600,- 550 + 600,- 500
 + 600,-1650 + 600,- 550 + 550,- 550 + 600,-1650
 + 550,-1650 + 600,-1650 + 550,-1650 + 600,-1650
 + 550
Sum: 67700

Result as internal 8bit ticks (50 us) array - compensated with MARK_EXCESS_MICROS=20
uint8_t rawTicks[67] = {180,90, 12,10, 12,11, 12,10, 12,11, 12,10, 12,11, 12,10, 12,33, 12,33, 11,33, 12,33, 11,33, 12,33, 11,33, 12,33, 11,11, 12,11, 12,32, 12,33, 12,10, 12,11, 12,10, 12,11, 12,10, 12,33, 12,11, 11,11, 12,33, 11,33, 12,33, 11,33, 12,33, 11};  // Protocol=NEC Address=0x80 Command=0x6 Raw-Data=0xF9067F80 32 bits LSB first

Result as microseconds array - compensated with MARK_EXCESS_MICROS=20
uint16_t rawData[67] = {8980,4520, 580,520, 580,570, 580,520, 580,570, 580,520, 580,570, 580,520, 580,1670, 580,1670, 530,1670, 580,1670, 530,1670, 580,1670, 530,1670, 580,1670, 530,570, 580,570, 580,1620, 580,1670, 580,520, 580,570, 580,520, 580,570, 580,520, 580,1670, 580,570, 530,570, 580,1670, 530,1670, 580,1670, 530,1670, 580,1670, 530};  // Protocol=NEC Address=0x80 Command=0x6 Raw-Data=0xF9067F80 32 bits LSB first

uint16_t address = 0x80;
uint16_t command = 0x6;
uint32_t rawData = 0xF9067F80;


Pronto Hex as string
char prontoData[] = "0000 006D 0022 0000 015B 00AC 0018 0012 0018 0014 0018 0012 0018 0014 0018 0012 0018 0014 0018 0012 0018 003F 0018 003F 0016 003F 0018 003F 0016 003F 0018 003F 0016 003F 0018 003F 0016 0014 0018 0014 0018 003D 0018 003F 0018 0012 0018 0014 0018 0012 0018 0014 0018 0012 0018 003F 0018 0014 0016 0014 0018 003F 0016 003F 0018 003F 0016 003F 0018 003F 0016 06C3 ";

 

キーはこの3つ

サマリーとして
 uint16_t address = 0x80;

 キー  コード データ列

 1   0x2 0xFD027F80;

 2   0x4 0xFB047F80;

 3   0x6 0xF9067F80;

 

以上

 


 *  This file is part of Arduino-IRremote https://github.com/Arduino-IRremote/Arduino-IRremote.
 *
 ************************************************************************************
 * MIT License
 *
 * Copyright (c) 2020-2022 Armin Joachimsmeyer
 *
 * Permission is hereby granted, free of charge, to any person obtaining a copy
 * of this software and associated documentation files (the "Software"), to deal
 * in the Software without restriction, including without limitation the rights
 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 * copies of the Software, and to permit persons to whom the Software is furnished
 * to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included in all
 * copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
 * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF
 * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 ************************************************************************************
 */