![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
Marko_Marinic_0246048959
Dependencies: mbed SeeedShieldBot TextLCD BluetoothSerial
Diff: Stanovi.cpp
- Revision:
- 0:0b3b22a12941
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Stanovi.cpp Tue Jul 13 15:31:59 2021 +0000 @@ -0,0 +1,28 @@ +#include "Stanovi.h" +BusOut Stanovi(D10,D11,D12,D14); +void StanoviInit(void) { +Stanovi=BrojStanova(0);// initialise to zero +Stanovi=ObrnutoBrojStanova(0); +} +int BrojStanova(int Broj){ + int StanByte=00; + switch (Broj) { + case 0 : StanByte = 00;break; // 00000 binary + case 1 : StanByte = 01;break; // 00001 binary + case 2 : StanByte = 03;break; // 00011 binary + case 3 : StanByte = 07;break; // 00111 binary + case 4 : StanByte = 15;break; // 01111 binary + } + return StanByte; + } +int ObrnutoBrojStanova(int Broj){ + int StanByte=00; + switch (Broj) { + case 0 : StanByte = 00;break; // 00000 binary + case 1 : StanByte = 8;break; // 01000 binary + case 2 : StanByte = 12;break; // 01100 binary + case 3 : StanByte = 14;break; // 01110 binary + case 4 : StanByte = 15;break; // 01111 binary + } + return StanByte; + } \ No newline at end of file