Schulaufgabe Funktionen 21.12.2015

Dependencies:   Bertl mbed

Files at this revision

API Documentation at this revision

Comitter:
Dominik_2000
Date:
Mon Dec 21 14:31:33 2015 +0000
Commit message:
made new functions

Changed in this revision

Bertl.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
diff -r 000000000000 -r eb6611fa99f5 Bertl.lib
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Bertl.lib	Mon Dec 21 14:31:33 2015 +0000
@@ -0,0 +1,1 @@
+https://developer.mbed.org/users/Dominik_2000/code/Bertl/#8bfd7ecd2795
diff -r 000000000000 -r eb6611fa99f5 main.cpp
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/main.cpp	Mon Dec 21 14:31:33 2015 +0000
@@ -0,0 +1,88 @@
+#include "mbed.h"
+#include "const.h"
+#include "Robot.h"
+
+Robot bertl;
+
+void Bewegen()
+{
+    bertl.Move();
+}
+
+void LinksDrehen()
+{
+    bertl.TurnLeft();
+}
+
+void RoteViererLeds(int value)
+{
+    bertl.NibbleLeds(value);
+}
+
+void LedEinschalten(int16_t led)
+{
+    bertl.TurnLedOn(led);
+}
+
+void LedAusschalten(int16_t led)
+{
+    bertl.TurnLedOff(led);
+}
+
+void RotGruenBlauLed(bool red, bool green, bool blue)
+{
+    bertl.RGBLed(red, green, blue);
+}
+
+void BlaueLedsAusschalten()
+{
+    bertl.BlueLedsOFF();
+}
+
+void BlaueLedsEinschalten()
+{
+    bertl.BlueLedsON();
+}
+
+bool WartBisKnopfGedrueckt()
+{
+    return bertl.WaitUntilButtonPressed();
+}
+
+bool IstVorneFrei()
+{
+    return bertl.FrontIsClear();   
+}
+
+bool NebenEinemPipser()
+{
+    return bertl.NextToABeeper();   
+}
+
+bool IstKnopfGedrueckt(const int btn)
+{
+    return bertl.IsButtonPressed(btn);
+}
+
+int GebeGedruektenKnopfZuruek()
+{
+    return bertl.ReturnButtonPressed();
+}
+
+int main() 
+{
+    Bewegen();
+    LinksDrehen();
+    RoteViererLeds(4);
+    LedEinschalten(LED_FR1);
+    LedAusschalten(LED_FR1);
+    RotGruenBlauLed(1, 1, 1);
+    BlaueLedsAusschalten();
+    BlaueLedsEinschalten();
+    WartBisKnopfGedrueckt();
+    IstVorneFrei();
+    NebenEinemPipser();
+    NebenEinemPipser();
+    IstKnopfGedrueckt(BTN_BM);
+    GebeGedruektenKnopfZuruek();
+}
diff -r 000000000000 -r eb6611fa99f5 mbed.bld
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/mbed.bld	Mon Dec 21 14:31:33 2015 +0000
@@ -0,0 +1,1 @@
+http://mbed.org/users/mbed_official/code/mbed/builds/4336505e4b1c
\ No newline at end of file