Sheco_dev
/
Reading_RF_signal_FUTABA
When you want to read RF_signal of Futaba, use it
Embed:
(wiki syntax)
Show/hide line numbers
main.cpp
00001 #include "mbed.h" 00002 #include "Pulse1.h" 00003 00004 //------------------------------------ 00005 // Hyperterminal configuration 00006 // 115200 bauds, 8-bit data, no parity 00007 // pwm범위 : 920 ~ 2080, 중간값은 1500 00008 //------------------------------------ 00009 00010 Serial pc(SERIAL_TX, SERIAL_RX, 115200); 00011 00012 PulseInOut valueOfLeftAndRight(A0); //채널1, futaba기준 좌우방향(오른쪽 조이스틱) 00013 PulseInOut valueOfFrontAndRear(A1); //채널2, futaba기준 상하방향(오른쪽 조이스틱) 00014 PulseInOut valueOfScrewSpeed(A2); //채널3, futaba기준 상하방향, 회수스크류(왼쪽 조이스틱) 00015 00016 int main() 00017 { 00018 00019 while(1) { 00020 pc.printf("-----------------------------------\n"); 00021 pc.printf("Left and Right PWM : pw = %d \n",valueOfLeftAndRight.read_high_us(30000)); //마이크로초 단위로 받아옴 00022 pc.printf("Front and Rear PWM : pw = %d \n",valueOfFrontAndRear.read_high_us(30000)); 00023 pc.printf("Screw PWM : pw = %d \n",valueOfScrewSpeed.read_high_us(30000)); 00024 00025 00026 wait(0.5); 00027 } 00028 }
Generated on Tue Aug 23 2022 07:45:51 by 1.7.2