-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.py
47 lines (36 loc) · 836 Bytes
/
Main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
'''Formula Steering Wheel & CBR600RR Control with DRS'''
# Author: Lim Chae Won
# Organization: SKID Formula Student Team
# License: MIT License
# coding: utf-8
import gc
import math
import time
import array
import board
from TempSensor import OBTRead, DHTRead
import time
import machine
# GPIO
machine
# Timer
timer = machine.Timer()
#Temp Sensor Initialization
OBTemp = OBTRead()
DHTemp = DHTRead()
# Utility functions
def set_in_use(_):
global in_use
if in_use:
in_use = not in_use
timer.deinit()
print("Timeout released.")
def in_use_led(in_use):
if in_use:
led.set_rgb(64, 0, 0)
else:
led.set_rgb(0, 0, 0)
def blink_led(duration, r, g, b):
led.set_rgb(r, g, b)
utime.sleep(duration)
led.set_rgb(0, 0, 0)