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.
main.cpp
- Committer:
- esokic
- Date:
- 2014-04-08
- Revision:
- 0:6f2ee7918e2c
- Child:
- 1:05900d7cb290
File content as of revision 0:6f2ee7918e2c:
#include "mbed.h"
//Analogni ulazi sa dzojstika
AnalogIn VRx(dp11);
AnalogIn VRy(dp10);
//Taster sa dzojstika
DigitalIn SW(dp17);
//Digitalni izlaz za aktivaciju LED buffera
DigitalOut enable(dp14);
//LED prikaz
BusOut prikazX(dp28,dp6,dp5);
BusOut prikazY(dp27,dp26,dp25);
DigitalOut prikazSW(dp23);
int main()
{
//aktivacija LED dioda
enable=0;
//Aktivacija pull-up otpornika
SW.mode(PullUp);
while(1) {
if (VRx<1/3) prikazX=1;
else if (VRx<2/3) prikazX=2;
else prikazX=4;
if (VRy<1/3) prikazY=1;
else if (VRy<2/3) prikazY=2;
else prikazY=4;
if (SW==1) prikazSW=1;
else prikazSW=0;
wait(0.01);
}
}