资源简介
里面资料很详细,自行下载查看,里面资料很详细,自行下载查看
代码片段和文件信息
/*
Copyright (c) 2013 Arduino LLC. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License or (at your option) any later version.
This library is distributed in the hope that it will be useful
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not write to the Free Software
Foundation Inc. 51 Franklin St Fifth Floor Boston MA 02110-1301 USA
*/
#include “Bridge.h“
BridgeClass::BridgeClass(Stream &_stream) :
index(0) stream(_stream) started(false) max_retries(0) {
// Empty
}
void BridgeClass::begin() {
if (started)
return;
started = true;
// Wait for U-boot to finish startup
do {
dropAll();
delay(1000);
} while (stream.available() > 0);
while (true) {
// Bridge interrupt:
// - Ask the bridge to close itself
uint8_t quit_cmd[] = {‘X‘ ‘X‘ ‘X‘ ‘X‘ ‘X‘};
max_retries = 1;
transfer(quit_cmd 5);
// Bridge startup:
// - If the bridge is not running starts it safely
stream.print(CTRL_C);
delay(250);
stream.print(F(“\n“));
delay(250);
stream.print(F(“\n“));
delay(500);
// Wait for OpenWRT message
// “Press enter to activate console“
stream.print(F(“run-bridge\n“));
delay(500);
dropAll();
// Reset the brigde to check if it is running
uint8_t cmd[] = {‘X‘ ‘X‘ ‘1‘ ‘0‘ ‘0‘};
uint8_t res[4];
max_retries = 50;
uint16_t l = transfer(cmd 5 res 4);
if (l == TRANSFER_TIMEOUT) {
// Bridge didn‘t start...
// Maybe the board is starting-up?
// Wait and retry
delay(1000);
continue;
}
if (res[0] != 0)
while (true);
// Detect bridge version
if (l == 4) {
bridgeVersion = (res[1]-‘0‘)*100 + (res[2]-‘0‘)*10 + (res[3]-‘0‘);
} else {
// Bridge v1.0.0 didn‘t send any version info
bridgeVersion = 100;
}
max_retries = 50;
return;
}
}
void BridgeClass::put(const char *key const char *value) {
// TODO: do it in a more efficient way
String cmd = “D“;
uint8_t res[1];
cmd += key;
cmd += “\xFE“;
cmd += value;
transfer((uint8_t*)cmd.c_str() cmd.length() res 1);
}
unsigned int BridgeClass::get(const char *key uint8_t *value unsigned int maxlen) {
uint8_t cmd[] = {‘d‘};
unsigned int l = transfer(cmd 1 (uint8_t *)key strlen(key) value maxlen);
if (l < maxlen)
value[l] = 0; // Zero-terminate string
return l;
}
#if defined(ARDUINO_ARCH_AVR)
// AVR use an optimized implementation of CRC
#include
#else
// Generic implementation for non-AVR architectures
uint16_t _crc_ccitt_update(uin
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 525644 2018-06-14 15:17 PS2遥控手柄使用说明书.pdf
目录 0 2018-06-14 11:32 PS2遥控手柄测试代码(Arduino UNO)\
目录 0 2018-06-14 15:18 PS2遥控手柄测试代码(Arduino UNO)\PS2_For_Arduino\
文件 2250 2018-06-14 15:18 PS2遥控手柄测试代码(Arduino UNO)\PS2_For_Arduino\PS2_For_Arduino.ino
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\
文件 993 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\README.adoc
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\Bridge\
文件 4182 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\Bridge\Bridge.ino
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\ConsoleAsciiTable\
文件 2552 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\ConsoleAsciiTable\ConsoleAsciiTable.ino
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\ConsolePixel\
文件 1693 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\ConsolePixel\ConsolePixel.ino
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\ConsoleRead\
文件 1530 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\ConsoleRead\ConsoleRead.ino
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\Datalogger\
文件 2699 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\Datalogger\Datalogger.ino
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\FileWritesc
文件 2369 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\FileWritesc
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\HttpClient\
文件 1121 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\HttpClient\HttpClient.ino
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\MailboxReadMessage\
文件 1321 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\MailboxReadMessage\MailboxReadMessage.ino
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\Process\
文件 1888 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\Process\Process.ino
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\ShellCommands\
文件 1673 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\ShellCommands\ShellCommands.ino
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\SpacebrewYun\
目录 0 2018-06-14 11:31 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\SpacebrewYun\inputOutput\
文件 3323 2015-06-15 11:20 PS2遥控手柄测试代码(Arduino UNO)\相关的库文件\Bridge\examples\SpacebrewYun\inputOutput\inputOutput.ino
............此处省略1506个文件信息
相关资源
- 24l01遥控器的收发控制小车
- L298N控制遥控小车
- 全志a33软硬件开发资料合集
- ESP8266+5V+WiFi继电器智能物联网模块+智
- 32小车全.zip
- 烽火HG680-j非高安(联通电信遥控通用
- STC单片机无线遥控解码程序
- 烽火HG680-j非高安(联通电信遥控通用
- STM32源码.zip
- 嵌入式Linux软硬件开发详解 基于S5PV
- 红外遥控小车代码,可控制小车的转
- diy 12通道航模遥控器资料
- 红外遥控APP
- STM32开发实战 LabVIEW卷_14020414
- EasyTouch开发 虚拟遥控控制角色移动源
- 51单片机 红外寻迹 + 蓝牙 + 超声避障
- 红外遥控码库
- NEC红外遥控协议分析插件
- 433遥控.rar
- 惠而浦空调遥控协议分析相关文件
- 吾爱首发多功能遥控器v1.0免费绿色版
- STM32 红外遥控
- stm32f030+PWM->IR红外(38K)自定义格式
- 基于MSP430F5529单片机的蓝牙遥控小车
- 基于AT89S52的远距离照明控制无线遥控
- 自己动手做一个遥控器
- mega2560核心板原理图,封装,引脚说明
- 基于单片机的智能电子遥控车位锁设
- 通用红外遥控设备.zip
- 美的空调遥控全解码
评论
共有 条评论