Example controlling galvanomirrors (X and Y) using the spi DAC MCP4922 and the new platform FRDM_K64F

Dependencies:   mbed

Revision:
1:4be6abc4ed43
Parent:
0:26b228dde70c
Child:
2:383b2acec6e4
diff -r 26b228dde70c -r 4be6abc4ed43 laserProjectorHardware/laserProjectorHardware.cpp
--- a/laserProjectorHardware/laserProjectorHardware.cpp	Sun May 25 11:28:28 2014 +0000
+++ b/laserProjectorHardware/laserProjectorHardware.cpp	Sun May 25 12:24:21 2014 +0000
@@ -23,10 +23,10 @@
    //  pc.baud(921600);//115200);//
     
     // Setup the spi for 8 bit data, high steady state clock,
-    // second edge capture, with a 10MHz clock rate
+    // second edge capture, with a 20MHz clock rate (max for the MCP4922)
     csDAC = 1;
     spiDAC.format(16,0);
-    spiDAC.frequency(16000000);
+    spiDAC.frequency(20000000);
    
    // default initial mirror position: 
     writeOutX(CENTER_AD_MIRROR_X);
@@ -62,7 +62,7 @@
 
 void HardwareIO::setRedPower(int powerValue){
     if(powerValue > 0){
-        Laser_Red = 0; // att! it's negated...
+        Laser_Red = 0; // att! it's negated for the laser diode module "vector"
     }
     else{
         Laser_Red = 1;