This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import time | |
LED_off = '\x08\x00\x00\x00\x80\x00\x00\x82\x1B\x00' | |
LED_green = '\x08\x00\x00\x00\x80\x00\x00\x82\x1B\x01' | |
LED_orange = '\x08\x00\x00\x00\x80\x00\x00\x82\x1B\x03' | |
LED_red = '\x08\x00\x00\x00\x80\x00\x00\x82\x1B\x02' | |
# send commands to EV3 via bluetooth | |
with open('/dev/rfcomm0', 'w', 0) as bt: | |
bt.write(LED_red) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import ev3 | |
import direct_command | |
""" | |
The first example creates an object called fwd to which we bind the class called direct command . We can then call the functions of the direct command using the magic dot. When you type fwd. on each line a list of the available functions appear (in Spyder) which you can scroll through and choose the correct one. Then when you type ( the object inspector tells you about the commands this function accepts. | |
""" | |
# move forward | |
fwd = direct_command.DirectCommand() | |
fwd.add_output_speed(direct_command.OutputPort.PORT_C,100) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Windows; | |
using System.Windows.Controls; | |
using System.Windows.Data; | |
using System.Windows.Documents; | |
using System.Windows.Input; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@safe_add | |
def add_input_device_ready_raw3(self, input_port, | |
mode=-1, | |
device_type=0, | |
layer=USB_CHAIN_LAYER_MASTER): | |
"""Waits until the device on the specified InputPort is ready and then | |
returns its value as a raw value. | |
""" | |
self._msg.append(Opcode.INPUT_DEVICE) |
NewerOlder