Takashi Asano
/
linearMirrorMotion1017
sotsuron
Fork of linearMirrorMotion1017 by
Diff: main.cpp
- Revision:
- 2:0548c7bf9fba
- Parent:
- 1:daf6b4939120
- Child:
- 4:e00e709d7173
--- a/main.cpp Fri Sep 07 08:04:40 2012 +0000 +++ b/main.cpp Thu Oct 04 05:14:14 2012 +0000 @@ -5,7 +5,7 @@ void processSerial(); -unsigned int Y; // position of the mirror (note: in fact it is an ANGLE) +unsigned int X, Y; // position of the mirror (note: in fact it is an ANGLE) bool newPositionReady=false; unsigned int counter=0; @@ -55,11 +55,18 @@ stringData[indexStringData] = val; indexStringData++; } - + // X value? else if (val=='X') { stringData[indexStringData] = 0 ; - Y=atoi(stringData); + X=atoi(stringData); + indexStringData=0; + //newPositionReady=true; + } + // Y value? + else if (val=='Y') { + stringData[indexStringData] = 0 ; + Y=atoi(stringData); indexStringData=0; newPositionReady=true; }