comparison examples/basic_analog_output/render.cpp @ 314:611306d840b3 prerelease

Merge
author Giulio Moro <giuliomoro@yahoo.it>
date Fri, 27 May 2016 19:00:43 +0100
parents 1feb9c23ac57
children db2fe4e1b88e
comparison
equal deleted inserted replaced
313:c770cdf3d8b2 314:611306d840b3
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