Skip to content

Commit

Permalink
Add #defines for envelope mode bits.
Browse files Browse the repository at this point in the history
  • Loading branch information
anachrocomputer committed Feb 15, 2017
1 parent 86ee2c6 commit 10e1027
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions testAY8930.ino
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@
#define AMPLITUDE_MAX (31)
#define AMPLITUDE_OFF (0)

#define ENV_CONT (8)
#define ENV_ATTACK (4)
#define ENV_ALT (2)
#define ENV_HOLD (1)

uint8_t CurrentBank = 0;
uint8_t CurrentEnvMode = 0;
uint8_t EnableReg = 0;
Expand Down Expand Up @@ -80,9 +85,9 @@ void setup(void)
setAmplitude(CHANNELC, AMPLITUDE_OFF);

setEnvelopePeriod(CHANNELA, 1024);
setEnvelopeMode(CHANNELA, 10); // Channel A envelope to triangle
setEnvelopeMode(CHANNELA, ENV_CONT | ENV_ALT); // Channel A envelope to triangle
setEnvelopePeriod(CHANNELB, 2048);
setEnvelopeMode(CHANNELB, 10); // Channel B envelope to triangle
setEnvelopeMode(CHANNELB, ENV_CONT | ENV_ALT); // Channel B envelope to triangle
}

void loop(void)
Expand Down

0 comments on commit 10e1027

Please sign in to comment.