update tambahan display... masih bug

Dependencies:   DigitDisplay Motor PID Joystick_OrdoV5 mbed millis

Fork of MainProgram_BaseBaru by KRAI 2017

Files at this revision

API Documentation at this revision

Comitter:
franshendri
Date:
Tue Feb 14 15:46:14 2017 +0000
Parent:
34:1cfd9b1c7d27
Commit message:
tmbah display;

Changed in this revision

DigitDisplay.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 1cfd9b1c7d27 -r 98431f62f144 DigitDisplay.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/DigitDisplay.lib	Tue Feb 14 15:46:14 2017 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/users/seeed/code/DigitDisplay/#d3173c8bfd48
diff -r 1cfd9b1c7d27 -r 98431f62f144 main.cpp
--- a/main.cpp	Tue Feb 14 13:56:53 2017 +0000
+++ b/main.cpp	Tue Feb 14 15:46:14 2017 +0000
@@ -44,6 +44,7 @@
 #include "Servo.h"
 #include "encoderKRAI.h"
 #include "millis.h"
+#include "DigitDisplay.h"
 
 /***********************************************/
 /*          Konstanta dan Variabel             */
@@ -134,6 +135,9 @@
 DigitalIn limitTengah(PB_10, PullUp);
 DigitalIn limitBawah(PC_8, PullUp);
 
+/* Deklarasi Display */
+DigitDisplay display (D9, D5);
+
 
 /****************************************************/
 /*         Deklarasi Fungsi dan Procedure           */
@@ -404,7 +408,21 @@
         launcherBlk.brake(1);
     }     
 }
-  
+
+void displayL ()
+{
+    /*display.write(0, (int)target_rpm / 10);
+    display.write(1, (int)target_rpm % 10);
+    display.write(2, (int)target_rpm2 / 10 );
+    display.write(3, (int)target_rpm2 % 10);*/
+    
+    display.write(0, (int)1);
+    display.write(1, (int)2);
+    display.write(2, (int)3);
+    display.write(3, (int)4);
+    
+    display.setColon(true);
+}  
 /*********************************************************/
 /*                  Main Function                        */
 /*********************************************************/
@@ -421,8 +439,9 @@
     while(1)
     {
         // Interrupt Serial
-        joystick.idle();        
-        if(joystick.readable()) 
+        joystick.idle(); 
+        displayL();       
+        /*if(joystick.readable()) 
         {
             // Panggil fungsi pembacaan joystik
             joystick.baca_data();
@@ -441,5 +460,6 @@
         {
             joystick.idle();
         }
+        */
     }
 }
\ No newline at end of file