T Nara / Mbed 2 deprecated robottt

Dependencies:   ACM1602 mbed

Files at this revision

API Documentation at this revision

Comitter:
tknara
Date:
Sun Mar 22 05:19:58 2015 +0000
Child:
1:daff0eea2103
Commit message:
??????????

Changed in this revision

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
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Mar 22 05:19:58 2015 +0000
@@ -0,0 +1,20 @@
+/*
+このプログラムはアナログスティックの角度を求めることを目的とする
+*/
+#include "mbed.h"
+#define pi 3.141592
+
+AnalogIn stickx(p16);
+AnalogIn sticky(p17);
+Serial pc(USBTX,USBRX);
+int main() {
+    float x,y,theta,deg;
+    while(1) {
+        x = stickx;
+        y = sticky;
+        theta = atan(x/y);
+        deg = theta * 180 / pi;
+        printf("deg<<%f\n",deg);
+        wait(1);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Mar 22 05:19:58 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/487b796308b0
\ No newline at end of file