Sumit Pandey / Mbed 2 deprecated joystickserial

Dependencies:   mbed

Files at this revision

API Documentation at this revision

Comitter:
sumitpuneet
Date:
Sun Oct 27 19:04:42 2013 +0000
Commit message:
joystick serial data;

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
diff -r 000000000000 -r 8b7649bf9a2f main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Sun Oct 27 19:04:42 2013 +0000
@@ -0,0 +1,23 @@
+#include "mbed.h"
+ 
+AnalogIn inputj1(p17);     //inputs 17,18,19,20  for interfacing with 4 potentiometers in 2 joysticks. 
+AnalogIn inputj2(p18);
+AnalogIn inputk1(p19);
+AnalogIn inputk2(p20);
+
+Serial pc(USBTX,USBRX);  // Serial class to interface with serial data
+int x =50,y=50,z=50,w=50;
+ 
+int main() 
+{
+pc.baud(9600); // fixing the baud rate of transmission to 9600 bps.
+while(1)
+        {  
+        x=inputj1*100;
+        y=inputj2*100;
+        z=inputk1*100;
+        w=inputk2*100; 
+        pc.printf("%d,%d,%d,%d*",x,y,z,w);   //transmittion the joystick data to computer.
+        //wait(0.05);
+        }   
+}
\ No newline at end of file
diff -r 000000000000 -r 8b7649bf9a2f mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Sun Oct 27 19:04:42 2013 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/a9913a65894f
\ No newline at end of file