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: mbed
Fork of FernsehSimulator by
main.cpp
- Committer:
- marcel1691
- Date:
- 2016-04-08
- Revision:
- 4:f6840272e341
- Parent:
- 3:e612c5f0c23d
File content as of revision 4:f6840272e341:
/** Zahlfallszahlen erzeugen und damit Fernsehsimulator fuettern
*/
#include "mbed.h"
#include <time.h>
DigitalOut led[] = { DigitalOut( D10 ), DigitalOut( D11 ), DigitalOut( D12 ), DigitalOut( D13 ) };
AnalogIn poti( A0 );
int main()
{
printf( "Fernsehsimulator\n" );
time_t t;
time(&t);
srand( (unsigned int)t ); /* Zufallsgenerator initialisieren */
while ( 1 )
{
for ( int i = 0; i < 4; i++ )
{
int r = rand();
led[i] = ( (r % (i+2) ) != 0 ) ? 1 : 0;
}
wait( poti.read() );
}
}
