From 9c1e257826c23682fa5fd85aafe9ff790327bf01 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 23 Jan 2012 08:46:39 +1100 Subject: [PATCH] fixed example in PID library --- libraries/PID/examples/pid/Makefile | 1 - libraries/PID/examples/pid/pid.pde | 14 ++++++++++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/libraries/PID/examples/pid/Makefile b/libraries/PID/examples/pid/Makefile index 85b4d8856b..d1f40fd90f 100644 --- a/libraries/PID/examples/pid/Makefile +++ b/libraries/PID/examples/pid/Makefile @@ -1,2 +1 @@ -BOARD = mega include ../../../AP_Common/Arduino.mk diff --git a/libraries/PID/examples/pid/pid.pde b/libraries/PID/examples/pid/pid.pde index 148f9644b8..509ed17166 100644 --- a/libraries/PID/examples/pid/pid.pde +++ b/libraries/PID/examples/pid/pid.pde @@ -4,20 +4,30 @@ */ #include +#include #include #include // ArduPilot RC Library #include // ArduPilot Mega RC Library +#include long radio_in; long radio_trim; -PID pid(10, "TEST1_"); +Arduino_Mega_ISR_Registry isr_registry; + +#if CONFIG_APM_HARDWARE == APM_HARDWARE_APM2 + APM_RC_APM2 APM_RC; +#else + APM_RC_APM1 APM_RC; +#endif + +PID pid(AP_Var::k_key_none, NULL); void setup() { Serial.begin(38400); Serial.println("ArduPilot Mega PID library test"); - APM_RC.Init(); // APM Radio initialization + APM_RC.Init(&isr_registry); // APM Radio initialization delay(1000); //rc.trim();