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.
Revision 0:af250f67026d, committed 2018-11-15
- Comitter:
- martwerl
- Date:
- Thu Nov 15 18:18:44 2018 +0000
- Commit message:
- TINF_mbedSimulator_LedBlink
Changed in this revision
| mbed.bld | Show annotated file Show diff for this revision Revisions of this file |
| mbedSimulator_LedBlink.cpp | Show annotated file Show diff for this revision Revisions of this file |
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mbed.bld Thu Nov 15 18:18:44 2018 +0000 @@ -0,0 +1,1 @@ +https://os.mbed.com/users/mbed_official/code/mbed/builds/5aab5a7997ee \ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/mbedSimulator_LedBlink.cpp Thu Nov 15 18:18:44 2018 +0000
@@ -0,0 +1,55 @@
+#include "mbed.h"
+
+
+class MyLed
+{
+ public:
+ MyLed(PinName pin) : _pin(pin)
+ {
+ //Initialisierungsliste
+ _pin = 0;
+ }
+ void ledon(void)
+ {
+ _pin = 1;
+ }
+
+ void ledoff(void)
+ {
+ _pin = 0;
+ }
+ void printStatus(void)
+ {
+ printf("LED ist jetzt: %d\n", _pin.read());
+ }
+ private:
+ DigitalOut _pin;
+ };
+
+
+DigitalOut led(LED1);
+MyLed myled2(LED2);//Instanzierung des Objekts
+MyLed myled5(p5);
+
+
+
+
+
+int main()
+{
+ while (1)
+ {
+ myled2.ledon();
+ myled2.printStatus();
+ myled5.ledon();
+ myled5.printStatus();
+ wait_ms(500);
+ myled2.ledoff();
+ myled2.printStatus();
+ myled5.ledoff();
+ myled5.printStatus();
+ wait_ms(500);
+
+
+ }
+}