Konstrukcijski rad sastoji se od tri LED dioda, jedan piezo zvučnik, dva tipkala, jedan SegDisplay i osam otpornika.

Dependencies:   mbed Library_7_SegDisplay_Semafor

https://os.mbed.com/media/uploads/karlo_tvz/shema_semafor.png

Files at this revision

API Documentation at this revision

Comitter:
karlo_tvz
Date:
Wed Dec 01 21:19:53 2021 +0000
Parent:
0:8614ff52857a
Commit message:
Konstrukcijski rad

Changed in this revision

Projekt-Semafor/Projekt_Semafor_SegDisplay.lib Show annotated file Show diff for this revision Revisions of this file
Projekt-Semafor/SegDisplay.cpp Show diff for this revision Revisions of this file
Projekt-Semafor/SegDisplay.h Show diff for this revision Revisions of this file
Projekt-Semafor/main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 8614ff52857a -r 4d673812b129 Projekt-Semafor/Projekt_Semafor_SegDisplay.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Projekt-Semafor/Projekt_Semafor_SegDisplay.lib	Wed Dec 01 21:19:53 2021 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/teams/TVZ2021/code/Library_7_SegDisplay_Semafor/#c8316543abdd
diff -r 8614ff52857a -r 4d673812b129 Projekt-Semafor/SegDisplay.cpp
--- a/Projekt-Semafor/SegDisplay.cpp	Wed Dec 01 13:13:10 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,46 +0,0 @@
-#include "SegDisplay.h"
-BusOut Seg1(PB_4,PB_10,PA_8,PA_9,PC_7,PB_6,PA_7,PB_9); 
-void SegInit(void)
-{
-    Seg1=SegConvert(0); 
-}
-char SegConvert(int SegValue)   //Konverzija int varijable u niz bitova za ispis na 7 seg. displayu
-{
-    char SegByte=0x00;
-    switch (SegValue) { 
-        case 0 :
-            SegByte = 0x3F;
-            break; 
-        case 1 :
-            SegByte = 0x06;
-            break; 
-        case 2 :
-            SegByte = 0x5B;
-            break; 
-        case 3 :
-            SegByte = 0x4F;
-            break; 
-        case 4 :
-            SegByte = 0x66;
-            break; 
-        case 5 :
-            SegByte = 0x6D;
-            break; 
-        case 6 :
-            SegByte = 0x7D;
-            break; 
-        case 7 :
-            SegByte = 0x07;
-            break; 
-        case 8 :
-            SegByte = 0x7F;
-            break; 
-        case 9 :
-            SegByte = 0x6F;
-            break; 
-        case 10 :
-            SegByte = 0x80;
-            break; 
-    }
-    return SegByte;
-}
\ No newline at end of file
diff -r 8614ff52857a -r 4d673812b129 Projekt-Semafor/SegDisplay.h
--- a/Projekt-Semafor/SegDisplay.h	Wed Dec 01 13:13:10 2021 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,8 +0,0 @@
-#ifndef SEGDISPLAY_H
-#define SEGDISPLAY_H
-#include "mbed.h"
-extern BusOut Seg1; 
-void SegInit(void); 
-char SegConvert(int SegValue); 
-#endif
-      
\ No newline at end of file
diff -r 8614ff52857a -r 4d673812b129 Projekt-Semafor/main.cpp
--- a/Projekt-Semafor/main.cpp	Wed Dec 01 13:13:10 2021 +0000
+++ b/Projekt-Semafor/main.cpp	Wed Dec 01 21:19:53 2021 +0000
@@ -14,6 +14,7 @@
 void toggle2(void); //Semafor popravljen - pušta se ponovno u rad
 int state=1;  // inicijalizacija varijable
 int sec=0; // inicijalizacija varijable
+
 void yellowBlink()
 {
     yellowLED=!yellowLED;