ok scope/gnd/p18 picoscope app pn pc
Fork of PE_04-03_SinusoidWave by
main.cpp
00001 /*Program Example 4.3: Sine wave on DAC output. View on oscilloscope 00002 */ 00003 #include "mbed.h" 00004 AnalogOut Aout(p18); 00005 float i; 00006 int main() 00007 { 00008 while(1) { 00009 for (i=0; i<2; i=i+0.05) { 00010 Aout=0.5+0.5*sin(i*3.14159); // Compute the sine value, + half the range 00011 wait(.001); // Controls the sine wave period 00012 } 00013 } 00014 } 00015
Generated on Mon Aug 29 2022 07:57:01 by 1.7.2