comparison examples/basic_analog_output/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 db2fe4e1b88e
comparison
equal deleted inserted replaced
307:ff5f346a293e 308:1feb9c23ac57
55 // Set LED to different phase for each matrix channel 55 // Set LED to different phase for each matrix channel
56 float relativePhase = 0.0; 56 float relativePhase = 0.0;
57 for(unsigned int channel = 0; channel < context->analogChannels; channel++) { 57 for(unsigned int channel = 0; channel < context->analogChannels; channel++) {
58 float out = kMinimumAmplitude + kAmplitudeRange * 0.5f * (1.0f + sinf(gPhase + relativePhase)); 58 float out = kMinimumAmplitude + kAmplitudeRange * 0.5f * (1.0f + sinf(gPhase + relativePhase));
59 59
60 analogWriteFrame(context, n, channel, out); 60 analogWrite(context, n, channel, out);
61 61
62 // Advance by pi/4 (1/8 of a full rotation) for each channel 62 // Advance by pi/4 (1/8 of a full rotation) for each channel
63 relativePhase += M_PI * 0.25; 63 relativePhase += M_PI * 0.25;
64 } 64 }
65 65