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.
Dependencies: N5110 PowerControl mbed
Diff: main.cpp
- Revision:
- 7:9ecf9df1e95e
- Parent:
- 6:af4d3c5a9d43
- Child:
- 8:c12828c83a44
--- a/main.cpp Tue Apr 21 21:29:29 2015 +0000 +++ b/main.cpp Wed Apr 22 11:38:40 2015 +0000 @@ -82,6 +82,24 @@ lcd.drawRect(41,20,10,2,1); lcd.drawRect(41,0,2,10,1); + lcd.drawRect(7,8,24,2,1); + + + + + + + + + + + + + + + + lcd.drawRect(83,47,1,1,2); //Round off shape + } void checkRight() @@ -89,9 +107,9 @@ int r = 0;//Variable for right movement check - if(lcd.getPixel (i+4,j))//Check 4 pixels to the right + if(lcd.getPixel (i+3,j))//Check 4 pixels to the right r++; - if(lcd.getPixel (i+5,j))//Check 5 pixels to the right + if(lcd.getPixel (i+4,j))//Check 5 pixels to the right r++; if (r==2) { // Condition for solid obstacles i--; @@ -101,9 +119,9 @@ void checkLeft() { int l = 0 ; // Variable for left movement check - if(lcd.getPixel (i-4,j))//Check 4 pixels to the left + if(lcd.getPixel (i-3,j))//Check 4 pixels to the left l++; - if(lcd.getPixel (i-5,j))//Check 5 pixels to the left + if(lcd.getPixel (i-4,j))//Check 5 pixels to the left l++; if (l==2) { // Condition for solid obstacles i++; @@ -114,9 +132,9 @@ void checkUp() { int u=0; - if(lcd.getPixel (i,j-4))//Check 4 pixels above + if(lcd.getPixel (i,j-3))//Check 4 pixels above u++; - if(lcd.getPixel (i,j-5))//Check 5 pixels above + if(lcd.getPixel (i,j-4))//Check 5 pixels above u++; if (u==2) { // Condition for solid obstacles j++; @@ -126,9 +144,9 @@ void checkDown() { int d=0; - if(lcd.getPixel (i,j+4))//Check 4 pixels below + if(lcd.getPixel (i,j+3))//Check 4 pixels below d++; - if(lcd.getPixel (i,j+5))//Check 5 pixels below + if(lcd.getPixel (i,j+4))//Check 5 pixels below d++; if (d==2) { // Condition for solid obstacles j--;