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 5:3cdd1a37cdd7 1 /* University of York Robotics Laboratory PsiSwarm Library: PsiSwarm Settings File
jah128 0:d6269d17c8cf 2 *
jah128 16:50686c07ad07 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 * File: settings.h
jah128 0:d6269d17c8cf 12 *
jah128 0:d6269d17c8cf 13 * (C) Dept. Electronics & Computer Science, University of York
jah128 0:d6269d17c8cf 14 * James Hilder, Alan Millard, Alexander Horsfield, Homero Elizondo, Jon Timmis
jah128 0:d6269d17c8cf 15 *
jah128 16:50686c07ad07 16 * PsiSwarm Library Version: 0.9
jah128 0:d6269d17c8cf 17 *
jah128 16:50686c07ad07 18 * June 2017
jah128 0:d6269d17c8cf 19 *
jah128 0:d6269d17c8cf 20 *
jah128 0:d6269d17c8cf 21 */
jah128 0:d6269d17c8cf 22
jah128 11:312663037b8c 23 /*! \file settings.h
jah128 11:312663037b8c 24 \brief Header file containing PsiSwarm define headings
jah128 11:312663037b8c 25 \brief USE_MOTOR_CALIBRATION Enable motor calibration using stored values.
jah128 11:312663037b8c 26 If enabled, the actual motor speeds will be adjusted from the requested values using the motor calibration values stored in EPROM.
jah128 11:312663037b8c 27 \brief OFFSET_MOTORS Enable PWM offset to prevent stalling at low speeds. The motors typically stall when the PWM output is below around 0.2.
jah128 11:312663037b8c 28 Enabling the offset shifts the actual PWM range so that the motor speed 0.0 -> 1.0 actually sets a PWM output of 0.2 -> 1.0
jah128 11:312663037b8c 29
jah128 11:312663037b8c 30 */
jah128 11:312663037b8c 31
jah128 11:312663037b8c 32 #ifndef SETTINGS_H
jah128 11:312663037b8c 33 #define SETTINGS_H
jah128 11:312663037b8c 34
jah128 4:1c621cb8cf0d 35 /* USE_MOTOR_CALIBRATION [1=on, recommended 0=off]
jah128 4:1c621cb8cf0d 36 * If enabled, the actual motor speeds will be adjusted from the requested values using the motor calibration values stored in
jah128 18:9204f74069b4 37 * firmware (and set using the motor calibration code in the demo mode). If calibration values not stall, will still offset
jah128 18:9204f74069b4 38 * motors if OFFSET_MOTORS is enable.
jah128 4:1c621cb8cf0d 39 */
jah128 4:1c621cb8cf0d 40 #define USE_MOTOR_CALIBRATION 1
jah128 0:d6269d17c8cf 41
jah128 0:d6269d17c8cf 42 /* OFFSET_MOTORS [1=on, recommended 0=off]
jah128 0:d6269d17c8cf 43 * The motors typically stall when the PWM output is below around 0.2
jah128 0:d6269d17c8cf 44 * Enabling the offset shifts the actual PWM range so that the motor speed 0.0 -> 1.0 actually sets a PWM output of 0.2 -> 1.0
jah128 18:9204f74069b4 45 * If USE_MOTOR_CALIBRATION enable and calibration values for robot stored, OFFSET_MOTORS is ignored as offset is included in calibration
jah128 0:d6269d17c8cf 46 */
jah128 0:d6269d17c8cf 47 #define OFFSET_MOTORS 1
jah128 0:d6269d17c8cf 48
jah128 0:d6269d17c8cf 49 /* ENABLE_DEMO [1=on, 0=off]
jah128 0:d6269d17c8cf 50 * If enabled the demo mode will be launched when the center button is held as the MBED is switched on or reset
jah128 0:d6269d17c8cf 51 */
jah128 0:d6269d17c8cf 52 #define ENABLE_DEMO 1
jah128 0:d6269d17c8cf 53
jah128 0:d6269d17c8cf 54
jah128 0:d6269d17c8cf 55 /* ENABLE_BASIC [1=on, 0=off]: Enable if the Psi-BASIC Interpretter is being used */
jah128 0:d6269d17c8cf 56 #define ENABLE_BASIC 1
jah128 0:d6269d17c8cf 57
jah128 0:d6269d17c8cf 58 /* SERIAL INTERFACES SETTINGS
jah128 0:d6269d17c8cf 59 * __________________________
jah128 0:d6269d17c8cf 60 *
jah128 0:d6269d17c8cf 61 * The Psi-Swarm can communicate using both the USB PC-Serial interface or via Bluetooth using a BlueSMIRF module
jah128 0:d6269d17c8cf 62 *
jah128 0:d6269d17c8cf 63 *
jah128 0:d6269d17c8cf 64 */
jah128 0:d6269d17c8cf 65
jah128 0:d6269d17c8cf 66 /* ENABLE_BLUETOOTH [1=on, 0=off]: Enable if the BlueSmirf module is being used */
jah128 11:312663037b8c 67 /** @brief Enable if the BlueSmirf module is being used. 0=off 1=on*/
jah128 0:d6269d17c8cf 68 #define ENABLE_BLUETOOTH 1
jah128 0:d6269d17c8cf 69
jah128 0:d6269d17c8cf 70 /* ENABLE_PC_SERIAL [1=on, 0=off]: Enable if the PC USB serial module is being used */
jah128 0:d6269d17c8cf 71 #define ENABLE_PC_SERIAL 1
jah128 0:d6269d17c8cf 72
jah128 0:d6269d17c8cf 73 /* BLUETOOTH_BAUD [recommended=115200]: Baud rate for the BlueSMIRF module */
jah128 0:d6269d17c8cf 74 #define BLUETOOTH_BAUD 115200
jah128 0:d6269d17c8cf 75
jah128 0:d6269d17c8cf 76 /* PC_BAUD [recommended=460800 for optimal performance, 115200 for compatability]: Baud rate for the PC USB serial module */
jah128 0:d6269d17c8cf 77 //#define PC_BAUD 460800
jah128 0:d6269d17c8cf 78 #define PC_BAUD 115200
jah128 0:d6269d17c8cf 79
jah128 0:d6269d17c8cf 80 /* DEBUG_MODE [1=on, 0=off]: Enable to allow debug messages to be sent of one of the serial interfaces */
jah128 0:d6269d17c8cf 81 #define DEBUG_MODE 1
jah128 0:d6269d17c8cf 82
jah128 0:d6269d17c8cf 83 /* SHOW_VR_WARNINGS [1=on, 0=off]: Show voltage-regulator debug message warnings after initial boot-up */
jah128 0:d6269d17c8cf 84 #define SHOW_VR_WARNINGS 0
jah128 0:d6269d17c8cf 85
jah128 0:d6269d17c8cf 86 /* USE_LED3_FOR_INTERRUPTS [1=on, 0=off]: Switch interrupts will appear as the lighting of LED3 on MBED */
jah128 0:d6269d17c8cf 87 #define USE_LED3_FOR_INTERRUPTS 1
jah128 0:d6269d17c8cf 88
jah128 0:d6269d17c8cf 89 /* USE_LED4_FOR_VR_WARNINGS [1=on, 0=off]: Voltage-regulator warnings will appear as the lighting of LED4 on MBED */
jah128 0:d6269d17c8cf 90 #define USE_LED4_FOR_VR_WARNINGS 1
jah128 0:d6269d17c8cf 91
jah128 0:d6269d17c8cf 92 /* HALT_ON_GPIO_ERROR [1=on, 0=off]: Halts system if no GPIO response received during init() - typically this happens when MBED is powered but robot is switched off */
jah128 0:d6269d17c8cf 93 #define HALT_ON_GPIO_ERROR 1
jah128 0:d6269d17c8cf 94
jah128 0:d6269d17c8cf 95 /* HALT_ON_ALL_VREGS_LOW [1=on, 0=off]: Halts system when all 3.3V voltage regulators are low on boot-up - typically this happens when MBED is powered but robot is switched off */
jah128 0:d6269d17c8cf 96 #define HALT_ON_ALL_VREGS_LOW 0
jah128 0:d6269d17c8cf 97
jah128 0:d6269d17c8cf 98 /* DEBUG_OUTPUT_STREAM [1=PC\USB 2=BlueSmirf 4=Display]: Specify which output stream(s) should be used by default for debug messages, if enabled*/
jah128 0:d6269d17c8cf 99 #define DEBUG_OUTPUT_STREAM 1
jah128 11:312663037b8c 100
jah128 18:9204f74069b4 101 /* SELF_TEST_PERIOD [recommended = 20000]: Step time (in uS) for the quick self-test in the demo mode*/
jah128 18:9204f74069b4 102 #define SELF_TEST_PERIOD 20000
jah128 15:66be5ec52c3b 103
jah128 15:66be5ec52c3b 104 /* SAMPLE_SIZE [recommended = 10]: Number of samples to take for the quick self-test in the demo mode*/
jah128 15:66be5ec52c3b 105 #define SAMPLE_SIZE 10
jah128 17:bf614e28668f 106
jah128 17:bf614e28668f 107 /* BASE_COLOUR_SENSOR_INTEGRATION_TIME [recommended = 3]: Integration time in mS, shortest is ~2.4mS [3]; see TCS34725 datasheet */
jah128 17:bf614e28668f 108 #define BASE_COLOUR_SENSOR_INTEGRATION_TIME 3
jah128 17:bf614e28668f 109
jah128 17:bf614e28668f 110 /* BASE_COLOUR_SENSOR_GAIN [recommended = 4]: Gain for colour sensor, can be 1,4,16 or 60 */
jah128 17:bf614e28668f 111 #define BASE_COLOUR_SENSOR_GAIN 4
jah128 17:bf614e28668f 112
jah128 19:3e3b03d80ea3 113 /* ENABLE_FIRMWARE_WRITER [1=on,0=off]: Will automatically enter firmware writer mode if no\invalid firmware detected */
jah128 19:3e3b03d80ea3 114 #define ENABLE_FIRMWARE_WRITER 1
jah128 19:3e3b03d80ea3 115
jah128 17:bf614e28668f 116 /* AUTO_UPDATE_FIRMWARE [1=on,0=off]: If an old version of firmware is detected, auto-update to the current version (preserving settings) */
jah128 17:bf614e28668f 117 #define AUTO_UPDATE_FIRMWARE 1
jah128 17:bf614e28668f 118
jah128 17:bf614e28668f 119
jah128 11:312663037b8c 120 #endif
jah128 11:312663037b8c 121