This file contains 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
# This is the car code for the remote controlled Tank-like vehicle | |
# Build one by slapping two motors on the side of your hub. | |
# (c) 2021 Anton's Mindstorms & Ste7an | |
# Use with the the remote control tutorial here: | |
# [url] | |
# Most of it is library bluetooth code. | |
# Scroll to line 200 for the core program. |
This file contains 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
# Brick to brick remote control program. Run this on the remote control steering wheel. | |
# (c) 2021 Anton's Mindstorms & Ste7an | |
# TO STOP THIS SCRIPT ALWAYS USE THE BUTTON ON THE HUB. | |
# AVOID THE STOP BUTTON IN THE MINDSTORSM APP! | |
# Building instructions here: | |
# https://antonsmindstorms.com/product/remote-control-steering-wheel-with-spike-prime/ | |
# Use with the the car script here: |
This file contains 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
# This is the car code for the remote controlled Hot Rod | |
# (c) Anton's Mindstorms & Ste7an | |
# Full tutorial here: | |
# https://antonsmindstorms.com/2021/06/19/how-to-remote-control-lego-spike-prime-and-robot-inventor-with-python/ | |
# Building instructions here: | |
# https://antonsmindstorms.com/product/remote-controlled-hot-rod-with-51515/ | |
# Use with the the remote control script here: |
This file contains 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
# Hub to hub remote control program. Run this on the remote control | |
# Full tutorial here: | |
# https://antonsmindstorms.com/2021/06/19/how-to-remote-control-lego-spike-prime-and-robot-inventor-with-python/ | |
# TO STOP THIS SCRIPT ALWAYS USE THE BUTTON ON THE HUB. | |
# AVOID THE STOP BUTTON IN THE MINDSTORSM APP! | |
# Building instructions here: | |
# https://antonsmindstorms.com/product/remote-control-transmitter-with-mindstorms-51515/ |
This file contains 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
#!/usr/bin/env pybricks-micropython | |
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor, | |
InfraredSensor, UltrasonicSensor, GyroSensor) | |
from pybricks.parameters import (Port, Stop, Direction, Button, Color, | |
SoundFile, ImageFile, Align) | |
from pybricks.tools import print, wait, StopWatch | |
import struct |
This file contains 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
# This code was originally written by Pybricks | |
# Paste all of it into a file named 'connection.py' and place it next to your 'main.py' file | |
# Nothing below is written by Anton's Mindstorms | |
# I found it here. https://github.com/pybricks/pybricks-projects | |
from uctypes import addressof, sizeof, struct | |
from usocket import socket, SOCK_STREAM | |
from _thread import start_new_thread |
This file contains 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
#!/usr/bin/env pybricks-micropython | |
# car code | |
from pybricks.hubs import EV3Brick | |
from pybricks.ev3devices import (Motor, TouchSensor, ColorSensor, | |
InfraredSensor, UltrasonicSensor, GyroSensor) | |
from pybricks.parameters import Port, Stop, Direction, Button, Color | |
from pybricks.tools import wait, StopWatch |
This file contains 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
__author__ = 'anton' | |
from math import sin, cos, pi | |
from PIL import Image, ImageDraw | |
NUM_POINTS = 150 | |
PREVIEW_SIZE = 500 | |
CIRCLE = 1 | |
SQUARE = 2 |
This file contains 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 smbus | |
def get_voltage(): | |
""" | |
Reads the digital output code of the MCP3021 chip on the BrickPi+ over i2c. | |
Some bit operation magic to get a voltage floating number. | |
If this doesnt work try this on the command line: i2cdetect -y 1 | |
The 1 in there is the bus number, same as in bus = smbus.SMBus(1) | |
Google the resulting error. |
This file contains 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
#!python | |
from jaraco.nxt import * | |
from jaraco.nxt.messages import * | |
import time | |
import sdl2 | |
import math | |
sdl2.SDL_Init(sdl2.SDL_INIT_JOYSTICK) |
NewerOlder