From aa7640643682c88fd3c3e47f7a3099fb218d3670 Mon Sep 17 00:00:00 2001 From: Izzy Brand Date: Wed, 10 Jan 2018 10:24:05 -0500 Subject: [PATCH] added testing scripts --- burnTest.py | 12 ++++++++++++ twitchy.py | 13 +++++++++++++ 2 files changed, 25 insertions(+) create mode 100644 burnTest.py create mode 100644 twitchy.py diff --git a/burnTest.py b/burnTest.py new file mode 100644 index 0000000..ea0760c --- /dev/null +++ b/burnTest.py @@ -0,0 +1,12 @@ +import RPi.GPIO as GPIO +from config import * +import time + +GPIO.setmode(GPIO.BCM) +GPIO.setup(BURN_PIN, GPIO.OUT) +GPIO.output(BURN_PIN, GPIO.LOW) +raw_input('Press enter to burn') +GPIO.output(BURN_PIN, GPIO.HIGH) +time.sleep(5) +GPIO.output(BURN_PIN, GPIO.LOW) +GPIO.cleanup() diff --git a/twitchy.py b/twitchy.py new file mode 100644 index 0000000..712e6f2 --- /dev/null +++ b/twitchy.py @@ -0,0 +1,13 @@ +from dronekit import connect, VehicleMode +import time +import numpy as np + +vehicle = connect('/dev/ttyACM0', baud=115200, wait_ready=True) +vehicle.mode = VehicleMode('MANUAL') +vehicle.armed = True + +while True: + vehicle.channels.overrides['2'] = np.random.randint(1300,1700) + vehicle.channels.overrides['1'] = np.random.randint(1300,1700) + time.sleep(0.2) +