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.
Dependencies: EthernetInterface HTTPClient_KVplus MbedJSONValue SDFileSystem TextLCD mbed-rtos mbed picojson
libMotiv/Flower.cpp
- Committer:
- TimWoo
- Date:
- 2014-12-07
- Revision:
- 4:8155d4d6a193
- Parent:
- 3:21c8adb97c8f
File content as of revision 4:8155d4d6a193:
#include "Flower.h"
#include <string>
//#include <cstdlib>
Flower::Flower()
:Device(0) {}
Flower::Flower(int id)
:Device(id) {}
Flower::~Flower()
{
}
Flower::Flower(const Flower& f)
{
id = f.getId();
}
Flower& Flower::operator=(const Flower& f)
{
id = f.getId();
return *this;
}
void Flower::setLed(int state)
{}
//This can be in config file later on
//Also, functions with a variable value should be settable
std::string Flower::getCommandDesc(int c)
{
switch(c) {
case fRESET:
return "reset";
break;
case fPETAL_SPD:
return "set petal speed";
break;
case fBLINK_SPD:
return "set blink speed";
break;
// fBLINK_PERIOD = 3,
// fLED_INTENSITY = 4,
// fPETAL_POS = 10,
// fLED_TABLE_FREE = 20,
// fLED_TABLE_RES = 21,
// fLED_FOOD = 22,
// fLED_DRINK = 23,
// fLED_SERVICE = 24,
// fLED_CLR = 29
/* Flower version 2 commands n/a for now.
// fPISTIL_SPD = 3,
// fPETAL1_POS = 11,
// fPETAL2_POS = 12,
// fPETAL3_POS = 13,
// fPETAL4_POS = 14,
// fPETAL5_POS = 15,
// fPETAL6_POS = 16,
// fPISTIL_POS_FOOD = 30,
// fPISTIL_POS_DRINKS = 31,
// fPISTIL_POS_SERVICE = 32 */
case fTABLE_FREE:
return "table free";
break;
case fTABLE_ACTIVE:
return "table active";
break;
case fTABLE_RES:
return "table reserved";
break;
// fTABLE_END = 53,
case fFOOD_ORDERED:
return "food ordered";
break;
//fDRINKS_ORDERED = 55,
// fSERVICE_REQ = 56,
// fPETALS_CLOSE = 60,
// fLAMP_ACT = 100,
case fDEMO1:
return "demo program 1";
break;
// fDEMO2 = 102
}
}