![](/media/cache/profiles/68a15b5278e4f7c4c056df9d5f1d3b1f.jpg.50x50_q85.jpg)
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
--- 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++) {