111
Dependencies: 4DGL-uLCD-SE AD5206 mbed-rtos mbed
Fork of 4180_proj by
Diff: main.cpp
- Revision:
- 11:d21c2da8b290
- Parent:
- 10:159f38636ed4
- Child:
- 12:b6265952fb06
--- a/main.cpp Tue Dec 01 18:59:42 2015 +0000 +++ b/main.cpp Wed Dec 02 19:48:56 2015 +0000 @@ -8,24 +8,39 @@ Yuqing Peng */ -#include "wave.h" +//#include "wave.h" #include "mbed.h" #include "menu.h" #include "para.h" #include "uLCD_4DGL.h" +#include <AD5206.h> //----- Objects for devices---------------------- - +Serial funGen(p28, p27); DigitalOut led1(LED1); +AD5206 digipot(p5, p6, p7,p8);//MOSI, MISO, CLK, CS' +Serial pc(USBTX, USBRX); +para thispara; + +int vol; int main(void){ + pc.printf("1111"); int start = begain_first(); if (start) { - para_setting(); - generate_waveform_datapoints(); + thispara = para_setting(); + int type=thispara.get_type(); + vol = thispara.get_amp() * 100; + float freq = thispara.get_freq(); while (1){ - led1 = 1; - output_waveform_datapoints(); + //funGen.printf("%d,%f\n", type, freq); + pc.printf("%d",type); + //change gain of the opamp, in order to change output amplitude + + digipot.write_AD5206(0, vol); + //val=val+10; + //if (val>=255){val=0;} + wait(1); } - } } +