Commit Graph
125 Commits
Author SHA1 Message Date
Laurens Valk aa13792dab .github: add sponsor link 2020-10-09 23:07:24 +02:00
Laurens Valk 86587eeff2 snippets/pup/hub_*: generate from template 2020-10-09 19:36:32 +02:00
Laurens Valk 3af9d146b6 snippets/pup/hub_shared: generate script template
Generate examples for each hub by replacing ExampleHub by
the name of each hub, and skip examples that do not apply
to a particular hub. Such as examples with floating point.
2020-10-09 19:34:47 +02:00
Laurens Valk 122544d613 snippets/pup/hub_shared: light examples
These are template scripts for all hubs
2020-10-09 16:51:33 +02:00
Laurens Valk 2a08462af1 snippets/pup/sensor_color: calibration and hsv
Update for the simplified color calibration API.
2020-10-08 19:00:50 +02:00
Laurens Valk 72f812df3f snippets/pup/sensor_color_distance: calibration
Update for the simplified color calibration API.
2020-10-08 19:00:40 +02:00
Vinh Luong 51aa74f0c7 official_models/ev3: refactoring 2020-10-07 10:50:13 +02:00
Antoni Luong Pham fc39ab9468 official_models/ev3/gripp3r: add project 2020-10-07 10:50:13 +02:00
Antoni Luong Pham fcff36b3fd official_models/ev3/home/r3ptar: add project 2020-10-07 10:50:13 +02:00
Antoni Luong Pham 098696c2b4 official_models/ev3/home/spik3r: add project 2020-10-07 10:50:13 +02:00
Vinh Luong c83fd44fec official_models/ev3/home/track3r: add project 2020-10-07 10:50:13 +02:00
Vinh Luong e3860fd1c5 official_models/ev3/home/ev3rstorm: add project 2020-10-07 10:50:13 +02:00
Laurens Valk dbda3c337a snippets/ev3: update workspace 2020-10-07 10:50:13 +02:00
Laurens Valk e9735b2db0 snippets/pup: add PFMotor examples 2020-08-11 12:09:36 +02:00
Laurens Valk bc2ec92634 snippets/pup: add Motor action examples 2020-07-21 16:11:27 +02:00
Laurens Valk 6b634c5365 snippets/pup: add Motor stop and action examples 2020-07-21 15:16:16 +02:00
Laurens Valk 599c6fce13 snippets/pup: add Motor measuring examples 2020-07-21 14:49:12 +02:00
Laurens Valk e2188747c8 snippets/pup: add Motor init examples 2020-07-21 14:49:12 +02:00
Laurens Valk e4729df9f5 snippets/pup: add DCMotor examples 2020-07-21 14:49:12 +02:00
Adam a0c96c5a6a snippets/ev3: add PS4 snippet 2020-07-19 22:55:10 +02:00
Laurens Valk c6a3d7a66e snippets/pup/sensor_force: add examples 2020-07-13 15:39:00 +02:00
Laurens Valk 073357709b snippets/pup/sensor_color: add reflection example 2020-07-13 14:23:39 +02:00
Laurens Valk ee05a6686e snippets/pup/sensor_color: add ambient sample
ambient color sensor is unique to this sensor
2020-07-13 14:13:21 +02:00
Laurens Valk caa4012b2a snippets/pup/sensor_color: add 6 samples
These are nearly the same as for the ColorDistanceSensor.
2020-07-13 14:04:59 +02:00
Laurens Valk 36a4bdd2a9 snippets/pup/sensor_color_distance: add 6 samples 2020-07-11 17:03:07 +02:00
Laurens Valk dc82cd5d07 snippets/pup/light: add basic light and math demo 2020-07-11 12:58:15 +02:00
Laurens Valk 3b9663d93b snippets/pup/sensor_tilt: add read example 2020-07-11 12:42:52 +02:00
Laurens Valk f19d80b728 snippets/pup/sensor_infrared: add read example 2020-07-11 12:39:03 +02:00
Laurens Valk a30877fd3d official_models/pup/trains_sensors: tilt project
This adds a project that shows how you can combine LEGO trains with the
Powered Up Tilt Sensor to detect slopes in a train track.
2020-07-10 14:25:06 +02:00
Laurens Valk d000fe7d7a official_models/pup/trains: passenger and cargo
These two are likely the first in a range of generic LEGO trains with a
City Hub and a DC Train Motor. Instead of adding examples to each,
we add generic train examples in a shared folder and link to them.

We reserve these folders specifically for these sets and their B models.
2020-07-10 14:20:12 +02:00
Laurens Valk 796f4e63d9 snippets/pup/sensor_ultrasonic: add math example
This demonstrates functionality of the lights and builtin math.
2020-07-10 13:05:50 +02:00
Laurens Valk c4c60f20bf snippets/pup/sensor_ultrasonic: add basic example
Demonstrate distance measuring and light control in a simple loop.
2020-07-10 12:37:13 +02:00
Laurens Valk 54523ee695 ev3/snippets/rcx_touch: example of AnalogSensor 2020-05-21 11:24:34 +02:00
Laurens Valk df06dc59cc ev3/snippets: bluetooth: update rover example 2020-05-19 15:19:18 +02:00
Laurens Valk d5ee42156d ev3/snippets/bluetooth_pc: StreamRequestHandler
This restores the previously deleted custom StreamRequestHandler.

