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
- Committer:
- cittecla
- Date:
- 2018-03-27
- Revision:
- 38:5bbf548e6872
- Parent:
- 30:44475cc82016
- Child:
- 45:4359c9efc134
File content as of revision 38:5bbf548e6872:
#include "functions.h" void setLED(char button, uint32_t color) { float red = ((color >> 16) & 0xff)/2.55; float green = ((color >> 8) & 0xff)/2.55; float blue = (color & 0xff)/2.55; /* PWM channel 10-15, Button is 0 or 1 * -> if Button = 0, set Channel 10,11,12 * -> if Button = 1, set Channel 13,14,15 */ setPWM(10+(3*button) , red); setPWM(10+(3*button)+1 , green); setPWM(10+(3*button)+2 , blue); } void setValvePosition(char pos) { switch(pos) { case 0: // neutrale Position setPWM(0, 50); break; case 1: // Glas setPWM(0, 100); break; case 2: // Auswurf setPWM(0, 0); break; } } void setSpeed(char container, char direction) { } bool controlPosition(char container) { return 0; } int getServoAngle(char container) { return 0; }