-
Notifications
You must be signed in to change notification settings - Fork 1
/
CvSeq.h
59 lines (52 loc) · 1.25 KB
/
CvSeq.h
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
/*
CvSeq.h - Library for running a cv sequencer
The Circuit:
* Input - 2x 4051 multiplexer 8x 10k pot each
* Output - 2x 4051 multiplexer 8x LED each to align with input pot
* Z (input) held high
Fixed Pins
* 8, 9, 10 - Digital pins to write multiplex addresses, (PORTB)
Configurable Pins:
* top_active - Digital pin E on the top bank (active low)
* bot_active - Digital pin E on the bottom bank (active low)
* top_in - Analog pin to read top bank
* bot_in - Analog pin to read bottom bank
Created by Aaron McMillin (aarcro), November 16, 2015.
MIT Licence
*/
#ifndef CvSeq_h
#define CvSeq_h
#include "Arduino.h"
class CvSeq
{
public:
CvSeq(
int top_active,
int bot_active,
int top_in,
int bot_in
);
int step(); // run the next step
void setLoop();
void setReverse();
void setPingPong();
void setOneSixteen();
void setTwoEights();
bool isDoubleOut();
int getStep();
int getPrimary();
int getSecondary();
private:
int _loop_mode;
int _out_mode;
int _top_active;
int _bot_active;
int _top_in;
int _bot_in;
int _top_value;
int _bot_value;
int _out1;
int _out2;
int _cur_step;
};
#endif