ev3 commanderev3怎么蓝牙连接用

Change Region
België (Nederlands)
Belgique (Français)
?eská republika (?e?tina)
Danmark (Dansk)
Deutschland (Deutsch)
España (Español)
France (Français)
Italia (Italiano)
Latinoamérica (Español)
Magyarország (Magyar)
Nederland (Nederlands)
Norge (Norsk, bokmål)
Polska (Polski)
Singapore (English)
Suomi (Suomi)
Sverige (Svenska)
Türkiye (Türkçe)
United Kingdom (English)
United States (English)
Россия (Русский)
???? (???)
中华人民共和国 (中文)
日本 (日本語)
LEGO MINDSTORMS EV3 makes building, programming and commanding your own LEGO robots smarter, faster, and more fun than ever. Follow the simple steps below and before you know it, you&ll be in control of robots that drive, shoot, slither, walk, slam, and spin & to name just a few of the actions that come with this awesome robotics set.
1) Build your robot
It is everything you need in one box: bricks, motors, and sensors to build any of 17 EV3 robots. Just make your pick.
2) Bring your robot to life
Use the Free EV3 Programmer App to bring your robot to life with your tablet. Choose a program, press play, and watch your robot carry out the action. Or download the programming software to your PC or Mac for even more programming features.
3) Command and play
Use your smartphone or tablet as a remote control to steer your robots and challenge your friends to fun robot games. The Free EV3 Commander App puts the power right in your hands.
4) Share your creation
Share your creations with the LEGO MINDSTORMS community, and get inspired by other robot builders to create even more fun robots.
5) Rebuild for more adventures
Rebuild your robot into any of the other 16 EV3 models and have fun with new actions and new missions.
SYSTEM REQUIREMENTS
APPS FOR TABLET AND SMARTPHONE
SOFTWARE (PC/MAC)
Windows XP (32-bit only) and Vista (32/64-bit) excluding Starter Edition – with the latest Service Packs. Windows 7 (32/64-bit) and Windows 8 desktop mode including Starter Edition – with the latest Service Packs
Dual-core processor 2.0 GHz or better
2 GB of RAM or more
2 GB of available hard-disk space
XGA display (1024 x 768)
1 available USB port
&*) Only for installation and use of the EV3 Programming Software
Mac OS 10.6, 10.7 and 10.8 with the latest Service Packs
Dual-core processor 2.0 GHz or better
2 GB of RAM or more
2 GB of available hard-disk space
XGA display (1024 x 768)
1 available USB port
&*) Only for installation and use of the EV3 Programming Software
Robots you can build from the LEGO MINDSTORMS EV3 set:乐高机器人ev3怎么编程?(用电脑编,软件下好了)_百度知道
乐高机器人ev3怎么编程?(用电脑编,软件下好了)
p>&/zhidao/wh%3D600%2C800/sign=cae505f2f503738dde1fc69/f9dcd100baa1cdba12c8fcc2ce2d82.hiphotos.baidu:///zhidao/wh%3D450%2C600/sign=4af6fc79b351f819f1700b4eef8466db/f9dcd100baa1cdba12c8fcc2ce2d82.hiphotos://d.jpg" target="_blank" title="点击查看大图" class="ikqb_img_alink"><img class="ikqb_img" src="/zhidao/pic/item/f9dcd100baa1cdba12c8fcc2ce2d82.baidu://d;<a href="http.hiphotos.jpg" esrc="http
我有更好的答案
把要用的东西移上去
怎么移?我试过,没有达成我想要的结果
按住移动。
其他类似问题
为您推荐:
乐高机器人的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁乐高Mindstorms EV3试玩:充满乐趣的机器人玩具 - 少数派
乐高Mindstorms EV3试玩:充满乐趣的机器人玩具
乐高Mindstorms EV3试玩:充满乐趣的机器人玩具
新一代的乐高机器人终于来了,同时也带来了非常有趣的力量。Mindstorms系列是乐高所制造的可编程拼装机器人玩具,自1998年问世至今已经推出到了第三代。
作为第三代的产品,Mindstorms EV3的高度达到了40.64厘米,同时还带有一整套的传感器和马达。虽然EV3还不能帮你做饭或是遛狗,但它已经可以识别颜色级别,向空中发射红球,并能够遵循复杂的编程命令。从本质上看,EV3是一部可以发挥无限想象空间的玩具;说的更实际点,它是一部售价350美元(约合人民币2100元)的机器人编程试验场,且物有所值。
即便是开箱的过程都让人屏息。所有的零件都被单独包装着——马达、传感器、说明书、还有594块乐高积木。在核心位置的脑部积木当中,蕴藏着ARM9 300MHz处理器,64MB内存,16MB闪存。你可以通过机身上的USB接口将该部位连接至电脑,而对于机器人的控制则通过蓝牙配对在手机或平板上进行,程序、声音的发送需要依赖于Wi-Fi,另外还有一个SD卡槽用于存储更多文件。
乐高的EV3系列共有5款机器人,包括(一条鬼鬼祟祟的眼镜蛇),坦克一般的,6条腿的大蝎子等。每一款机器人都有自己独特的功能,比如抓取或是发射小球。不过这些机器人都配备了2个大型马达,一个小马达,一个触控传感器,一个红外线传感器,以及一个色彩传感器。在拼装完成之后,用户可以使用附带的遥控器控制机器人在屋内移动。
即便是不先组装机器人,你也可以对核心进行编程。想要测试一下马达和传感器的工作方式,这不失为一种好方法。EV3的核心组件和之前的NXT系列(第二代Mindstorms,2006年问世)很像,但前者在编程上提供了更大的灵活性。
相比之前的型号,EV3另一个巨大的升级就是加入了iOS和Android应用来帮助用户安装机器人。应用当中包含了每一个安装步骤的三维、交互视图,你可以放大、旋转或观看动画,以更好的了解每个部位的拼装过程。相比平面的说明书,这种指导无疑要更加直观和实用。
由于Mindstorms EV3主要是为儿童设计的,笔者邀请了两位小朋友——12岁的男孩和16岁的女孩各一名——来试玩这部机器人。他们拼装完成了大部分结构,包括主躯干和腿,整个过程耗时90分钟。剩余部分由笔者接手,耗时依然是90分钟。因此组装这部机器人一共耗时3小时。
和乐高其他所有的项目一样,EV3的积木都很小,但色彩协调。在组装时,我们在寻找一些非常微小的积木时碰到了点麻烦。而在组装手臂时,我们又犯了一个小的计算错误,并导致整个手臂的组装要重新来过。但无论如何,这个过程依然很有趣。
对机器人进行编程非常简单。编程软件共有Windows和Mac两个版本,使用方式和图表工具类似(比如Microsoft Visio或是Google SketchUp)。你可以把指导模组拖拽到空白画布上并点击播放图标。乐高说整个编程过程大约需要20分钟,但我的小组只用了10分钟就可以让机器人行走和停止了。
我们还制作了一个使用到红外传感器的程序。如果你在机器人行进的过程中把用手遮住它的“眼镜”,它便会停止并播放预先设定的语音。
随后我们向一位程序员朋友求助,请他编写了一个更加复杂的程序,让机器人可以感应到不同的色彩。顺便提一下,EV3可以识别红色这样的明亮颜色,但在绿色和棕色的识别上会有困难。
但是,这个编程软件有一些限制。当中无法进行复制粘贴,在设计复杂的程序时,鼠标光标也会出现延迟。
在完成了编程之后,我们还尝试了名为Robot Commander的手机应用。该应用有iOS和Android版本,可通过蓝牙对机器人进行控制,比如下达“前进”和“滑行”这样的指令。此外,你还可以语音下达各种移动控制指令。
无论是之前的NXT和新款EV3,你都能够获得一个相当丰厚的回报。一旦你掌握了基本套路,就可以进行一些深入的尝试,甚至是自行制作外壳。在某些方面,乐高在机器人领域可谓是精神领袖,因为他们的产品如此的简单且充满乐趣。
参与到测试当中的两位青少年在一个半小时的时间内进行了紧密的合作,这个长度的集中精力对于如今的孩子来说已经很少见了。
笔者已经有一段时间没有见过如此迷人的设备了。除了编程软件上存在的一些小问题之外,EV3是一部非常棒的玩具。对于有抱负的工程师来说,EV3是质量和乐趣上的又一次重大进步。
分享到微信
Email 登录
商务&合作:
投稿&报道:
微信订阅二维码您的举报已经提交成功,我们将尽快处理,谢谢!
这个是可以配的
这个没有单独卖的。每块接收板都有独立的编码,接收板与遥控器就像钥匙与锁的关系。
大家还关注
(window.slotbydup=window.slotbydup || []).push({
id: '2081942',
container: s,
size: '1000,60',
display: 'inlay-fix'myrobot-master
Base.lproj
Main.storyboard
ControlPad
Images.xcassets
AppIcon.appiconset
Contents.json
LaunchImage.launchimage
Contents.json
iOS_WiFi_EV3_Library
analogue_bg.png
analogue_bg@2x.png
analogue_handle.png
analogue_handle@2x.png
button-pressed.png
button-pressed@2x.png
button.png
button@2x.png
ColorSensor.png
dPad-Down.png
dPad-Down@2x.png
dPad-DownLeft.png
dPad-DownLeft@2x.png
dPad-DownRight.png
dPad-DownRight@2x.png
dPad-Left.png
dPad-Left@2x.png
dPad-None.png
dPad-None@2x.png
dPad-Right.png
dPad-Right@2x.png
dPad-Up.png
dPad-Up@2x.png
dPad-UpLeft.png
dPad-UpLeft@2x.png
dPad-UpRight.png
dPad-UpRight@2x.png
GyroSensor.png
InfraredSensor.png
LargeMotor.png
MediumMotor.png
TouchSensor.png
UltrasonicSensor.png
Unknown.png
Info.plist
MyRobot.xcodeproj
project.xcworkspace
xcshareddata
MyRobot.xccheckout
xcuserdata
crazypoo.xcuserdatad
UserInterfaceState.xcuserstate
dengjiehao.xcuserdatad
UserInterfaceState.xcuserstate
libinggen.xcuserdatad
UserInterfaceState.xcuserstate
contents.xcworkspacedata
xcuserdata
crazypoo.xcuserdatad
MyRobot.xcscheme
xcschememanagement.plist
dengjiehao.xcuserdatad
MyRobot.xcscheme
xcschememanagement.plist
libinggen.xcuserdatad
MyRobot.xcscheme
xcschememanagement.plist
project.pbxproj
MyRobotTests
Info.plist
Myrobot-Prefix.pch
myrobot-master
Base.lproj
._Main.storyboard
ControlPad
Images.xcassets
AppIcon.appiconset
._Contents.json
LaunchImage.launchimage
._Contents.json
._AppIcon.appiconset
._LaunchImage.launchimage
iOS_WiFi_EV3_Library
._analogue_bg.png
._analogue_bg@2x.png
._analogue_handle.png
._analogue_handle@2x.png
._button-pressed.png
._button-pressed@2x.png
._button.png
._button@2x.png
._ColorSensor.png
._dPad-Down.png
._dPad-Down@2x.png
._dPad-DownLeft.png
._dPad-DownLeft@2x.png
._dPad-DownRight.png
._dPad-DownRight@2x.png
._dPad-Left.png
._dPad-Left@2x.png
._dPad-None.png
._dPad-None@2x.png
._dPad-Right.png
._dPad-Right@2x.png
._dPad-Up.png
._dPad-Up@2x.png
._dPad-UpLeft.png
._dPad-UpLeft@2x.png
._dPad-UpRight.png
._dPad-UpRight@2x.png
._Empty.png
._GyroSensor.png
._InfraredSensor.png
._Init.png
._LargeMotor.png
._MediumMotor.png
._TouchSensor.png
._UltrasonicSensor.png
._Unknown.png
._Base.lproj
._ControlPad
._Images.xcassets
._Info.plist
._iOS_WiFi_EV3_Library
._Resource
MyRobot.xcodeproj
project.xcworkspace
xcshareddata
._MyRobot.xccheckout
xcuserdata
crazypoo.xcuserdatad
._UserInterfaceState.xcuserstate
dengjiehao.xcuserdatad
._UserInterfaceState.xcuserstate
._crazypoo.xcuserdatad
._dengjiehao.xcuserdatad
._contents.xcworkspacedata
._xcshareddata
._xcuserdata
xcuserdata
crazypoo.xcuserdatad
._MyRobot.xcscheme
._xcschememanagement.plist
._xcschemes
dengjiehao.xcuserdatad
._MyRobot.xcscheme
._xcschememanagement.plist
._xcschemes
._crazypoo.xcuserdatad
._dengjiehao.xcuserdatad
._project.pbxproj
._project.xcworkspace
._xcuserdata
MyRobotTests
._Info.plist
._.DS_Store
._Myrobot-Prefix.pch
._MyRobot.xcodeproj
._MyRobotTests
._README.md
._myrobot-master
EV3DirectCommander.m
Created by FloodSurge on 5/9/14.
Copyright (c) 2014 FloodSurge. All rights reserved.
// 鐗堟潈灞炰簬鍘熶綔鑰?//
(cn) http://code4app.net (en)
// 鍙戝竷浠g爜浜庢渶涓撲笟鐨勬簮鐮佸垎浜?綉绔?
#import &EV3DirectCommander.h&
@interface EV3DirectCommander ()
Byte buffer[1008];
@implementation EV3DirectCommander
#pragma mark - Basic Methods
- (id)initWithCommandType:(EV3CommandType)commandType
globalSize:(UInt16)globalSize
localSize:(int)localSize
self = [super init];
if (self) {
// Set BTstack delegate to receive packet
//[BTstackManager sharedInstance].delegate =
// Command size,this gets filled later
buffer[0] = 0
buffer[1] = 0
// Message count set default 0x00
buffer[2] = 0x00;
buffer[3] = 0x00;
// Command type
buffer[4] = commandT
buffer[5] = globalSize & 0
buffer[6] = (Byte)((localSize && 2) | ((globalSize && 8) & 0x03));
cursor = 7;
- (void)addOperationCode:(EV3OperationCode)operationCode
if (operationCode & EV3OperationTest) {
buffer[cursor] = (operationCode & 0xff00)&& 8;
buffer[cursor] = operationCode & 0
- (void)addParameterWithInt8:(Byte)parameter
buffer[cursor] = EV3ParameterSizeB
buffer[cursor] =
- (void)addParameterWithInt16:(UInt16)parameter
buffer[cursor] = EV3ParameterSizeInt16;
buffer[cursor] = (Byte)
buffer[cursor] = (Byte)((parameter & 0xff00) && 8);
- (void)addParameterWithInt32:(UInt32)parameter
buffer[cursor] = EV3ParameterSizeInt32;
buffer[cursor] = (Byte)
buffer[cursor] = (Byte)((parameter & 0xff00) && 8);
buffer[cursor] = (Byte)((parameter & 0xff0000) && 16);
buffer[cursor] = (Byte)((parameter & 0xff000000) && 24);
- (void)addParameterWithString:(NSString *)string
buffer[cursor] = EV3ParameterSizeS
NSData *byteData = [string dataUsingEncoding:NSUTF8StringEncoding];
Byte * bytes = (Byte *)byteData.
NSLog(@&Bytes: &);
for (int i = 0; i & byteData. i++) {
buffer[cursor] = bytes[i];
NSLog(@&%d &,bytes[i]);
buffer[cursor] = 0x00;
- (void)addRawParameterWithInt8:(Byte)parameter
buffer[cursor] =
- (void)addGlobalIndex:(Byte)index
buffer[cursor] = 0xe1;
buffer[cursor] =
- (void)addCommandSize
Byte commandSize = cursor - 2;
//NSLog(@&command size:%d&,commandSize);
buffer[0] = commandSize & 0
buffer[1] = (commandSize & 0xff00) && 8;
- (NSData *)assembledCommandData
[self addCommandSize];
return [NSData dataWithBytes:buffer length:cursor];
- (void)addCommandReadSensorTypeAndModeAtPort:(EV3InputPort)port globalIndex:(Byte)index
[self addOperationCode:EV3OperationInputDeviceGetTypeMode];
[self addParameterWithInt8:0x00];
[self addParameterWithInt8:port];
[self addGlobalIndex:index];
[self addGlobalIndex:index + 1];
- (void)addCommandReadSensorDataAtPort:(EV3InputPort)port mode:(Byte)mode
globalIndex:(Byte)index
[self addOperationCode:EV3OperationInputDeviceReadyRaw];
[self addParameterWithInt8:0x00];
[self addParameterWithInt8:port];
[self addParameterWithInt8:0x00];
[self addParameterWithInt8:mode];
[self addParameterWithInt8:0x01];
[self addGlobalIndex:index];
#pragma mark - Direct Command
#pragma mark - Motor Control Method
+ (NSData *)turnMotorAtPort:(EV3OutputPort)port power:(int)power
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationOutputPower];
[command addParameterWithInt8:0];
[command addParameterWithInt8:port];
if (abs(power) & 100) {
[command addParameterWithInt8:100];
[command addParameterWithInt8:(Byte)power];
[command addOperationCode:EV3OperationOutputStart];
[command addParameterWithInt8:0];
[command addParameterWithInt8:port];
return [command assembledCommandData];
+ (NSData *)turnMotorAtPort:(EV3OutputPort)port power:(int)power degrees:(UInt32)degrees
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationOutputStepPower];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:port];
[command addParameterWithInt8:(Byte)power];
[command addParameterWithInt32:0x00];
[command addParameterWithInt32:degrees];
[command addParameterWithInt32:0x00];
[command addParameterWithInt8:0x01];
return [command assembledCommandData];
+ (NSData *)stopMotorAtPort:(EV3OutputPort)port
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationOutputStop];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:port];
[command addParameterWithInt8:0x01];
return [command assembledCommandData];
+ (NSData *)clearAllCommands
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationInputDeviceClearAll];
[command addParameterWithInt8:0x00];
return [command assembledCommandData];
#pragma mark - Sound Control Methods
+ (NSData *)playToneWithVolume:(int)volume frequency:(UInt16)frequency duration:(UInt16)duration
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationSoundTone];
[command addParameterWithInt8:(Byte)volume];
[command addParameterWithInt16:frequency];
[command addParameterWithInt16:duration];
return [command assembledCommandData];
+ (NSData *)playSoundWithVolume:(int)volume filename:(NSString *)filename repeat:(BOOL)repeat
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationSoundPlay];
[command addParameterWithInt8:(Byte)volume];
[command addParameterWithString:filename];
if (repeat) {
[command addOperationCode:EV3OperationSoundRepeat];
[command addParameterWithInt8:(Byte)volume];
[command addParameterWithString:filename];
return [command assembledCommandData];
+ (NSData *)soundBrake
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationSoundBreak];
return [command assembledCommandData];
#pragma mark - Image Control Methods
+ (NSData *)drawImageWithColor:(EV3ScreenColor)color x:(UInt16)x y:(UInt16)y fileName:(NSString *)fileName
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationUIDrawClean];
[command addOperationCode:EV3OperationUIDrawUpdate];
[command addOperationCode:EV3OperationUIDrawBmpFile];
[command addParameterWithInt8:color];
[command addParameterWithInt16:x];
[command addParameterWithInt16:y];
[command addParameterWithString:fileName];
[command addOperationCode:EV3OperationUIDrawUpdate];
return [command assembledCommandData];
+ (NSData *)drawText:(NSString *)text color:(EV3ScreenColor)color x:(UInt16)x y:(UInt16)y
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationUIDrawClean];
[command addOperationCode:EV3OperationUIDrawUpdate];
[command addOperationCode:EV3OperationUIDrawText];
[command addParameterWithInt8:color];
[command addParameterWithInt16:x];
[command addParameterWithInt16:y];
[command addParameterWithString:text];
[command addOperationCode:EV3OperationUIDrawUpdate];
return [command assembledCommandData];
+ (NSData *)updateUI
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationUIDrawUpdate];
return [command assembledCommandData];
+ (NSData *)clearUI
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationUIDrawClean];
return [command assembledCommandData];
+ (NSData *)drawFillWindowWithColor:(EV3ScreenColor)color y0:(UInt16)y0 y1:(UInt16)y1
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectNoReply globalSize:0 localSize:0];
[command addOperationCode:EV3OperationUIDrawClean];
[command addOperationCode:EV3OperationUIDrawUpdate];
[command addOperationCode:EV3OperationUIDrawFillWindow];
[command addParameterWithInt8:color];
[command addParameterWithInt16:y0];
[command addParameterWithInt16:y1];
[command addOperationCode:EV3OperationUIDrawUpdate];
return [command assembledCommandData];
#pragma mark - Sensor Control Methods
+ (NSData *)scanPorts
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectReply globalSize:32 localSize:0];
[command addCommandReadSensorTypeAndModeAtPort:EV3InputPort1 globalIndex:0];
[command addCommandReadSensorDataAtPort:EV3InputPort1 mode:0 globalIndex:2];
[command addCommandReadSensorTypeAndModeAtPort:EV3InputPort2 globalIndex:4];
[command addCommandReadSensorDataAtPort:EV3InputPort2 mode:0 globalIndex:6];
[command addCommandReadSensorTypeAndModeAtPort:EV3InputPort3 globalIndex:8];
[command addCommandReadSensorDataAtPort:EV3InputPort3 mode:0 globalIndex:10];
[command addCommandReadSensorTypeAndModeAtPort:EV3InputPort4 globalIndex:12];
[command addCommandReadSensorDataAtPort:EV3InputPort4 mode:0 globalIndex:14];
[command addCommandReadSensorTypeAndModeAtPort:EV3InputPortA globalIndex:16];
[command addCommandReadSensorDataAtPort:EV3InputPortA mode:0 globalIndex:18];
[command addCommandReadSensorTypeAndModeAtPort:EV3InputPortB globalIndex:20];
[command addCommandReadSensorDataAtPort:EV3InputPortB mode:0 globalIndex:22];
[command addCommandReadSensorTypeAndModeAtPort:EV3InputPortC globalIndex:24];
[command addCommandReadSensorDataAtPort:EV3InputPortC mode:0 globalIndex:26];
[command addCommandReadSensorTypeAndModeAtPort:EV3InputPortD globalIndex:28];
[command addCommandReadSensorDataAtPort:EV3InputPortD mode:0 globalIndex:30];
return [command assembledCommandData];
+ (NSData *)scanSensorTypeAndMode
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectReply globalSize:16 localSize:0];
[command addOperationCode:EV3OperationInputDeviceGetTypeMode];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPortA];
[command addGlobalIndex:0];
[command addGlobalIndex:1];
[command addOperationCode:EV3OperationInputDeviceGetTypeMode];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPortB];
[command addGlobalIndex:2];
[command addGlobalIndex:3];
[command addOperationCode:EV3OperationInputDeviceGetTypeMode];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPortC];
[command addGlobalIndex:4];
[command addGlobalIndex:5];
[command addOperationCode:EV3OperationInputDeviceGetTypeMode];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPortD];
[command addGlobalIndex:6];
[command addGlobalIndex:7];
[command addOperationCode:EV3OperationInputDeviceGetTypeMode];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPort1];
[command addGlobalIndex:8];
[command addGlobalIndex:9];
[command addOperationCode:EV3OperationInputDeviceGetTypeMode];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPort2];
[command addGlobalIndex:10];
[command addGlobalIndex:11];
[command addOperationCode:EV3OperationInputDeviceGetTypeMode];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPort3];
[command addGlobalIndex:12];
[command addGlobalIndex:13];
[command addOperationCode:EV3OperationInputDeviceGetTypeMode];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPort4];
[command addGlobalIndex:14];
[command addGlobalIndex:15];
return [command assembledCommandData];
+ (NSData *)scanSensorData
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectReply globalSize:16 localSize:0];
[command addOperationCode:EV3OperationInputDeviceReadyRaw];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPortA];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x01];
[command addGlobalIndex:0];
[command addOperationCode:EV3OperationInputDeviceReadyRaw];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPortB];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x01];
[command addGlobalIndex:2];
[command addOperationCode:EV3OperationInputDeviceReadyRaw];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPortC];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x01];
[command addGlobalIndex:4];
[command addOperationCode:EV3OperationInputDeviceReadyRaw];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPortD];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x01];
[command addGlobalIndex:6];
[command addOperationCode:EV3OperationInputDeviceReadyRaw];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPort1];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x01];
[command addGlobalIndex:8];
[command addOperationCode:EV3OperationInputDeviceReadyRaw];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPort2];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x01];
[command addGlobalIndex:10];
[command addOperationCode:EV3OperationInputDeviceReadyRaw];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPort3];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x01];
[command addGlobalIndex:12];
[command addOperationCode:EV3OperationInputDeviceReadyRaw];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:EV3InputPort4];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:0x01];
[command addParameterWithInt8:0x01];
[command addGlobalIndex:14];
return [command assembledCommandData];
+ (NSData *)readSensorTypeAndModeAtPort:(EV3InputPort)port
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectReply globalSize:2 localSize:0];
[command addOperationCode:EV3OperationInputDeviceGetTypeMode];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:port];
[command addGlobalIndex:0];
[command addGlobalIndex:1];
return [command assembledCommandData];
+ (NSData *)readSensorDataAtPort:(EV3InputPort)port mode:(int)mode
EV3DirectCommander *command = [[EV3DirectCommander alloc] initWithCommandType:EV3CommandTypeDirectReply globalSize:2 localSize:0];
[command addOperationCode:EV3OperationInputDeviceReadyRaw];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:port];
[command addParameterWithInt8:0x00];
[command addParameterWithInt8:(Byte)mode];
[command addParameterWithInt8:0x01];
[command addGlobalIndex:0];
return [command assembledCommandData];
Copyright(C)
OKBASE.NET All Rights Reserved 好库网 版权所有

我要回帖

更多关于 ev3怎么升级固件 的文章

 

随机推荐