Информатизация и образование

Высшее образование - Информационная поддержка: новости ГИА и ЕГЭ, электронное обучение, библиотеки, программное обеспечение и борьба с плагиатом

  • Full Screen
  • Wide Screen
  • Narrow Screen
  • Increase font size
  • Default font size
  • Decrease font size

Lego Mindstorms EV3: Bluetooth, Wi-Fi и управление моторами

 

 

Bluetooth Support

Connecting the EV3 to your PC directly with an USB cable is the most easy and reliable way to use it with EV3-Basic. Nevertheless, having to use the cable can be quite cumbersome in many circumstances, especially when developing mobile robots.

When you have a working bluetooth faciliy on your PC (either with a bluetooth dongle or built-in), you can configure the EV3 to communicate with the PC wirelessly. If not already done, you have to "pair" the EV3 with your PC to allow communication. To do so, first activate the bluetooth features on the EV3: In the settings menu, activate the "Visibility" and "Bluetooth" options. Then on the PC, open the system dialog "Bluetooth Devices". There you can search for the device and start to establish a connection to EV3. The process may be a bit lengthy and requires to confirm the action on the EV3 as well as on the PC, and you will even have to enter the correct coupling code in some place (should be "1234").

Once the connection is set up and the automatic installation of the appropriate drivers is finished, your PC can communicate with the EV3 over a so-called "Serial Port". Which will be named "COM1", "COM3" or the like. You can check which name was actually assigned by looking at the properties page of the EV3 bluetooth device.

To use the newly established connection with EV3-Basic, just start your program from Small Basic or just start the EV3-Explorer. When no EV3 can be found directly connected via USB, but there are possible "Serial Ports" available, the PC will prompt you to select one of these ports. When this is indeed the port for the EV3, the connection will work.

WiFi Support

Like a Bluetooth connection, a WiFi connection allows you to connect to your model without using a cable. WiFi has some advantages over Bluetooth concerning range, speed and reliability, but also comes with some drawbacks like higher power consumption and the need to add a WiFi dongle to the EV3. And this setup only works when you have a WiFi router available. It is basically a matter of taste if you prefer bluetooth or WiFi, or maybe a matter of technical issues with one of the possibilites.

To use the WiFi option, you need a specific WiFi dongle that is compatible with the EV3 brick. Currently there is only one model available that works with an unmodified EV3: "Netgear WNA1100" which must be inserted into the large USB connector at the left side of the EV3. Setting up the WiFi connection can be done from the settings menu on the brick. You have to activate the WiFi option (this takes some time to start up the dongle) and then you have to establish a connection to the WiFi router. In case you have set up encryption for your WiFi network, you need to enter the WPA2-key directly on the brick. Currently no other WiFi-encryption methods are supported.

Once you have successfully established a connection between the EV3 and your router, the EV3 should have received an IP address, which would look something like "10.2.3.4". You can check which address was assigned to your EV3 in the "Brick Info" section of the settings menu. It is at the very bottom of the list.

When you want to finally connect to the EV3 from a Small Basic program or with the EV3-Explorer, use the "WiFi" button in the dialog box that asks for which connection to use. Then enter the IP address exactly as it was shown on the brick. You only have to enter the address once. For future uses, it will already appear in the selection list.

Note, that the brick does not automatically connect to the WiFi router when starting up. You always have to activate the connection after each power-up.

Motor object since v1.0

For version 1.0, I made a re-design of the Motor object, so programs written for v0.9 or earlier need some adjustments to work with v1.0. One of the main changes is, that there are no "Motor.Speed" or "Motor.Power" commands anymore. You have to specify the speed or power directly at the "Motor.Start" command. Also the other motor control commands have been restructured into a functional matrix:

Move x degrees while waiting Start to run indefinitely Start to move x degrees
Regulate speed Motor.Move Motor.Start Motor.Schedule
Choose power Motor.MovePower Motor.StartPower Motor.SchedulePower
Synchronize Motor.MoveSync Motor.StartSync Motor.ScheduleSync

For most purposes the variants with speed regulation of a single motor will be the right choice. So these commands have shorter names (no "Power" or "Sync" suffix) when compared to their expert-feature counterparts.

When you have to change power or speed of an already running motor, just re-issue a start command with the appropriate speed or power value. The motor will then seemlessly switch over to the new mode of operation.

 

 

Отзывы и комментарии

blog comments powered by Disqus


Похожие статьи:
Следующие статьи:

Добавить комментарий

Защитный код
Обновить

You are here: Робототехника LEGO Lego Mindstorms EV3: Bluetooth, Wi-Fi и управление моторами