【これは旧バージョンです】 AndroidのBLEラジコンプロポアプリ「BLEPropo」と接続し、RCサーボとDCモータを制御するプログラムです。 mbed HRM1017で動作を確認しています。 BLEPropo → https://github.com/lipoyang/BLEPropo
Fork of BLE_RCBController2 by
BLEを使ったAndroid用ラジコンプロポアプリ「BLEPropo」に対応するmbed HRM1017用ファームウェアです。
BLEPropoは、GitHubにて公開中。
https://github.com/lipoyang/BLEPropo
ラジコンは、mbed HRM1017とRCサーボやDCモータを組み合わせて作ります。
HRM1017/common/ansi_escape.h@13:2075c4878557, 2014-09-18 (annotated)
- Committer:
- lipoyang
- Date:
- Thu Sep 18 04:47:00 2014 +0000
- Revision:
- 13:2075c4878557
- Parent:
- 4:ebda47d22091
Servo????????
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jksoft | 0:8c643bfe55b7 | 1 | /**************************************************************************/ |
jksoft | 0:8c643bfe55b7 | 2 | /*! |
jksoft | 0:8c643bfe55b7 | 3 | @file ansi_esc_code.h |
jksoft | 0:8c643bfe55b7 | 4 | @author hathach (tinyusb.org) |
jksoft | 0:8c643bfe55b7 | 5 | |
jksoft | 0:8c643bfe55b7 | 6 | @section LICENSE |
jksoft | 0:8c643bfe55b7 | 7 | |
jksoft | 0:8c643bfe55b7 | 8 | Software License Agreement (BSD License) |
jksoft | 0:8c643bfe55b7 | 9 | |
jksoft | 0:8c643bfe55b7 | 10 | Copyright (c) 2013, hathach (tinyusb.org) |
jksoft | 0:8c643bfe55b7 | 11 | All rights reserved. |
jksoft | 0:8c643bfe55b7 | 12 | |
jksoft | 0:8c643bfe55b7 | 13 | Redistribution and use in source and binary forms, with or without |
jksoft | 0:8c643bfe55b7 | 14 | modification, are permitted provided that the following conditions are met: |
jksoft | 0:8c643bfe55b7 | 15 | 1. Redistributions of source code must retain the above copyright |
jksoft | 0:8c643bfe55b7 | 16 | notice, this list of conditions and the following disclaimer. |
jksoft | 0:8c643bfe55b7 | 17 | 2. Redistributions in binary form must reproduce the above copyright |
jksoft | 0:8c643bfe55b7 | 18 | notice, this list of conditions and the following disclaimer in the |
jksoft | 0:8c643bfe55b7 | 19 | documentation and/or other materials provided with the distribution. |
jksoft | 0:8c643bfe55b7 | 20 | 3. Neither the name of the copyright holders nor the |
jksoft | 0:8c643bfe55b7 | 21 | names of its contributors may be used to endorse or promote products |
jksoft | 0:8c643bfe55b7 | 22 | derived from this software without specific prior written permission. |
jksoft | 0:8c643bfe55b7 | 23 | |
jksoft | 0:8c643bfe55b7 | 24 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY |
jksoft | 0:8c643bfe55b7 | 25 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED |
jksoft | 0:8c643bfe55b7 | 26 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE |
jksoft | 0:8c643bfe55b7 | 27 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY |
jksoft | 0:8c643bfe55b7 | 28 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES |
jksoft | 0:8c643bfe55b7 | 29 | INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
jksoft | 0:8c643bfe55b7 | 30 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION HOWEVER CAUSED AND |
jksoft | 0:8c643bfe55b7 | 31 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT |
jksoft | 0:8c643bfe55b7 | 32 | INCLUDING NEGLIGENCE OR OTHERWISE ARISING IN ANY WAY OUT OF THE USE OF THIS |
jksoft | 0:8c643bfe55b7 | 33 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
jksoft | 0:8c643bfe55b7 | 34 | |
jksoft | 0:8c643bfe55b7 | 35 | This file is part of the tinyusb stack. |
jksoft | 0:8c643bfe55b7 | 36 | */ |
jksoft | 0:8c643bfe55b7 | 37 | /**************************************************************************/ |
jksoft | 0:8c643bfe55b7 | 38 | |
jksoft | 0:8c643bfe55b7 | 39 | /** \file |
jksoft | 0:8c643bfe55b7 | 40 | * \brief TBD |
jksoft | 0:8c643bfe55b7 | 41 | * |
jksoft | 0:8c643bfe55b7 | 42 | * \note TBD |
jksoft | 0:8c643bfe55b7 | 43 | */ |
jksoft | 0:8c643bfe55b7 | 44 | |
jksoft | 0:8c643bfe55b7 | 45 | /** \ingroup TBD |
jksoft | 0:8c643bfe55b7 | 46 | * \defgroup TBD |
jksoft | 0:8c643bfe55b7 | 47 | * \brief TBD |
jksoft | 0:8c643bfe55b7 | 48 | * |
jksoft | 0:8c643bfe55b7 | 49 | * @{ |
jksoft | 0:8c643bfe55b7 | 50 | */ |
jksoft | 0:8c643bfe55b7 | 51 | |
jksoft | 0:8c643bfe55b7 | 52 | #ifndef _ANSI_ESC_CODE_H_ |
jksoft | 0:8c643bfe55b7 | 53 | #define _ANSI_ESC_CODE_H_ |
jksoft | 0:8c643bfe55b7 | 54 | |
jksoft | 0:8c643bfe55b7 | 55 | |
jksoft | 0:8c643bfe55b7 | 56 | #ifdef __cplusplus |
jksoft | 0:8c643bfe55b7 | 57 | extern "C" { |
jksoft | 0:8c643bfe55b7 | 58 | #endif |
jksoft | 0:8c643bfe55b7 | 59 | |
jksoft | 0:8c643bfe55b7 | 60 | #define CSI_CODE(seq) "\33[" seq |
jksoft | 0:8c643bfe55b7 | 61 | #define CSI_SGR(x) CSI_CODE(#x) "m" |
jksoft | 0:8c643bfe55b7 | 62 | |
jksoft | 0:8c643bfe55b7 | 63 | //------------- Cursor movement -------------// |
jksoft | 0:8c643bfe55b7 | 64 | #define ANSI_CURSOR_UP(n) CSI_CODE(#n "A") |
jksoft | 0:8c643bfe55b7 | 65 | #define ANSI_CURSOR_DOWN(n) CSI_CODE(#n "B") |
jksoft | 0:8c643bfe55b7 | 66 | #define ANSI_CURSOR_FORWARD(n) CSI_CODE(#n "C") |
jksoft | 0:8c643bfe55b7 | 67 | #define ANSI_CURSOR_BACKWARD(n) CSI_CODE(#n "D") |
jksoft | 0:8c643bfe55b7 | 68 | #define ANSI_CURSOR_LINE_DOWN(n) CSI_CODE(#n "E") |
jksoft | 0:8c643bfe55b7 | 69 | #define ANSI_CURSOR_LINE_UP(n) CSI_CODE(#n "F") |
jksoft | 0:8c643bfe55b7 | 70 | #define ANSI_CURSOR_POSITION(n, m) CSI_CODE(#n ";" #m "H") |
jksoft | 0:8c643bfe55b7 | 71 | |
jksoft | 0:8c643bfe55b7 | 72 | #define ANSI_ERASE_SCREEN(n) CSI_CODE(#n "J") |
jksoft | 0:8c643bfe55b7 | 73 | #define ANSI_ERASE_LINE(n) CSI_CODE(#n "K") |
jksoft | 0:8c643bfe55b7 | 74 | |
jksoft | 0:8c643bfe55b7 | 75 | /** text color */ |
jksoft | 0:8c643bfe55b7 | 76 | #define ANSI_TEXT_BLACK CSI_SGR(30) |
jksoft | 0:8c643bfe55b7 | 77 | #define ANSI_TEXT_RED CSI_SGR(31) |
jksoft | 0:8c643bfe55b7 | 78 | #define ANSI_TEXT_GREEN CSI_SGR(32) |
jksoft | 0:8c643bfe55b7 | 79 | #define ANSI_TEXT_YELLOW CSI_SGR(33) |
jksoft | 0:8c643bfe55b7 | 80 | #define ANSI_TEXT_BLUE CSI_SGR(34) |
jksoft | 0:8c643bfe55b7 | 81 | #define ANSI_TEXT_MAGENTA CSI_SGR(35) |
jksoft | 0:8c643bfe55b7 | 82 | #define ANSI_TEXT_CYAN CSI_SGR(36) |
jksoft | 0:8c643bfe55b7 | 83 | #define ANSI_TEXT_WHITE CSI_SGR(37) |
jksoft | 0:8c643bfe55b7 | 84 | #define ANSI_TEXT_DEFAULT CSI_SGR(39) |
jksoft | 0:8c643bfe55b7 | 85 | |
jksoft | 0:8c643bfe55b7 | 86 | /** background color */ |
jksoft | 0:8c643bfe55b7 | 87 | #define ANSI_BG_BLACK CSI_SGR(40) |
jksoft | 0:8c643bfe55b7 | 88 | #define ANSI_BG_RED CSI_SGR(41) |
jksoft | 0:8c643bfe55b7 | 89 | #define ANSI_BG_GREEN CSI_SGR(42) |
jksoft | 0:8c643bfe55b7 | 90 | #define ANSI_BG_YELLOW CSI_SGR(43) |
jksoft | 0:8c643bfe55b7 | 91 | #define ANSI_BG_BLUE CSI_SGR(44) |
jksoft | 0:8c643bfe55b7 | 92 | #define ANSI_BG_MAGENTA CSI_SGR(45) |
jksoft | 0:8c643bfe55b7 | 93 | #define ANSI_BG_CYAN CSI_SGR(46) |
jksoft | 0:8c643bfe55b7 | 94 | #define ANSI_BG_WHITE CSI_SGR(47) |
jksoft | 0:8c643bfe55b7 | 95 | #define ANSI_BG_DEFAULT CSI_SGR(49) |
jksoft | 0:8c643bfe55b7 | 96 | |
jksoft | 0:8c643bfe55b7 | 97 | #ifdef __cplusplus |
jksoft | 0:8c643bfe55b7 | 98 | } |
jksoft | 0:8c643bfe55b7 | 99 | #endif |
jksoft | 0:8c643bfe55b7 | 100 | |
jksoft | 0:8c643bfe55b7 | 101 | #endif /* _TUSB_ANSI_ESC_CODE_H_ */ |
jksoft | 0:8c643bfe55b7 | 102 | |
jksoft | 0:8c643bfe55b7 | 103 | /** @} */ |