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 Adafruit_GFX 19E042PIM_MB_PINS
main1.txt
- Committer:
- ostoja
- Date:
- 2022-01-17
- Revision:
- 0:981049ce9511
File content as of revision 0:981049ce9511:
/*
* Nenad Tepavac 2020/0028
* Etf Beograd
*/
/*
* Biblioteke
*/
#include "mbed.h"
/*
* Makroi
*/
//11000000
#define NULA 0xC0
#define KEC 0xF9
#define DVA 0xA4
#define TRI 0xB0
#define CTR 0x99
#define PET 0x92
#define SES 0x82
#define SEAM 0xF8
#define OSAM 0x80
#define DE 0x90
BusOut display(PA_10, PA_9, PA_8,PB_10,PB_5, PB_4, PB_3, PB_6, PC_7);
InterruptIn sw(PC_8);
InterruptIn btn(BUTTON1);
int c = 0;
int b = 0;
int b2 = 0;
int s = 0;
void increment(){
c++;
if(c > 10)
c = 0;
switch(c){
case 0:
display.write(NULA);
break;
case 1:
display.write(KEC);
break;
case 2:
display.write(DVA);
break;
case 3:
display.write(TRI);
break;
case 4:
display.write(CTR);
break;
case 5:
display.write(PET);
break;
case 6:
display.write(SES);
break;
case 7:
display.write(SEAM);
break;
case 8:
display.write(OSAM);
break;
case 9:
display.write(DE);
break;
}
}
int main(){
//podizanje broja mogu da postignu i dugme na nucleo ploci i sw2 na maticnoj
//ne koristim sw1 jer je problematican
sw.rise(&increment);
btn.rise(&increment);
while(true){
if(c > 9){
display.write(0b101111001);
wait_ms(5);
display.write(NULA);
wait_ms(5);
}
}
}