PES 4 - Smart Medication Dispenser / PES4_ProgrammeforDesignReview2

Dependencies:   SDFileSystem mbed

Fork of PES4_Programme by PES 4 - Smart Medication Dispenser

Committer:
cittecla
Date:
Tue Mar 27 12:08:09 2018 +0000
Revision:
38:5bbf548e6872
Parent:
30:44475cc82016
Child:
45:4359c9efc134
unified button names 0-1,; fixed typos.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
aeschsim 8:6ece7caefb33 1 #include "functions.h"
aeschsim 8:6ece7caefb33 2
cittecla 11:e8a7a4a9af05 3 void setLED(char button, uint32_t color)
cittecla 11:e8a7a4a9af05 4 {
cittecla 11:e8a7a4a9af05 5 float red = ((color >> 16) & 0xff)/2.55;
cittecla 11:e8a7a4a9af05 6 float green = ((color >> 8) & 0xff)/2.55;
cittecla 11:e8a7a4a9af05 7 float blue = (color & 0xff)/2.55;
aeschsim 24:da1af5214804 8
cittecla 38:5bbf548e6872 9 /* PWM channel 10-15, Button is 0 or 1
cittecla 38:5bbf548e6872 10 * -> if Button = 0, set Channel 10,11,12
cittecla 38:5bbf548e6872 11 * -> if Button = 1, set Channel 13,14,15
aeschsim 24:da1af5214804 12 */
aeschsim 24:da1af5214804 13
cittecla 38:5bbf548e6872 14 setPWM(10+(3*button) , red);
cittecla 38:5bbf548e6872 15 setPWM(10+(3*button)+1 , green);
cittecla 38:5bbf548e6872 16 setPWM(10+(3*button)+2 , blue);
aeschsim 24:da1af5214804 17
EHess 22:828b393dff51 18 }
itslinear 17:bbafd216e059 19
aeschsim 24:da1af5214804 20
itslinear 17:bbafd216e059 21 void setValvePosition(char pos)
itslinear 17:bbafd216e059 22 {
aeschsim 23:79638b0e9b16 23 switch(pos) {
aeschsim 23:79638b0e9b16 24 case 0: // neutrale Position
aeschsim 23:79638b0e9b16 25 setPWM(0, 50);
aeschsim 23:79638b0e9b16 26 break;
aeschsim 23:79638b0e9b16 27 case 1: // Glas
aeschsim 23:79638b0e9b16 28 setPWM(0, 100);
aeschsim 23:79638b0e9b16 29 break;
aeschsim 23:79638b0e9b16 30 case 2: // Auswurf
aeschsim 23:79638b0e9b16 31 setPWM(0, 0);
aeschsim 23:79638b0e9b16 32 break;
aeschsim 23:79638b0e9b16 33 }
itslinear 17:bbafd216e059 34 }
itslinear 17:bbafd216e059 35
aeschsim 23:79638b0e9b16 36 void setSpeed(char container, char direction)
aeschsim 23:79638b0e9b16 37 {
aeschsim 23:79638b0e9b16 38 }
aeschsim 12:f28a798d2661 39
EHess 22:828b393dff51 40
itslinear 17:bbafd216e059 41 bool controlPosition(char container)
itslinear 17:bbafd216e059 42 {
itslinear 17:bbafd216e059 43 return 0;
itslinear 17:bbafd216e059 44 }
itslinear 17:bbafd216e059 45 int getServoAngle(char container)
itslinear 17:bbafd216e059 46 {
itslinear 17:bbafd216e059 47 return 0;
itslinear 17:bbafd216e059 48 }