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 json | |
import base64 | |
notification = { | |
"type": "out", | |
"lp": "B-36-IHK", | |
"c": "orange", | |
"b": "dodge" | |
} |
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
from microbit import sleep, display, button_a, button_b | |
import ustruct | |
import radio | |
import math | |
radio.on() | |
rotate_steps = 10 | |
rotate_span = 160 # in degrees | |
rotate_step = rotate_span / rotate_steps | |
max_distance = 50 # in centimeters |
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
from gigglebot import * | |
from distance_sensor import DistanceSensor | |
from microbit import sleep | |
from utime import ticks_us, sleep_us | |
import ustruct | |
import radio | |
# stop the robot if it's already moving | |
stop() | |
# enable radio |
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
from microbit import * | |
from gigglebot import * | |
from utime import sleep_ms, ticks_us | |
motor_speed = 100 | |
update_rate = 70 | |
setpoint = 0.5 | |
Kp = 65.0 | |
integral = 0.0 |
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
from microbit import * | |
from gigglebot import * | |
from utime import sleep_ms, ticks_us | |
import ustruct | |
# initialize GB neopixels | |
neo = init() | |
# timing | |
update_rate = 50 |
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
from microbit import * | |
from utime import sleep_ms | |
import radio | |
import ustruct | |
# 1st element is the Kp gain | |
# 2nd element is the Ki gain | |
# 3rd element is the Kd gain | |
# 4th element is the trigger_point for motors to lower down the speed (0 -> 1) | |
# 5th element is the min speed for motors as expressed in percentages (0 -> 1) |
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
from microbit import * | |
from gigglebot import * | |
from utime import sleep_ms, ticks_us | |
import radio | |
import ustruct | |
# initialize radio and GB neopixels | |
radio.on() | |
neo = init() |
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
from curtsies import Input | |
from easygopigo3 import EasyGoPiGo3 | |
from di_sensors.easy_line_follower import EasyLineFollower | |
from threading import Thread, Event | |
import signal | |
from time import sleep, time | |
def drawLogo(): | |
print(" _____ _____ _ _____ ____ ") |
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 python | |
''' | |
generates call graph of given python code file | |
in dot format input for graphviz. | |
limitations: | |
* statically tried to figure out functions calls | |
* does not understand classes | |
* algorithm is naive and may not statically find |
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
#!/bin/bash | |
echo "creating directories" | |
mkdir -p /etc/chatscripts | |
mkdir -p /etc/ppp/peers | |
echo "creating script file : /etc/chatscripts/quectel-chat-connect" | |
echo " | |
ABORT \"BUSY\" |
NewerOlder