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.
Loptica.cpp
- Committer:
- Vato
- Date:
- 2014-06-05
- Revision:
- 0:a5f6ba8c378e
File content as of revision 0:a5f6ba8c378e:
#include "Loptica.h" void Loptica::setX(int broj) { x = broj; } void Loptica::setY(int broj) { y = broj; } int Loptica::dajX() { return x; } int Loptica::dajY() { return y; } int Loptica::dajKorakX() { return x_korak; } int Loptica::dajKorakY() { return y_korak; } void Loptica::postaviKorak(int xKorak, int yKorak) { x_korak = xKorak; y_korak = yKorak; } void Loptica::crtajLopticu(N5110 &display) { for(int i = -1; i < 2; i++) for(int j = -1; j < 2; j++) display.setPixel(x + j, y + i); display.refresh(); } void Loptica::brisiLopticu(N5110 &display) { for(int i = -1; i < 2; i++) for(int j = -1; j < 2; j++) display.clearPixel(x + j, y + i); display.refresh(); } void Loptica::osvjeziPoziciju() { x += x_korak; y += y_korak; }