Psi Swarm robot library version 0.9
Fork of PsiSwarmV8_CPP by
Diff: demo.h
- Revision:
- 11:312663037b8c
- Parent:
- 8:6c92789d5f87
- Child:
- 14:2f1ad77d281e
--- a/demo.h Sun Oct 16 16:00:20 2016 +0000 +++ b/demo.h Sun Oct 16 21:06:15 2016 +0000 @@ -1,11 +1,11 @@ /* University of York Robotics Laboratory PsiSwarm Library: Demo Mode Header File - * + * * Copyright 2016 University of York * - * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and limitations under the License. * * File: demo.h @@ -18,21 +18,40 @@ * October 2016 * * - */ + */ #ifndef DEMO_H #define DEMO_H -void demo_mode(void); -void demo_handle_switch_event(char switch_pressed); -void demo_update_leds(void); -void demo_event_thread(void); -void start_line_demo(void); -void start_obstacle_demo(void); -void start_spinning_demo(void); -void start_stress_demo(void); -void line_demo_cycle(void); -void obstacle_demo_cycle(void); -void spinning_demo_cycle(void); -void stress_demo_cycle(void); + +/** + * Demo class + * Build in demonstration\test mode for the robot that is enabled by holding the cursor switch + * in a direction for 1 second at boot-up time. The demonstration includes the ability to get + * readings from most of the on-board sensors, enable LEDs and motors, and run a number of basic + * build in demonstrations and tests, using cursor-navigated menus. + * + * The demo can also be enabled by calling the start_demo_mode() function. +*/ +class Demo +{ +public: + /** + * Start the demonstration mode + */ + void start_demo_mode(void); + void demo_handle_switch_event(char switch_pressed); + +private: + void demo_update_leds(void); + void demo_event_thread(void); + void start_line_demo(void); + void start_obstacle_demo(void); + void start_spinning_demo(void); + void start_stress_demo(void); + void line_demo_cycle(void); + void obstacle_demo_cycle(void); + void spinning_demo_cycle(void); + void stress_demo_cycle(void); +}; #endif \ No newline at end of file