6/18 wallbot

Dependencies:   mbed

Fork of BLE_WallbotBLE_Challenge_byYUTAKA by Yutaka Yoshida

Committer:
jksoft
Date:
Wed Nov 12 02:40:34 2014 +0000
Revision:
0:76dfa9657d9d
????????

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jksoft 0:76dfa9657d9d 1
jksoft 0:76dfa9657d9d 2
jksoft 0:76dfa9657d9d 3 typedef union
jksoft 0:76dfa9657d9d 4 {
jksoft 0:76dfa9657d9d 5
jksoft 0:76dfa9657d9d 6 struct {
jksoft 0:76dfa9657d9d 7 /*
jksoft 0:76dfa9657d9d 8 1-2バイト目:ボタン
jksoft 0:76dfa9657d9d 9  UP: 0x0001
jksoft 0:76dfa9657d9d 10  DOWN: 0x0002
jksoft 0:76dfa9657d9d 11  RIGHT: 0x0004
jksoft 0:76dfa9657d9d 12  LEFT: 0x0008
jksoft 0:76dfa9657d9d 13  Y button: 0x0010
jksoft 0:76dfa9657d9d 14  A button: 0x0020
jksoft 0:76dfa9657d9d 15  B button: 0x0040
jksoft 0:76dfa9657d9d 16  X button: 0x0100
jksoft 0:76dfa9657d9d 17  L1: 0x0200
jksoft 0:76dfa9657d9d 18  L2: 0x0400
jksoft 0:76dfa9657d9d 19  R1: 0x0800
jksoft 0:76dfa9657d9d 20  R2: 0x1000
jksoft 0:76dfa9657d9d 21  START: 0x0003
jksoft 0:76dfa9657d9d 22  SELECT: 0x000C
jksoft 0:76dfa9657d9d 23 */
jksoft 0:76dfa9657d9d 24 unsigned X : 1;
jksoft 0:76dfa9657d9d 25 unsigned L1 : 1;
jksoft 0:76dfa9657d9d 26 unsigned L2 : 1;
jksoft 0:76dfa9657d9d 27 unsigned R1 : 1;
jksoft 0:76dfa9657d9d 28 unsigned R2 : 1;
jksoft 0:76dfa9657d9d 29 unsigned space1 : 3;
jksoft 0:76dfa9657d9d 30 unsigned UP : 1;
jksoft 0:76dfa9657d9d 31 unsigned DOWN : 1;
jksoft 0:76dfa9657d9d 32 unsigned RIGHT : 1;
jksoft 0:76dfa9657d9d 33 unsigned LEFT : 1;
jksoft 0:76dfa9657d9d 34 unsigned Y : 1;
jksoft 0:76dfa9657d9d 35 unsigned A : 1;
jksoft 0:76dfa9657d9d 36 unsigned B : 1;
jksoft 0:76dfa9657d9d 37 unsigned space2 : 1;
jksoft 0:76dfa9657d9d 38 /*
jksoft 0:76dfa9657d9d 39 3-4バイト目:左アナログ
jksoft 0:76dfa9657d9d 40  左右: 1-255 (Neutral=128)
jksoft 0:76dfa9657d9d 41  上下: 1-255 (Neutral=128)
jksoft 0:76dfa9657d9d 42 */
jksoft 0:76dfa9657d9d 43 unsigned LeftAnalogLR:8;
jksoft 0:76dfa9657d9d 44 unsigned LeftAnalogUD:8;
jksoft 0:76dfa9657d9d 45 /*
jksoft 0:76dfa9657d9d 46 5-6バイト目:右アナログ
jksoft 0:76dfa9657d9d 47  左右: 1-255 (Neutral=128)
jksoft 0:76dfa9657d9d 48  上下: 1-255 (Neutral=128)
jksoft 0:76dfa9657d9d 49 */
jksoft 0:76dfa9657d9d 50 unsigned RightAnalogLR:8;
jksoft 0:76dfa9657d9d 51 unsigned RightAnalogUD:8;
jksoft 0:76dfa9657d9d 52 /*
jksoft 0:76dfa9657d9d 53 7-9バイト目:アクセラレータ
jksoft 0:76dfa9657d9d 54  X軸: 1-255 (Neutral=128)
jksoft 0:76dfa9657d9d 55  Y軸: 1-255 (Neutral=128)
jksoft 0:76dfa9657d9d 56  Z軸: 1-255 (Neutral=128)
jksoft 0:76dfa9657d9d 57 */
jksoft 0:76dfa9657d9d 58 unsigned AcceleX:8;
jksoft 0:76dfa9657d9d 59 unsigned AcceleY:8;
jksoft 0:76dfa9657d9d 60 unsigned AcceleZ:8;
jksoft 0:76dfa9657d9d 61 /*
jksoft 0:76dfa9657d9d 62 10バイト目:設定(向き、設定)
jksoft 0:76dfa9657d9d 63  7-6bit目: アクセラレータ設定(0-3)
jksoft 0:76dfa9657d9d 64  5bit目: 左アナログ(0-1)
jksoft 0:76dfa9657d9d 65  4bit目: 右アナログ(0-1)
jksoft 0:76dfa9657d9d 66  3-1bit目: iOSデバイス向き(1-4)
jksoft 0:76dfa9657d9d 67 */
jksoft 0:76dfa9657d9d 68 unsigned DEV_DIR:4;
jksoft 0:76dfa9657d9d 69 unsigned RIGHT_ANALOG:1;
jksoft 0:76dfa9657d9d 70 unsigned LEFT_ANALOG:1;
jksoft 0:76dfa9657d9d 71 unsigned ACCELE_SETTING:2;
jksoft 0:76dfa9657d9d 72 }status;
jksoft 0:76dfa9657d9d 73 unsigned char data[10];
jksoft 0:76dfa9657d9d 74 }RCBController;