In the prevous commits, more and more pieces from the standard socket library were used instead of the custom-made ones made for EV3. This was giving compatibility issues on some platforms (Windows/Mac), and differences with EV3 made it harder to debug.

It was previously dropped to make the MailboxHandler work. This commit reverts that change and modifies the MailboxHandler instead to make it work with the BluetoothSocket objects, which do not have rfile.read. Instead we use recv directly and rely on zero length to detect disconnected state.

It would be useful to eventually use only components from the socket server module and no incomplete custom ones, but this provides at least a working cross platform starting point to fall back to.
2020-05-16 20:13:40 +02:00
Laurens Valk 8907939639 ev3/snippets/bluetooth_pc: PC is client
Technically it does not matter much who is the server or the client.

However, if Windows PCs are involved, we found it to be easier if
Windows is the client and EV3 is the server.
That way, it is the Windows PC initiating the connection. It doesn't
seem to like it when other devices take the initiative.

So, we update the example accordingly to make it
accessible for most users without loss of generality.

You can still make the PC the server by just running the
server example on your PC.
2020-05-16 17:01:36 +02:00
Laurens Valk 731cdd662f ev3/snippets/bluetooth_read_spike: initial example
Add a class that makes it easy to read values streamed by the hub.
2020-05-12 22:31:49 +02:00
Laurens Valk 581a0997c9 ev3/snippets/bluetooth_pc: flake8
Make sure the documentation can pass flake8.
2020-05-10 12:43:56 +02:00
Laurens Valk 8d20a1b84f ev3/snippets/bluetooth_pc: drop some unix specific
socket.AF_BLUETOOTH is not available on some platforms but bluetooth.BluetoothSocket is.
2020-05-10 12:39:52 +02:00
Laurens Valk 567a8128a2 ev3/snippets/bluetooth_pc: add comments and readme 2020-05-07 11:56:36 +02:00
Laurens Valk 759f108306 ev3/snippets/bluetooth_client: comment for PC
Expand comment to say that the remote may be an EV3 or PC.
It works the same.
2020-05-07 11:56:36 +02:00
Laurens Valk bfe80edff6 ev3/snippets/bluetooth_pc: run client as python3
Even though our main example will have the PC as the server, make it possible to use it as client as well.

Now, it works just like the EV3s. The only difference is that
you must enter the full address instead of the name if the EV3 is the server you are connecting to.
2020-05-07 11:56:36 +02:00
Laurens Valk db10b75808 ev3/snippets/bluetooth_pc: run server as python3
This removes the MicroPython struct and socket specifics and replaces them with Python3 counterparts.

Also a few changes are made to deal with strings, which on MicroPython are just bytes.

Now, the server works on Python3 and client EV3s can connect to it.
2020-05-07 11:56:36 +02:00
Laurens Valk 9b3908090d ev3/snippets/bluetooth_pc: run MicroPython Unix
This is a copy of the EV3 server example with minimal changes
to make it run on a PC, using the unmodified MicroPython Unix port.

This is done by skipping the name resolver. The downside is that you
must specify the EV3 server address instead of its name.  However,
since in this example the PC will be the server, this is not really a
problem. The EV3 clients will just connect to the PC by its name.
2020-05-07 11:56:36 +02:00
Laurens Valk 5d943a609d ev3/snippets/bluetooth_pc: copy pybricks bluetooth
This copies the Pybricks MicroPython bluetooth implementation. As-is, it only runs in Pybricks MicroPython.

The next commits will adapt it to work with MicroPython and then Python3. We only need the Python3 end result, but this staged approach makes it easy to keep track of what will be changed.
2020-05-07 11:56:36 +02:00
Laurens Valk 21eac3abda ev3/snippets/bluetooth_pc: hello world launch
This creates an empty hello world style Python3 example
2020-05-07 11:56:36 +02:00
David Lechner 4da888ec52 official_models/ev3: add header to all programs
Add a header with links to the LEGO Education website for building
instructions and SD card image download. This way if someone gets a
copy of the program, they don't have to go searching for documentation.
2020-05-06 16:53:19 -05:00
David Lechner a7a57ee27e official_models/ev3/color_sorter: fix stalled duty cycle limit
30% is near the static friction limit of the medium motor itself. In the latest tests, the motor was stalling without moving, so bump up the minimum duty cycle to fix it with a reasonable safety margin.
2020-05-06 12:35:56 -05:00
Laurens Valk 51871031b8 README: Add link to support page 2020-04-28 15:27:51 +02:00
Laurens Valk 8f0e674b58 workspaces: generate 2020-04-28 15:18:40 +02:00