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:
- itslinear
- Date:
- 2018-03-27
- Revision:
- 30:44475cc82016
- Parent:
- 24:da1af5214804
- Child:
- 38:5bbf548e6872
File content as of revision 30:44475cc82016:
#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 9-15, Button is 1 or 2 * -> if Button = 1, set Channel 10,11,12 * -> if Button = 2, set Channel 13,14,15 */ setPWM(7+(3*button) , red); setPWM(7+(3*button)+1 , green); setPWM(7+(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; }