PES 4 - Smart Medication Dispenser / PES4_ProgrammeforDesignReview2

Dependencies:   SDFileSystem mbed

Fork of PES4_Programme by PES 4 - Smart Medication Dispenser

Committer:
aeschsim
Date:
Tue Mar 27 05:07:50 2018 +0000
Revision:
24:da1af5214804
Parent:
23:79638b0e9b16
Child:
30:44475cc82016
fixed setLED function, added some comments, added pin-out list in main.h

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
aeschsim 24:da1af5214804 9 /* PWM channel 9-15, Button is 1 or 2
aeschsim 24:da1af5214804 10 * -> if Button = 1, set Channel 9,10,11
aeschsim 24:da1af5214804 11 * -> if Button = 2, set Channel 12,13,14
aeschsim 24:da1af5214804 12 */
aeschsim 24:da1af5214804 13
aeschsim 24:da1af5214804 14 setPWM(6+(3*button) , red);
aeschsim 24:da1af5214804 15 setPWM(6+(3*button)+1 , green);
aeschsim 24:da1af5214804 16 setPWM(6+(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 }