cuma coba publish ya

Dependencies:   mbed encoderKRAI

Files at this revision

API Documentation at this revision

Comitter:
315_josh
Date:
Thu Sep 12 09:25:41 2019 +0000
Commit message:
ngetesdoang

Changed in this revision

encoderKRAI.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
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r cb94be0bdb13 encoderKRAI.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/encoderKRAI.lib	Thu Sep 12 09:25:41 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/tamamfirdaus/code/encoderKRAI/#88b904c4ffbb
diff -r 000000000000 -r cb94be0bdb13 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Thu Sep 12 09:25:41 2019 +0000
@@ -0,0 +1,21 @@
+#include "mbed.h"
+#include "encoderKRAI.h"
+
+Serial pc(USBTX, USBRX);
+double theta ;
+double pulse;
+
+encoderKRAI enc_shagai(PC_6, PC_7, 538, encoderKRAI::X4_ENCODING);
+
+void hitungParameter(){
+    pulse=(double) enc_shagai.getPulses()*360/538;
+    enc_shagai.reset();
+    theta+=pulse;
+    pc.printf("theta = %.2f\t\n", theta );
+}
+
+int main (){
+    while(1){
+        hitungParameter();
+        }
+    }
\ No newline at end of file
diff -r 000000000000 -r cb94be0bdb13 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Thu Sep 12 09:25:41 2019 +0000
@@ -0,0 +1,1 @@
+https://os.mbed.com/users/mbed_official/code/mbed/builds/65be27845400
\ No newline at end of file