Psi Swarm robot library version 0.9

Fork of PsiSwarmV9 by Psi Swarm Robot

Committer:
jah128
Date:
Mon May 14 15:35:38 2018 +0000
Revision:
20:1bc6c6dc477b
Parent:
19:3e3b03d80ea3
Updated?

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jah128 12:878c6e9d9e60 1 /* University of York Robotics Laboratory PsiSwarm Library: Animations Header File
jah128 0:d6269d17c8cf 2 *
jah128 14:2f1ad77d281e 3 * Copyright 2017 University of York
jah128 6:b340a527add9 4 *
jah128 6:b340a527add9 5 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License.
jah128 6:b340a527add9 6 * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
jah128 6:b340a527add9 7 * Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS
jah128 6:b340a527add9 8 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
jah128 6:b340a527add9 9 * See the License for the specific language governing permissions and limitations under the License.
jah128 6:b340a527add9 10 *
jah128 0:d6269d17c8cf 11 * Library of simple predetermined movements
jah128 0:d6269d17c8cf 12 *
jah128 12:878c6e9d9e60 13 * File: animations.h
jah128 12:878c6e9d9e60 14 * [Was dances.h in version 0.7]
jah128 0:d6269d17c8cf 15 *
jah128 0:d6269d17c8cf 16 * (C) Dept. Electronics & Computer Science, University of York
jah128 0:d6269d17c8cf 17 * James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
jah128 0:d6269d17c8cf 18 *
jah128 14:2f1ad77d281e 19 * PsiSwarm Library Version: 0.9
jah128 0:d6269d17c8cf 20 *
jah128 14:2f1ad77d281e 21 * June 2017
jah128 0:d6269d17c8cf 22 *
jah128 0:d6269d17c8cf 23 *
jah128 0:d6269d17c8cf 24 */
jah128 0:d6269d17c8cf 25
jah128 12:878c6e9d9e60 26 #ifndef ANIMATIONS_H
jah128 12:878c6e9d9e60 27 #define ANIMATIONS_H
jah128 0:d6269d17c8cf 28
jah128 11:312663037b8c 29 /**
jah128 12:878c6e9d9e60 30 * The Animations class contains simple predefined LED animations and dances
jah128 11:312663037b8c 31 */
jah128 12:878c6e9d9e60 32 class Animations{
jah128 11:312663037b8c 33 public:
jah128 11:312663037b8c 34 /**
jah128 11:312663037b8c 35 * Make the robot vibrate (turn rapidly left & right) for approximately 1 second with LED flashes; restores LED states after action
jah128 11:312663037b8c 36 */
jah128 11:312663037b8c 37 void vibrate(void);
jah128 12:878c6e9d9e60 38
jah128 12:878c6e9d9e60 39 /**
jah128 12:878c6e9d9e60 40 * Patterns LEDs from back to front of robot 3 times then blinks at the front; animation takes about 1 second; restores LED states after action
jah128 12:878c6e9d9e60 41 */
jah128 12:878c6e9d9e60 42 void led_run1(void);
jah128 12:878c6e9d9e60 43
jah128 12:878c6e9d9e60 44 /**
jah128 12:878c6e9d9e60 45 * Sets the colour for single-colour LED animations (default = 1)
jah128 12:878c6e9d9e60 46 * @param colour The colour LED to use in the animation (1 = red, 2 = green, 3 = orange)
jah128 12:878c6e9d9e60 47 */
jah128 12:878c6e9d9e60 48 void set_colour(char colour);
jah128 12:878c6e9d9e60 49
jah128 12:878c6e9d9e60 50 private:
jah128 19:3e3b03d80ea3 51 void IF_vibrate(void);
jah128 19:3e3b03d80ea3 52 void IF_led_run1(void);
jah128 19:3e3b03d80ea3 53 char animation_running;
jah128 12:878c6e9d9e60 54 char hold_colour;
jah128 12:878c6e9d9e60 55 char animation_counter;
jah128 12:878c6e9d9e60 56 Timeout animation_timeout;
jah128 11:312663037b8c 57 };
jah128 0:d6269d17c8cf 58
jah128 0:d6269d17c8cf 59 #endif