Alvaro Cassinelli
/
laserScannerControl_FRDMK64F
Example controlling galvanomirrors (X and Y) using the spi DAC MCP4922 and the new platform FRDM_K64F
Diff: laserProjectorHardware/laserProjectorHardware.cpp
- Revision:
- 4:1428775752f7
- Parent:
- 3:89f592efbe84
- Child:
- 5:cea6da0fe2f0
diff -r 89f592efbe84 -r 1428775752f7 laserProjectorHardware/laserProjectorHardware.cpp --- a/laserProjectorHardware/laserProjectorHardware.cpp Wed Jun 04 09:47:04 2014 +0000 +++ b/laserProjectorHardware/laserProjectorHardware.cpp Wed Dec 10 07:22:41 2014 +0000 @@ -105,7 +105,14 @@ Laser_Blue =color&0x01; } +void HardwareIO::drawCircle(int X, int Y, int R, int numPoints, int seconds) { + Timer t; + t.start(); + while(t.read_ms()<seconds*1000) drawCircle( X, Y, R, numPoints); + t.stop(); + } void HardwareIO::drawCircle(int X, int Y, int R, int numPoints) { + float alpha=2*3.141592/numPoints; float theta=0; for (int i=0; i<numPoints; i++) {