![](/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
Block.cpp@6:98fe30430194, 2015-11-16 (annotated)
- Committer:
- dreamselec
- Date:
- Mon Nov 16 05:10:17 2015 +0000
- Revision:
- 6:98fe30430194
- Child:
- 7:b6e31bfdb2af
Started using class-object structure instead of structs. More control.
New classes: Commander, FPGA, Block, Colour.
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
dreamselec |
6:98fe30430194 | 1 | /* |
dreamselec |
6:98fe30430194 | 2 | * Block.cpp |
dreamselec |
6:98fe30430194 | 3 | * |
dreamselec |
6:98fe30430194 | 4 | * Created on: 16 Nov 2015 |
dreamselec |
6:98fe30430194 | 5 | * Author: chandansiyag |
dreamselec |
6:98fe30430194 | 6 | */ |
dreamselec |
6:98fe30430194 | 7 | |
dreamselec |
6:98fe30430194 | 8 | #include "Block.h" |
dreamselec |
6:98fe30430194 | 9 | |
dreamselec |
6:98fe30430194 | 10 | Block::Block(){ |
dreamselec |
6:98fe30430194 | 11 | size = Size::Small; |
dreamselec |
6:98fe30430194 | 12 | } |
dreamselec |
6:98fe30430194 | 13 | Block::Block(Size size) { |
dreamselec |
6:98fe30430194 | 14 | // TODO Auto-generated constructor stub |
dreamselec |
6:98fe30430194 | 15 | this->size = size; |
dreamselec |
6:98fe30430194 | 16 | } |
dreamselec |
6:98fe30430194 | 17 | |
dreamselec |
6:98fe30430194 | 18 | Block::Block(const Block& rhs){ |
dreamselec |
6:98fe30430194 | 19 | minColour = Colour(rhs.minColour); |
dreamselec |
6:98fe30430194 | 20 | maxColour = Colour(rhs.maxColour); |
dreamselec |
6:98fe30430194 | 21 | size = rhs.size; |
dreamselec |
6:98fe30430194 | 22 | } |
dreamselec |
6:98fe30430194 | 23 | |
dreamselec |
6:98fe30430194 | 24 | Block::~Block() { |
dreamselec |
6:98fe30430194 | 25 | // TODO Auto-generated destructor stub |
dreamselec |
6:98fe30430194 | 26 | } |
dreamselec |
6:98fe30430194 | 27 | |
dreamselec |
6:98fe30430194 | 28 | Colour::Colour(){ |
dreamselec |
6:98fe30430194 | 29 | setRed(0); |
dreamselec |
6:98fe30430194 | 30 | setBlue(0); |
dreamselec |
6:98fe30430194 | 31 | setGreen(0); |
dreamselec |
6:98fe30430194 | 32 | setAlpha(0); |
dreamselec |
6:98fe30430194 | 33 | } |
dreamselec |
6:98fe30430194 | 34 | |
dreamselec |
6:98fe30430194 | 35 | Colour::~Colour(){ |
dreamselec |
6:98fe30430194 | 36 | |
dreamselec |
6:98fe30430194 | 37 | } |
dreamselec |
6:98fe30430194 | 38 | |
dreamselec |
6:98fe30430194 | 39 | Colour::Colour(const Colour& rhs){ |
dreamselec |
6:98fe30430194 | 40 | setRed(rhs.getRed()); |
dreamselec |
6:98fe30430194 | 41 | setBlue(rhs.getBlue()); |
dreamselec |
6:98fe30430194 | 42 | setGreen(rhs.getGreen()); |
dreamselec |
6:98fe30430194 | 43 | setAlpha(rhs.getAlpha()); |
dreamselec |
6:98fe30430194 | 44 | } |