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: mbed
GraphicEngine/GraphicEngine.cpp
- Committer:
- el19tb
- Date:
- 2020-05-04
- Revision:
- 3:648c9d5001be
- Child:
- 4:aae7f8d4ab78
File content as of revision 3:648c9d5001be:
#include "GraphicEngine.h" N5110 lcd; GraphicEngine::GraphicEngine(Chicken *chicken){ this->chick = chicken; } void GraphicEngine::init(){ lcd.init(); } void GraphicEngine::showChicken(){ //fill the chicken with black color lcd.drawRect(chick->leftSide, chick->topSide, chick->rightSide, chick->bottomSide, FILL_BLACK); } void GraphicEngine::showCar(Car cars[]){ //first car lcd.drawRect(cars[0].left, 48 - 8*2, 8*2, 8, FILL_BLACK); //second car lcd.drawRect(cars[1].left + 40, 48 - 8*2, 8*2, 8, FILL_BLACK); //first car lcd.drawRect(cars[2].left, 48 - 8*2, 8*3, 8, FILL_BLACK); //second car lcd.drawRect(cars[3].left + 20, 48 - 8*3, 8, 8, FILL_BLACK); if(cars[0].left > 70 && cars[1].left > 100){ cars[0].left = -cars[0].right; cars[1].left = -cars[1].right; //wait_ms(100); } } void GraphicEngine::contrast(){ lcd.setContrast(0.4); } void GraphicEngine::clear(){ lcd.clear(); } void GraphicEngine::refresh(){ lcd.refresh(); } void GraphicEngine::backLightOn(){ lcd.backLightOn(); }