Demo Clock with Nucleo-F303RE and Starter Shield

Dependents:   Nucleo_StarterShileld_Clock mojo main job ... more

Files at this revision

API Documentation at this revision

Comitter:
rogerzuber
Date:
Thu May 03 07:54:17 2018 +0000
Parent:
0:864e710889fa
Commit message:
Erste Version

Changed in this revision

TM1636.cpp Show annotated file Show diff for this revision Revisions of this file
TM1636.h Show annotated file Show diff for this revision Revisions of this file
diff -r 864e710889fa -r e4450fb0849a TM1636.cpp
--- a/TM1636.cpp	Thu May 18 08:02:54 2017 +0000
+++ b/TM1636.cpp	Thu May 03 07:54:17 2018 +0000
@@ -156,22 +156,38 @@
 
 void TM1636::coding(int8_t DispData[])
 {
-	uint8_t PointData;
-	if(_PointFlag == POINT_ON)PointData = 0x80;
-	else PointData = 0; 
+	int8_t PointData;
+	if(_PointFlag == POINT_ON) {
+		PointData = 0x80;
+	}
+	else {
+		PointData = 0x00; 
+	}
 	for(uint8_t i = 0;i < 4;i ++)
 	{
-		if(DispData[i] == 0x7f)DispData[i] = 0x00;
-		else DispData[i] = TubeTab[DispData[i]] + PointData;
+		if(DispData[i] == 0x7f){
+			DispData[i] = 0x00;
+		}
+		else {
+			DispData[i] = TubeTab[DispData[i]] + PointData;
+		}
 	}
 }
 
 int8_t TM1636::coding(int8_t DispData)
 {
-	uint8_t PointData;
-	if(_PointFlag == POINT_ON)PointData = 0x80;
-	else PointData = 0; 
-if(DispData == 0x7f) DispData = 0x00 + PointData;			//The bit digital tube off
-	else DispData = TubeTab[DispData] + PointData;
+	int8_t PointData;
+	if(_PointFlag == POINT_ON){
+		PointData = 0x80;
+	}
+	else {
+		PointData = 0x00;
+	}
+	if (DispData == 0x7f) {
+		DispData = 0x00 + PointData;		//The bit digital tube off
+	}
+	else {
+		DispData = TubeTab[DispData] + PointData;
+	}
 	return DispData;
 }
diff -r 864e710889fa -r e4450fb0849a TM1636.h
--- a/TM1636.h	Thu May 18 08:02:54 2017 +0000
+++ b/TM1636.h	Thu May 03 07:54:17 2018 +0000
@@ -76,4 +76,3 @@
   DigitalInOut Datapin;
 };
 #endif
-