djkera / arducopter

Automatically exported from code.google.com/p/arducopter
0 stars 0 forks source link

Suggested Code Improvement To control_modes.pde (Arducopter 2.8.1) #529

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
I humbly suggest the below as a replacement for the readSwitch function in 
control_modes.pde

static byte readSwitch(void){
    int16_t pulsewidth = g.rc_5.radio_in;   // default for Arducopter

    if (pulsewidth < 1231) return 0;
    if (pulsewidth < 1361) return 1;
    if (pulsewidth < 1491) return 2;
    if (pulsewidth < 1621) return 3;
    if (pulsewidth < 1750) return 4;        // Software Manual
    return 5;                               // Hardware Manual
}

Original issue reported on code.google.com by geekera...@gmail.com on 14 Dec 2012 at 3:29

GoogleCodeExporter commented 9 years ago
done, thanks!

Original comment by jasonshort on 14 Dec 2012 at 9:26

GoogleCodeExporter commented 9 years ago

Original comment by jasonshort on 14 Dec 2012 at 9:26