![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
3rd year group project. Electronic and Electrical Engineering. Heriot-Watt University. This is the code for the mbed for the Automatic Little Object Organiser (ALOO).
Dependencies: MCP23017 TCS3472_I2C WattBob_TextLCD mbed
fpga.h@14:cf2f255b5560, 2015-11-22 (annotated)
- Committer:
- dreamselec
- Date:
- Sun Nov 22 17:53:36 2015 +0000
- Revision:
- 14:cf2f255b5560
- Parent:
- 10:16ba52f8e025
- Child:
- 32:9a4046224b11
Changed sorting algorithm for colour sensor next to top beam.
Added filled some commands rather than just printing.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dreamselec |
6:98fe30430194 | 1 | // |
dreamselec |
6:98fe30430194 | 2 | // fpga.h |
dreamselec |
6:98fe30430194 | 3 | // Created by Chandan Siyag on 14/11/2015. |
dreamselec |
6:98fe30430194 | 4 | #include "globals.h" |
dreamselec | 3:843b830ee8bd | 5 | |
dreamselec | 4:4eebb4de22a7 | 6 | #ifndef _fpag_h_ |
dreamselec | 4:4eebb4de22a7 | 7 | #define _fpga_h_ |
dreamselec | 3:843b830ee8bd | 8 | |
dreamselec |
14:cf2f255b5560 | 9 | enum BeamNumber { Top = 2, Bottom = 1 }; |
dreamselec |
14:cf2f255b5560 | 10 | |
dreamselec |
6:98fe30430194 | 11 | class FPGA{ |
dreamselec |
6:98fe30430194 | 12 | public: |
dreamselec |
6:98fe30430194 | 13 | FPGA(); |
dreamselec | 10:16ba52f8e025 | 14 | |
dreamselec | 10:16ba52f8e025 | 15 | SortingServoPositions sortingServoPosition; |
dreamselec | 10:16ba52f8e025 | 16 | StoppingServoPositions stoppingServoPosition; |
dreamselec | 3:843b830ee8bd | 17 | |
dreamselec |
6:98fe30430194 | 18 | int checkForBlock(); |
dreamselec |
6:98fe30430194 | 19 | int checkForSize(); |
dreamselec |
6:98fe30430194 | 20 | |
dreamselec |
6:98fe30430194 | 21 | void moveStoppingServo(StoppingServoPositions position); |
dreamselec |
6:98fe30430194 | 22 | void moveSortingServo(SortingServoPositions position); |
dreamselec | 10:16ba52f8e025 | 23 | void toggleStoppingServo(); |
dreamselec | 10:16ba52f8e025 | 24 | void toggleSortingServo(); |
dreamselec | 3:843b830ee8bd | 25 | |
dreamselec |
6:98fe30430194 | 26 | void resetStoppingServo(); |
dreamselec |
6:98fe30430194 | 27 | void resetSortingServo(); |
dreamselec |
6:98fe30430194 | 28 | void resetAllServos(); |
dreamselec | 3:843b830ee8bd | 29 | |
dreamselec |
14:cf2f255b5560 | 30 | virtual ~FPGA(); |
dreamselec |
14:cf2f255b5560 | 31 | |
dreamselec |
6:98fe30430194 | 32 | int getBeamValue(int beamNumber); |
dreamselec |
6:98fe30430194 | 33 | void moveServo(int servoNumber, int position); |
dreamselec |
6:98fe30430194 | 34 | }; |
dreamselec |
6:98fe30430194 | 35 | #endif |