Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: main.cpp
- Revision:
- 4:a7442c1faed1
- Parent:
- 3:9e8eb12f831f
- Child:
- 5:54ff826d1897
--- a/main.cpp Fri Apr 24 07:09:48 2015 +0000
+++ b/main.cpp Fri Apr 24 07:51:33 2015 +0000
@@ -29,7 +29,7 @@
positionDistance = posDistance;
}
int Point :: getArraySlice (void){
- return (positionRadian + (offAngles[positionHeight]/3))%120;
+ return (int) (positionRadian + (offAngles[positionHeight]/3))%120;
}
char Point :: getIdentifyingChar(void){
return 0x01 << positionHeight;
@@ -118,7 +118,7 @@
void sendPointOver (int slice, int distance, char height, char operation){
///TODO implement communications
- printf(" slice %i distance %i height %X operation %c \r\n", (char) slice, (char) distance, height, operation);
+ //printf(" slice %i distance %i height %X operation %c \r\n", (char) slice, (char) distance, height, operation);
txBuffer [0] = (char) slice;
txBuffer [1] = (char)distance;
txBuffer [2] = height;
@@ -181,10 +181,10 @@
}
registerButtons = false;
buttonRegisterTimeout.attach(®isterButtonsAgain, .1);
- printf("moveDown\r\n");
if (currentMode == line){
drawPoint();
}
+ printf("moveDown\r\n");
pointer.moveDown();
}
void rotateRight(){
@@ -221,11 +221,11 @@
printf("rotateLeft\r\n");
if (currentMode == line){
drawPoint();
- pointer.rotateRight();
+ pointer.rotateLeft();
wait(.3);
while (digitalRotateLeft){
drawPoint();
- pointer.rotateRight();
+ pointer.rotateLeft();
wait(.03);
}
return;
@@ -257,10 +257,10 @@
}
registerButtons = false;
buttonRegisterTimeout.attach(®isterButtonsAgain, .1);
- printf("moveIn\r\n");
if (currentMode == line){
drawPoint();
}
+ printf("moveIn\r\n");
pointer.moveIn();
}
@@ -274,6 +274,7 @@
sendPointOver(slice, distance, height, 'x');
}
void drawWholeCircle(){
+ printf("drawing circle");
int distance = pointer.getPositionDistance();
char height = pointer.getIdentifyingChar();
for (int i = 0; i < 120; i ++){
@@ -318,7 +319,7 @@
buttonMoveOut.rise(&moveOut);
buttonMoveIn.rise(&moveIn);
buttonSelect.rise(&select);
- pointerBlinkTicker.attach(&pointerBlink, 1.0);
+ pointerBlinkTicker.attach(&pointerBlink, 2.0);
while(1);