123

Dependencies:   mbed

Committer:
PINGTING
Date:
Tue Sep 15 03:51:42 2020 +0000
Revision:
0:7ebd6bd40ddd
123

Who changed what in which revision?

UserRevisionLine numberNew contents of line
PINGTING 0:7ebd6bd40ddd 1 #include "mbed.h"
PINGTING 0:7ebd6bd40ddd 2
PINGTING 0:7ebd6bd40ddd 3 AnalogIn analog_value_x(PC_3);
PINGTING 0:7ebd6bd40ddd 4 AnalogIn analog_value_y(PC_2);
PINGTING 0:7ebd6bd40ddd 5 int main(){
PINGTING 0:7ebd6bd40ddd 6 double vx;
PINGTING 0:7ebd6bd40ddd 7 double vy;
PINGTING 0:7ebd6bd40ddd 8 while(1){
PINGTING 0:7ebd6bd40ddd 9
PINGTING 0:7ebd6bd40ddd 10 vx=analog_value_x.read()*3.3;
PINGTING 0:7ebd6bd40ddd 11 vy=analog_value_y.read()*3.3;
PINGTING 0:7ebd6bd40ddd 12 printf("X Value=%f\n\r",vx);
PINGTING 0:7ebd6bd40ddd 13 printf("Y Value=%f\n\r",vy);
PINGTING 0:7ebd6bd40ddd 14 wait(0.5);
PINGTING 0:7ebd6bd40ddd 15 }
PINGTING 0:7ebd6bd40ddd 16 }