https://github.com/codeadamca/spike-status-light
A basic example of using MicroPython and the status light on the LEGO Spike hub.
https://github.com/codeadamca/spike-status-light
lego mindstorms python spike
Last synced: 2 months ago
JSON representation
A basic example of using MicroPython and the status light on the LEGO Spike hub.
- Host: GitHub
- URL: https://github.com/codeadamca/spike-status-light
- Owner: codeadamca
- Created: 2022-07-07T01:00:15.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2025-01-26T22:26:42.000Z (9 months ago)
- Last Synced: 2025-03-31T07:18:30.332Z (6 months ago)
- Topics: lego, mindstorms, python, spike
- Homepage:
- Size: 11.7 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# LEGO® Spike Hub and the Hub Status Light
A Python snippet utilizing the LEGO Spike status light, [MicroPython](https://lego.github.io/MINDSTORMS-Robot-Inventor-hub-API/), and the `on()` and `off()` commands.
## Sample Code
```py
from mindstorms import MSHub
from mindstorms.control import wait_for_secondshub = MSHub()
colors = [
'azure',
'black',
'blue',
'cyan',
'green',
'orange',
'pink',
'red',
'violet',
'white',
'yellow'
]for color in colors:
print(color)
hub.status_light.on(color)
wait_for_seconds(1)
hub.status_light.off()
hub.speaker.beep()
```***
## Repo Resources
* [Visual Studio Code](https://code.visualstudio.com/)
* [MicroPython for LEGO Robot Inventor](https://www.lego.com/en-ca/themes/mindstorms/downloads)
* [LEGO Mindstorms](https://www.lego.com/en-ca/themes/mindstorms)
* [LEGO Mindstorms App for Mac](https://apps.apple.com/us/app/lego-mindstorms-inventor/id1515448947)
* [LEGO Mindstorms App for Android](https://play.google.com/store/apps/details?id=com.lego.retail.mindstorms)
* [LEGO Mindstorms App for Windows](https://www.microsoft.com/store/apps/9N7GN3KC2GK6)