Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of PsiSwarmLibrary by
sensors.h@6:b340a527add9, 2016-10-15 (annotated)
- Committer:
- jah128
- Date:
- Sat Oct 15 13:51:39 2016 +0000
- Revision:
- 6:b340a527add9
- Parent:
- 5:3cdd1a37cdd7
Added Apache license to files
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
jah128 | 0:d6269d17c8cf | 1 | /* University of York Robotics Laboratory PsiSwarm Library: Sensor Functions Header File |
jah128 | 0:d6269d17c8cf | 2 | * |
jah128 | 6:b340a527add9 | 3 | * Copyright 2016 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: sensors.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 | 5:3cdd1a37cdd7 | 16 | * PsiSwarm Library Version: 0.7 |
jah128 | 0:d6269d17c8cf | 17 | * |
jah128 | 5:3cdd1a37cdd7 | 18 | * October 2016 |
jah128 | 0:d6269d17c8cf | 19 | * |
jah128 | 0:d6269d17c8cf | 20 | */ |
jah128 | 0:d6269d17c8cf | 21 | |
jah128 | 0:d6269d17c8cf | 22 | #ifndef SENSORS_H |
jah128 | 0:d6269d17c8cf | 23 | #define SENSORS_H |
jah128 | 0:d6269d17c8cf | 24 | |
jah128 | 0:d6269d17c8cf | 25 | float get_battery_voltage ( void ); |
jah128 | 0:d6269d17c8cf | 26 | float get_current ( void ); |
jah128 | 0:d6269d17c8cf | 27 | float get_dc_voltage ( void ); |
jah128 | 0:d6269d17c8cf | 28 | |
jah128 | 0:d6269d17c8cf | 29 | float get_temperature ( void ); |
jah128 | 0:d6269d17c8cf | 30 | void enable_ultrasonic_ticker( void ); |
jah128 | 0:d6269d17c8cf | 31 | void disable_ultrasonic_ticker( void ); |
jah128 | 0:d6269d17c8cf | 32 | void update_ultrasonic_measure ( void ); |
jah128 | 0:d6269d17c8cf | 33 | void IF_read_ultrasonic_measure ( void ); |
jah128 | 0:d6269d17c8cf | 34 | float read_reflected_ir_distance ( char index ); |
jah128 | 0:d6269d17c8cf | 35 | float get_reflected_ir_distance ( char index ); |
jah128 | 0:d6269d17c8cf | 36 | unsigned short get_background_raw_ir_value ( char index ); |
jah128 | 0:d6269d17c8cf | 37 | unsigned short get_illuminated_raw_ir_value ( char index ); |
jah128 | 0:d6269d17c8cf | 38 | void store_reflected_ir_distances ( void ); |
jah128 | 0:d6269d17c8cf | 39 | void store_background_raw_ir_values ( void ); |
jah128 | 0:d6269d17c8cf | 40 | void store_illuminated_raw_ir_values ( void ); |
jah128 | 0:d6269d17c8cf | 41 | float calculate_reflected_distance ( unsigned short background_value, unsigned short illuminated_value ); |
jah128 | 0:d6269d17c8cf | 42 | unsigned short read_illuminated_raw_ir_value ( char index ) ; |
jah128 | 0:d6269d17c8cf | 43 | |
jah128 | 0:d6269d17c8cf | 44 | unsigned short get_background_base_ir_value ( char index ); |
jah128 | 0:d6269d17c8cf | 45 | unsigned short get_illuminated_base_ir_value ( char index ); |
jah128 | 2:c6986ee3c7c5 | 46 | unsigned short calculate_base_ir_value ( char index ); |
jah128 | 2:c6986ee3c7c5 | 47 | unsigned short calculate_side_ir_value ( char index ); |
jah128 | 0:d6269d17c8cf | 48 | |
jah128 | 0:d6269d17c8cf | 49 | int get_bearing_from_ir_array ( unsigned short * ir_sensor_readings); |
jah128 | 0:d6269d17c8cf | 50 | void store_ir_values ( void ); |
jah128 | 0:d6269d17c8cf | 51 | void store_base_ir_values ( void ); |
jah128 | 0:d6269d17c8cf | 52 | void store_background_base_ir_values ( void ); |
jah128 | 0:d6269d17c8cf | 53 | void store_illuminated_base_ir_values ( void ); |
jah128 | 0:d6269d17c8cf | 54 | |
jah128 | 0:d6269d17c8cf | 55 | void store_line_position ( void ); |
jah128 | 0:d6269d17c8cf | 56 | void calibrate_base_ir_sensors ( void ); |
jah128 | 0:d6269d17c8cf | 57 | |
jah128 | 0:d6269d17c8cf | 58 | #endif |