Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
00001 #include "mbed.h" 00002 00003 AnalogIn inputj1(p17); //inputs 17,18,19,20 for interfacing with 4 potentiometers in 2 joysticks. 00004 AnalogIn inputj2(p18); 00005 AnalogIn inputk1(p19); 00006 AnalogIn inputk2(p20); 00007 00008 Serial pc(USBTX,USBRX); // Serial class to interface with serial data 00009 int x =50,y=50,z=50,w=50; 00010 00011 int main() 00012 { 00013 pc.baud(9600); // fixing the baud rate of transmission to 9600 bps. 00014 while(1) 00015 { 00016 x=inputj1*100; 00017 y=inputj2*100; 00018 z=inputk1*100; 00019 w=inputk2*100; 00020 pc.printf("%d,%d,%d,%d*",x,y,z,w); //transmittion the joystick data to computer. 00021 //wait(0.05); 00022 } 00023 }
Generated on Sat Jul 23 2022 05:48:17 by
1.7.2