AndroidのBLEラジコンプロポアプリ「BLEPropo」と接続し、RCサーボとDCモータを制御するプログラムです。 BLE Nanoで動作を確認しています。 BLEPropo → https://github.com/lipoyang/BLEPropo
BLEを使ったAndroid用ラジコンプロポアプリ「BLEPropo」に対応するBLE Nano用ファームウェアです。
BLEPropoは、GitHubにて公開中。
https://github.com/lipoyang/BLEPropo
ラジコンは、mbed HRM1017とRCサーボやDCモータを組み合わせて作ります。
回路図
/media/uploads/lipoyang/ministeer3.pdf
nRF51822/nordic/app_common/crc16.cpp@5:7f89fca19a9e, 2015-03-14 (annotated)
- Committer:
- lipoyang
- Date:
- Sat Mar 14 12:02:48 2015 +0000
- Revision:
- 5:7f89fca19a9e
-convert nRF51822 library to a folder
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
lipoyang | 5:7f89fca19a9e | 1 | /* Copyright (c) 2013 Nordic Semiconductor. All Rights Reserved. |
lipoyang | 5:7f89fca19a9e | 2 | * |
lipoyang | 5:7f89fca19a9e | 3 | * The information contained herein is property of Nordic Semiconductor ASA. |
lipoyang | 5:7f89fca19a9e | 4 | * Terms and conditions of usage are described in detail in NORDIC |
lipoyang | 5:7f89fca19a9e | 5 | * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. |
lipoyang | 5:7f89fca19a9e | 6 | * |
lipoyang | 5:7f89fca19a9e | 7 | * Licensees are granted free, non-transferable use of the information. NO |
lipoyang | 5:7f89fca19a9e | 8 | * WARRANTY of ANY KIND is provided. This heading must NOT be removed from |
lipoyang | 5:7f89fca19a9e | 9 | * the file. |
lipoyang | 5:7f89fca19a9e | 10 | * |
lipoyang | 5:7f89fca19a9e | 11 | */ |
lipoyang | 5:7f89fca19a9e | 12 | |
lipoyang | 5:7f89fca19a9e | 13 | #include "crc16.h" |
lipoyang | 5:7f89fca19a9e | 14 | #include <stdio.h> |
lipoyang | 5:7f89fca19a9e | 15 | |
lipoyang | 5:7f89fca19a9e | 16 | uint16_t crc16_compute(const uint8_t * p_data, uint32_t size, const uint16_t * p_crc) |
lipoyang | 5:7f89fca19a9e | 17 | { |
lipoyang | 5:7f89fca19a9e | 18 | uint32_t i; |
lipoyang | 5:7f89fca19a9e | 19 | uint16_t crc = (p_crc == NULL) ? 0xffff : *p_crc; |
lipoyang | 5:7f89fca19a9e | 20 | |
lipoyang | 5:7f89fca19a9e | 21 | for (i = 0; i < size; i++) |
lipoyang | 5:7f89fca19a9e | 22 | { |
lipoyang | 5:7f89fca19a9e | 23 | crc = (unsigned char)(crc >> 8) | (crc << 8); |
lipoyang | 5:7f89fca19a9e | 24 | crc ^= p_data[i]; |
lipoyang | 5:7f89fca19a9e | 25 | crc ^= (unsigned char)(crc & 0xff) >> 4; |
lipoyang | 5:7f89fca19a9e | 26 | crc ^= (crc << 8) << 4; |
lipoyang | 5:7f89fca19a9e | 27 | crc ^= ((crc & 0xff) << 4) << 1; |
lipoyang | 5:7f89fca19a9e | 28 | } |
lipoyang | 5:7f89fca19a9e | 29 | |
lipoyang | 5:7f89fca19a9e | 30 | return crc; |
lipoyang | 5:7f89fca19a9e | 31 | } |