สัญญาณ sine

Dependencies:   mbed

Fork of MCP4922_Sinewave by FRA221_2016

Files at this revision

API Documentation at this revision

Comitter:
soulx
Date:
Sun Oct 29 16:03:15 2017 +0000
Parent:
6:ea34f3ae69b5
Commit message:
update mbed

Changed in this revision

main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r ea34f3ae69b5 -r e0544332d8d9 main.cpp
--- a/main.cpp	Tue Oct 25 14:32:24 2016 +0000
+++ b/main.cpp	Sun Oct 29 16:03:15 2017 +0000
@@ -2,13 +2,13 @@
 #include "mbed.h"
 #include "MCP4922.h"
 
-MCP4922 MCP(SPI_MOSI, SPI_SCK,SPI_CS);  // MOSI, SCLK, CS
+MCP4922 MCP(SPI_MOSI, SPI_SCK,PB_6);  // MOSI, SCLK, CS
 
 
 /**** Main Function  ***/
 int main(void)
 {
-    MCP.frequency(20000000);
+    MCP.frequency(1000000);
 
     uint16_t i=0;
     uint8_t state=0;
@@ -26,6 +26,6 @@
         } else {
             MCP.writeA( ((~i)+1)&0x0FFF);
         }
-        wait_us(1);
+        wait_us(50);
     }
 }
\ No newline at end of file