Paparazzi UAS v7.0_unstable
Paparazzi is a free software Unmanned Aircraft System.
All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
servo_tester.c
Go to the documentation of this file.
1/*
2 * Copyright (C) 2012 Ewoud Smeur <ewoud_smeur@msn.com>
3 *
4 * This file is part of paparazzi.
5 *
6 * paparazzi is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2, or (at your option)
9 * any later version.
10 *
11 * paparazzi is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with paparazzi; see the file COPYING. If not, write to
18 * the Free Software Foundation, 59 Temple Place - Suite 330,
19 * Boston, MA 02111-1307, USA.
20 */
21
28#include "servo_tester.h"
30#include "generated/airframe.h"
31#include "generated/airframe.h"
33#include "generated/modules.h"
34
36
43
44#ifndef TIME_PER_DEFLECTION
46#define TIME_PER_DEFLECTION 0.8
47#endif
48
50
66
67
69{
70
71 /*Go up and down with increasing amplitude*/
73 if (is_servo) {
75 } else if (servo_run_counter < steps / 2) {
77 } else {
79 }
80 servo_run_timer += 1;
81
82 /*Give time to reach the setpoint*/
86 }
87 } else if (do_servo_run == true) {
88 /*Reset de servo run*/
89 do_servo_run = false;
92 }
93
96}
Hardware independent code for commands handling.
uint16_t foo
Definition main_demo5.c:58
Hardware independent API for actuators (servos, motor controllers).
int32_t steps
int32_t servo_run_timer
bool do_servo_run
int32_t servo_run_counter
#define TIME_PER_DEFLECTION
Time in seconds per deflection, before going to the next.
void servo_tester_periodic()
int32_t servo_run_step
bool is_servo
int32_t servo_test_val
void servo_tester_init()
int32_t servo_mean
Module useful for testing a servo and finding the response.
int int32_t
Typedef defining 32 bit int type.