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: SDFileSystem mbed
Fork of PES4_Programme by
source/functions.cpp@23:79638b0e9b16, 2018-03-27 (annotated)
- Committer:
- aeschsim
- Date:
- Tue Mar 27 04:54:57 2018 +0000
- Revision:
- 23:79638b0e9b16
- Parent:
- 22:828b393dff51
- Child:
- 24:da1af5214804
moved s_time to variables.h, made some bug fixes, compiles now. Attention: Someone did some weird changes in setColor, function needs to be rewritten
Who changed what in which revision?
User | Revision | Line number | New 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; |
EHess | 22:828b393dff51 | 8 | } |
itslinear | 17:bbafd216e059 | 9 | |
itslinear | 17:bbafd216e059 | 10 | void setValvePosition(char pos) |
itslinear | 17:bbafd216e059 | 11 | { |
aeschsim | 23:79638b0e9b16 | 12 | switch(pos) { |
aeschsim | 23:79638b0e9b16 | 13 | case 0: // neutrale Position |
aeschsim | 23:79638b0e9b16 | 14 | setPWM(0, 50); |
aeschsim | 23:79638b0e9b16 | 15 | break; |
aeschsim | 23:79638b0e9b16 | 16 | case 1: // Glas |
aeschsim | 23:79638b0e9b16 | 17 | setPWM(0, 100); |
aeschsim | 23:79638b0e9b16 | 18 | break; |
aeschsim | 23:79638b0e9b16 | 19 | case 2: // Auswurf |
aeschsim | 23:79638b0e9b16 | 20 | setPWM(0, 0); |
aeschsim | 23:79638b0e9b16 | 21 | break; |
aeschsim | 23:79638b0e9b16 | 22 | } |
itslinear | 17:bbafd216e059 | 23 | } |
itslinear | 17:bbafd216e059 | 24 | |
aeschsim | 23:79638b0e9b16 | 25 | void setSpeed(char container, char direction) |
aeschsim | 23:79638b0e9b16 | 26 | { |
aeschsim | 23:79638b0e9b16 | 27 | //nur zum kompilieren!! |
aeschsim | 23:79638b0e9b16 | 28 | //setPWM(container,direction); |
aeschsim | 23:79638b0e9b16 | 29 | } |
aeschsim | 12:f28a798d2661 | 30 | |
EHess | 22:828b393dff51 | 31 | |
itslinear | 17:bbafd216e059 | 32 | bool controlPosition(char container) |
itslinear | 17:bbafd216e059 | 33 | { |
itslinear | 17:bbafd216e059 | 34 | return 0; |
itslinear | 17:bbafd216e059 | 35 | } |
itslinear | 17:bbafd216e059 | 36 | int getServoAngle(char container) |
itslinear | 17:bbafd216e059 | 37 | { |
itslinear | 17:bbafd216e059 | 38 | return 0; |
itslinear | 17:bbafd216e059 | 39 | } |