-
Notifications
You must be signed in to change notification settings - Fork 1
/
test_task.py
61 lines (46 loc) · 1.35 KB
/
test_task.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
48
49
50
51
52
53
54
55
56
57
58
'''from Tasks.template_task import Task
import time
class task(Task):
priority = 4
frequency = 1/30 # once every 30s
name = 'test'
color = 'gray'
schedule_later = True
async def main_task(self):
self.debug('test start: {}'.format(time.monotonic()))
await self.cubesat.tasko.sleep(10)
self.debug('test stop: {}'.format(time.monotonic()))'''
# Blink the RGB LED
from Tasks.template_task import Task
from Big_Test import Face as Face
import time
class task1(Task):
priority = 255
frequency = 2 # twice per second
name='blink'
color = 'pink'
rgb_on = False
async def main_task(self):
if self.rgb_on:
self.cubesat.RGB=(0,0,0)
self.rgb_on=False
else:
self.cubesat.RGB=(0,255,0)
self.rgb_on=True
class task2(Task):
priority = 1
frequency = 1/5
name='sense'
color = 'blue'
schedule_later=True
async def main_task(self):
Face1=Face(4,"z+")
Face2 = Face(0,"x+")
Face1.Sensorinit(Face1.senlist,Face1.address)
Face2.Sensorinit(Face2.senlist,Face2.address)
print("init")
print("First Face")
print(Face1.test_all(1,1))
print("-------------------------------------------------------------------")
print("Second Face")
print(Face2.test_all(1,1))