The example program for mbed pin-compatible platforms

Committer:
bosko001
Date:
Thu Feb 06 21:01:26 2020 +0000
Revision:
25:966cef6183e9
Parent:
24:7f14b70fc9ef
copy

Who changed what in which revision?

UserRevisionLine numberNew contents of line
dan 0:7dec7e9ac085 1 #include "mbed.h"
dan 0:7dec7e9ac085 2
bosko001 25:966cef6183e9 3
bosko001 25:966cef6183e9 4
bosko001 25:966cef6183e9 5 DigitalOut RedLed(LED1);
bosko001 25:966cef6183e9 6 DigitalOut GreenLed(LED2);
bosko001 25:966cef6183e9 7 DigitalOut BlueLed(LED3);
bosko001 25:966cef6183e9 8 int main() {
dan 0:7dec7e9ac085 9
bosko001 25:966cef6183e9 10 Serial pc(USBTX, USBRX); // tx, rx
bosko001 25:966cef6183e9 11
bosko001 25:966cef6183e9 12
bosko001 25:966cef6183e9 13
bosko001 25:966cef6183e9 14
bosko001 25:966cef6183e9 15 RedLed =1;
bosko001 25:966cef6183e9 16 GreenLed = 1;
bosko001 25:966cef6183e9 17 BlueLed = 1;
bosko001 25:966cef6183e9 18
dan 0:7dec7e9ac085 19 while(1) {
bosko001 25:966cef6183e9 20
bosko001 25:966cef6183e9 21 pc.printf("Hello World!\n\r");
bosko001 25:966cef6183e9 22
bosko001 25:966cef6183e9 23
bosko001 25:966cef6183e9 24 RedLed = 0;
bosko001 25:966cef6183e9 25 wait(0.5);
bosko001 25:966cef6183e9 26 RedLed = 1;
bosko001 25:966cef6183e9 27 wait(1);
bosko001 25:966cef6183e9 28
bosko001 25:966cef6183e9 29 GreenLed=0;
bosko001 25:966cef6183e9 30 wait(2);
bosko001 25:966cef6183e9 31 GreenLed=1;
bosko001 25:966cef6183e9 32 wait(1);
bosko001 25:966cef6183e9 33
bosko001 25:966cef6183e9 34 BlueLed = 0;
bosko001 25:966cef6183e9 35 wait(0.5);
bosko001 25:966cef6183e9 36 BlueLed = 1;
bosko001 25:966cef6183e9 37 wait(1);
stevep 4:81cea7a352b0 38 }
dan 0:7dec7e9ac085 39 }