No description
Find a file
2023-02-14 17:43:41 +01:00
hub Initial code with Python stubs for Lego Spike API, Go Robot Code and an example how to structure our code 2023-02-14 17:43:41 +01:00
spike Initial code with Python stubs for Lego Spike API, Go Robot Code and an example how to structure our code 2023-02-14 17:43:41 +01:00
.gitignore Initial code with Python stubs for Lego Spike API, Go Robot Code and an example how to structure our code 2023-02-14 17:43:41 +01:00
gorobot.py Initial code with Python stubs for Lego Spike API, Go Robot Code and an example how to structure our code 2023-02-14 17:43:41 +01:00
iqrobot.py Initial code with Python stubs for Lego Spike API, Go Robot Code and an example how to structure our code 2023-02-14 17:43:41 +01:00
main.py Initial code with Python stubs for Lego Spike API, Go Robot Code and an example how to structure our code 2023-02-14 17:43:41 +01:00
README.md Initial code with Python stubs for Lego Spike API, Go Robot Code and an example how to structure our code 2023-02-14 17:43:41 +01:00
vscode-lego-extension-precompile.png Initial code with Python stubs for Lego Spike API, Go Robot Code and an example how to structure our code 2023-02-14 17:43:41 +01:00
vscode-lego-extension-settings.png Initial code with Python stubs for Lego Spike API, Go Robot Code and an example how to structure our code 2023-02-14 17:43:41 +01:00

Entwickler Setup

In der VSCode Extension pre-compile einstellen: VSCode Lego Settings VSCode Lego Precompile

Code auf den Spike laufen lassen

  1. Über die VSCode Extension auf einen Slot hochladen (Extension Button oder F1->LEGO)

  2. Slot starten (kann auch über die "autostart" Option im Kopf des Codes automatisiert werden)

    # LEGO type:standard slot:5 autostart
    

Code als gemeinsame Bibiothek entwickeln und auf dem Spike ausführen

  1. Eigene Python Datei anlegen zB meincode.py

  2. Auf einen Slot hochladen (am besten Pre-Compile unter VS Code Settings einstellen, siehe Entwickeler Setup)

  3. importFile Funktion aus der main.py nutzen:

    importFile(slotid=6, precompiled=True, module_name="meincode")
    import meincode as mc
    print(mc.HELLO) 
    

Siehe auch https://forums.firstinspires.org/forum/general-discussions/first-programs/first-lego-league/the-challenge/programming-ab/93873-spike-prime-programming-lessons-for-first-lego-league-challenge-teams

Project Setup History

git clone https://github.com/fluffyhuskystudio/spike-prime-api.git
mkdir spike-all-py
cd spike-all-py
cp -r ../spike-prime-api/hub ./
cp -r ../spike-prime-api/spike ./