-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbrainstorm.txt
64 lines (59 loc) · 1.56 KB
/
brainstorm.txt
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
59
60
61
62
63
64
Light engine complete, just requiring finalized animation sequences.
- Like the idea of making the cast effect reflect the spell.
Control engine:
- Button based input
- Hall effect?
- Micro switch if not.
- Haptic based feedback
- Motor appears to run best at 3.3V, can drive from Arduino.
- Can I use an output pin set to high/low to sink the current?
- Use transistor if not.
Basic flow:
init()
{
set up inputs and outputs
set up wireless communication
set up initial system state (off)
set up initial queued action (none)
set up initial next action (none)
}
main()
{
check for button input
if (button input)
{
if (queued action button)
{
queue action in variable
send haptic pulse
}else if (action button)
{
if (queued action)
{
run queued action
}else
{
run default action based on state (ignite or extinguish)
}
send haptic pulse
}else if (clear button)
{
clear queued action
set animation back to idle? (unless off)
}
}
if (state change)
{
send wireless update
update native display (if any)
}
}
States:
state_off
state_idle
state_cast (lasts until activation button released, then goes to spell)
state_bigcast (lasts until activation button released, then goes to bigspell)
state_spell
state_bigspell
state_limitcast (lasts until activation button released, then goes to limitspell)
state_limitspell