comparison examples/stepper/render.cpp @ 308:1feb9c23ac57 prerelease

Renamed read/write functions to remove the Frame --> e.g. analogWriteFrameOnce -> analogWriteOnce, digitalReadFrame -> digitalRead
author andrewm
date Fri, 27 May 2016 18:21:21 +0100
parents e4392164b458
children 02c4ca0e3718
comparison
equal deleted inserted replaced
307:ff5f346a293e 308:1feb9c23ac57
74 74
75 void render(BelaContext *context, void *userData) 75 void render(BelaContext *context, void *userData)
76 { 76 {
77 for(unsigned int n = 0; n < context->audioFrames; n++) { 77 for(unsigned int n = 0; n < context->audioFrames; n++) {
78 if(gPhase == 0 || gPhase == 1) { 78 if(gPhase == 0 || gPhase == 1) {
79 digitalWriteFrameOnce(context, n, gPinB1, HIGH); 79 digitalWriteOnce(context, n, gPinB1, HIGH);
80 digitalWriteFrameOnce(context, n, gPinB2, LOW); 80 digitalWriteOnce(context, n, gPinB2, LOW);
81 } 81 }
82 else { 82 else {
83 digitalWriteFrameOnce(context, n, gPinB1, LOW); 83 digitalWriteOnce(context, n, gPinB1, LOW);
84 digitalWriteFrameOnce(context, n, gPinB2, HIGH); 84 digitalWriteOnce(context, n, gPinB2, HIGH);
85 } 85 }
86 86
87 if(gPhase == 1 || gPhase == 2) { 87 if(gPhase == 1 || gPhase == 2) {
88 digitalWriteFrameOnce(context, n, gPinA1, HIGH); 88 digitalWriteOnce(context, n, gPinA1, HIGH);
89 digitalWriteFrameOnce(context, n, gPinA2, LOW); 89 digitalWriteOnce(context, n, gPinA2, LOW);
90 } 90 }
91 else { 91 else {
92 digitalWriteFrameOnce(context, n, gPinA1, LOW); 92 digitalWriteOnce(context, n, gPinA1, LOW);
93 digitalWriteFrameOnce(context, n, gPinA2, HIGH); 93 digitalWriteOnce(context, n, gPinA2, HIGH);
94 } 94 }
95 95
96 if(--gServoCounter > 0) 96 if(--gServoCounter > 0)
97 digitalWriteFrameOnce(context, n, gPinServo, HIGH); 97 digitalWriteOnce(context, n, gPinServo, HIGH);
98 else 98 else
99 digitalWriteFrameOnce(context, n, gPinServo, LOW); 99 digitalWriteOnce(context, n, gPinServo, LOW);
100 100
101 if(++gStepCounter >= gStepLengthSamples) { 101 if(++gStepCounter >= gStepLengthSamples) {
102 gStateCounter++; 102 gStateCounter++;
103 103
104 switch(gState) { 104 switch(gState) {