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.
Fork of _Lektion_05 by
main.cpp
- Committer:
- Enenkel
- Date:
- 2015-03-09
- Revision:
- 0:56dbb8ec442b
File content as of revision 0:56dbb8ec442b:
// HIMBED _lektion05 int double
// HTL BULME Graz by Enenkel 26.2.2014
// Da findet ihr mehr Info über C++ http://www.cplusplus.com/doc/tutorial/program_structure/
// Aufgabe:
// Erstelle ev. mit Hilfe von Bitschieben (Lektion 2) einen Punkt,
// der über die 12 LED huscht, und dabei immer schneller wird.
// Der Punkt soll 5 x über die LED huschen.
// Erst nach drücken der Reset Taste soll das Programm erneut starten.
#include "mbed.h"
DigitalOut led(LED1);
int i;
double x;
int main() {
i=1;
x=0.1;
while(i<=25) {
led = 1;
wait(x);
led = 0;
wait(x);
i++; // i=i+1
x=x*1.1; // Zeit x verlängern
}
}
// ACHTUNG der M0 führt die Software 2x aus,
// dies obwohl er sie nur einmal ausführen sollte!
// liegt vermutlich am Compiler.....
