harry rance
/
Revised_Space_Invaders
Harry Rance 200925395 Embedded Systems Project
Diff: N5110.h
- Revision:
- 5:2eb139b24219
- Parent:
- 0:c9bf674fe0c7
--- a/N5110.h Sun Apr 30 15:30:30 2017 +0000 +++ b/N5110.h Tue May 02 18:47:22 2017 +0000 @@ -93,33 +93,33 @@ // need to refresh display after setting pixels or writing strings lcd.refresh(); wait(5.0); - + // can check status of pixel using getPixel(x,y); lcd.clear(); // clear buffer lcd.setPixel(2,2); // set random pixel in buffer lcd.refresh(); - wait(1.0); - + wait(1.0); + int pixel_to_test = lcd.getPixel(2,2); - + printf("2,2 Pixel value = %i\n",pixel_to_test); - + if ( pixel_to_test ) { - lcd.printString("2,2 is set",0,4); + lcd.printString("2,2 is set",0,4); } - + // this one shouldn't be set pixel_to_test = lcd.getPixel(3,3); - + printf("3,3 Pixel value = %i\n",pixel_to_test); - + if ( pixel_to_test == 0 ) { - lcd.printString("3,3 is clear",0,5); + lcd.printString("3,3 is clear",0,5); } - + lcd.refresh(); wait(4.0); - + lcd.clear(); // clear buffer lcd.inverseMode(); // invert colours lcd.setBrightness(1.0); // put LED backlight on full @@ -135,7 +135,7 @@ lcd.plotArray(array); lcd.refresh(); wait(5.0); - + lcd.clear(); lcd.normalMode(); // normal colour mode back lcd.setBrightness(0.5); // put LED backlight on 50% @@ -147,8 +147,8 @@ } lcd.refresh(); // refresh after drawing shapes wait(5.0); - - + + lcd.clear(); // example of how to draw circles lcd.drawCircle(WIDTH/2,HEIGHT/2,20,1); // x,y,radius,black fill @@ -156,7 +156,7 @@ lcd.drawCircle(WIDTH/2,HEIGHT/2,30,0); // x,y,radius,transparent with outline lcd.refresh(); // refresh after drawing shapes wait(5.0); - + lcd.clear(); // example of how to draw rectangles // origin x,y,width,height,type @@ -256,7 +256,7 @@ /** Set a Pixel * -* This function sets a pixel in the screen buffer. +* This function sets a pixel in the screen buffer. * @param x - the x co-ordinate of the pixel (0 to 83) * @param y - the y co-ordinate of the pixel (0 to 47) */