pl02

Committer:
cbaxte16
Date:
Tue Feb 23 14:35:55 2021 +0000
Revision:
0:6f2271b58851
okay

Who changed what in which revision?

UserRevisionLine numberNew contents of line
cbaxte16 0:6f2271b58851 1 /* mbed Microcontroller Library
cbaxte16 0:6f2271b58851 2 * Copyright (c) 2019 ARM Limited
cbaxte16 0:6f2271b58851 3 * SPDX-License-Identifier: Apache-2.0
cbaxte16 0:6f2271b58851 4 */
cbaxte16 0:6f2271b58851 5
cbaxte16 0:6f2271b58851 6 #include "mbed.h" //CGB
cbaxte16 0:6f2271b58851 7 #include <iostream>
cbaxte16 0:6f2271b58851 8
cbaxte16 0:6f2271b58851 9 // Blinking rate in milliseconds
cbaxte16 0:6f2271b58851 10
cbaxte16 0:6f2271b58851 11 extern "C" void delay_asm(void);
cbaxte16 0:6f2271b58851 12
cbaxte16 0:6f2271b58851 13 int main()
cbaxte16 0:6f2271b58851 14
cbaxte16 0:6f2271b58851 15 {
cbaxte16 0:6f2271b58851 16 set_time(0);
cbaxte16 0:6f2271b58851 17
cbaxte16 0:6f2271b58851 18 time_t seconds = time(NULL);
cbaxte16 0:6f2271b58851 19 // Initialise the digital pin LED1 as an output
cbaxte16 0:6f2271b58851 20 DigitalOut led(LED1);
cbaxte16 0:6f2271b58851 21
cbaxte16 0:6f2271b58851 22 while (true) {
cbaxte16 0:6f2271b58851 23
cbaxte16 0:6f2271b58851 24 delay_asm();
cbaxte16 0:6f2271b58851 25 cout << seconds << "**\n\r";
cbaxte16 0:6f2271b58851 26
cbaxte16 0:6f2271b58851 27 }
cbaxte16 0:6f2271b58851 28 }