sets/spike: Update grabber.

* add README for Kiki the Dog (SPIKE Prime)

* add Kiki program

* fix Kiki README

* refactor Grabber

* Pybricks with lower-case b

Co-authored-by: David Lechner <david@lechnology.com>

* add short comment to Grabber program

Co-authored-by: Ariana Lương-Phạm <Ariana.LuongPham@gmail.com>
Co-authored-by: Antoni Luong Pham <Antoni.LuongPham@gmail.com>
Co-authored-by: David Lechner <david@lechnology.com>
This commit is contained in:
Ariana Lương-Phạm Hải An
2021-05-18 14:04:23 +02:00
committed by GitHub
co-authored by Ariana Lương-Phạm Antoni Luong Pham David Lechner
parent 27dcd51551
commit 10ae1be48d
3 changed files with 20 additions and 11 deletions
+13
View File
@@ -0,0 +1,13 @@
{
"editor.rulers": [70],
"python.linting.enabled": true,
"python.linting.pylintEnabled": true,
"python.linting.flake8Enabled": true,
"python.linting.mypyEnabled": true,
"python.linting.pydocstyleEnabled": false,
"python.linting.pycodestyleEnabled": true,
"python.linting.prospectorEnabled": true,
"python.linting.pylamaEnabled": true,
"python.linting.banditEnabled": true
}
@@ -9,7 +9,7 @@ image:
video:
youtube: "8uyx5npo4LA"
description:
"Use the Grabber to pick up objects and bring them around!"
"Use the Grabber to pick up objects and bring them around! Press the Force Sensor to grab objects, and release the Force Sensor to let go of them."
building_instructions:
external:
- https://education.lego.com/v3/assets/blt293eea581807678a/blt56a81c75560c9a81/5f8802cbf71916144453a493/supercleaup-bi-pdf-book1of3.pdf
@@ -17,13 +17,13 @@ building_instructions:
---
The program requires PyBricks v3 firmware installed on the Prime Hub.
This program is for the Hand-Controlled Grabber in the [Invention Squad: Super Clean-Up](https://education.lego.com/en-us/lessons/prime-invention-squad/super-cleanup) lesson unit.
Press the Force Sensor to grab objects, and release the Force Sensor to let go of them.
The program requires Pybricks v3 firmware installed on the Prime Hub.
The programming code is as follows:
{% include copy-code.html %}
```python
{% include_relative hand-controlled-grabber.py %}
{% include_relative main.py %}
```
@@ -1,11 +1,7 @@
"""
This program is for Hand-Controlled Grabbers
(in the "Invention Squad: Super Clean-Up" lesson unit).
# Hand-Controlled Grabber:
# press the Force Sensor to grab objects,
# and release the Force Sensor to let go.
Follow the corresponding building instructions in the LEGO® SPIKE Prime App.
Press the Force Sensor to grab objects, and release the Force Sensor to let go.
"""
from pybricks.hubs import PrimeHub
from pybricks.pupdevices import ForceSensor, Motor