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.
main.cpp
- Committer:
- aronbrun
- Date:
- 2020-02-18
- Revision:
- 7:179e4f3a0c12
- Parent:
- 5:522c5a0a51d3
- Child:
- 8:18d4824c5a92
File content as of revision 7:179e4f3a0c12:
/** Mittels DigitalOut kann eine Positive Spannung an einem Pin erzeugt werden.
*/
#include "mbed.h"
DigitalOut led1( MBED_CONF_IOTKIT_LED1 );
DigitalOut led2( MBED_CONF_IOTKIT_LED2 );
DigitalOut led3( MBED_CONF_IOTKIT_LED3 );
DigitalOut led4( MBED_CONF_IOTKIT_LED4 );
// optimiert float statt double wenn ohne "f"
float warte = 2.0f;
int main()
{
while(1)
{
// kurze Schreibweise, operator= ist ueberschrieben
led1 = 1;
led2 = 0;
led3 = 0;
led4 = 0;
wait( warte );
// Aufruf der Methode
led1.write( 0 );
led2.write( 1 );
led3.write( 0 );
led4.write( 0 );
wait( warte );
led1 = 0;
led2 = 0;
led3 = 1;
led4 = 0;
wait( warte );
led1 = 0;
led2 = 0;
led3 = 0;
led4 = 1;
wait( warte );
}
}