This class encapsulates all the algorithms required for the displaying strings and time dependent patterns on the lcd.
Dependents: 200943412_QuickClick
Diff: Display.cpp
- Revision:
- 0:dd78eca4b004
- Child:
- 1:41a1c20a2056
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Display.cpp Sat Apr 08 15:01:45 2017 +0000 @@ -0,0 +1,62 @@ +#include "Display.h" +#include "N5110.h" + +Display::Display() +{ + _h = 0; + _w = 0.1; + _a = 0; + _A = 0; +} + +Display::~Display() +{ + +} +void Display::init() +{ + + //InterruptIn button_X(SW3); + //olatile int g_timer_flag = 0; + // volatile int X_flag = 0; + // button_X.fall(&X_isr); + // button_X.mode(PullNone); + _h = 0; + _w = 0.1; + _a = 0; + _A = 0; +} + +void Display::drawCircle(N5110 &lcd) +{ +while(1) { + for( int _A = 0; _A < 84; _A++ ) { + _a = _A; + + wait(_w); + lcd.refresh(); + lcd.setPixel(_a,22); + lcd.setPixel(_a,23); + lcd.setPixel(_a,24); + lcd.setPixel(_a,25); + lcd.setPixel(_a,26); + } + calculateWait(); + _h++; + lcd.clear(); + } +} + +void Display::calculateWait() +{ + if (_h < 10) { + _w = _w - _w/10; } + else if (_h < 20) { + _w = _w - _w/20; } + else if (_h < 30) { + _w = _w - _w/30; } + else + { _w = _w - _w/40; } +} + +