Aufgabe Codeschloss Programmrumpf

Dependencies:   LCD_i2c_GSOE

Committer:
jack1930
Date:
Fri Oct 30 16:40:12 2020 +0000
Revision:
0:0e7984c29a82
Aufgabe Codeschloss

Who changed what in which revision?

UserRevisionLine numberNew contents of line
jack1930 0:0e7984c29a82 1 /* mbed Microcontroller Library
jack1930 0:0e7984c29a82 2 * Copyright (c) 2019 ARM Limited
jack1930 0:0e7984c29a82 3 * SPDX-License-Identifier: Apache-2.0
jack1930 0:0e7984c29a82 4 */
jack1930 0:0e7984c29a82 5
jack1930 0:0e7984c29a82 6 #include "mbed.h"
jack1930 0:0e7984c29a82 7 #include "platform/mbed_thread.h"
jack1930 0:0e7984c29a82 8
jack1930 0:0e7984c29a82 9 InterruptIn s(PA_1);
jack1930 0:0e7984c29a82 10 InterruptIn takt(PA_6);
jack1930 0:0e7984c29a82 11
jack1930 0:0e7984c29a82 12 PortOut anzeige(PortC,0x7F);
jack1930 0:0e7984c29a82 13 DigitalOut freigabe(PC_7);
jack1930 0:0e7984c29a82 14 DigitalOut seg7On(PC_15);
jack1930 0:0e7984c29a82 15
jack1930 0:0e7984c29a82 16 int zustand=0;
jack1930 0:0e7984c29a82 17 int nr=0;
jack1930 0:0e7984c29a82 18 int seg7[10]={0b00111111, 0b00000110, 0b01011011, 0b01001111, 0b01100110,
jack1930 0:0e7984c29a82 19 0b01101101, 0b01111101, 0b00000111, 0b01111111, 0b01101111};
jack1930 0:0e7984c29a82 20
jack1930 0:0e7984c29a82 21 void hoch()
jack1930 0:0e7984c29a82 22 {
jack1930 0:0e7984c29a82 23 //Ihr Code Aufgabe 1
jack1930 0:0e7984c29a82 24 }
jack1930 0:0e7984c29a82 25
jack1930 0:0e7984c29a82 26 void weiter()
jack1930 0:0e7984c29a82 27 {
jack1930 0:0e7984c29a82 28 //Ihr Code Aufgabe 2
jack1930 0:0e7984c29a82 29 }
jack1930 0:0e7984c29a82 30
jack1930 0:0e7984c29a82 31
jack1930 0:0e7984c29a82 32 void init(void)
jack1930 0:0e7984c29a82 33 {
jack1930 0:0e7984c29a82 34 s.mode(PullDown);
jack1930 0:0e7984c29a82 35 takt.mode(PullDown);
jack1930 0:0e7984c29a82 36 s.rise(&hoch);
jack1930 0:0e7984c29a82 37 takt.rise(&weiter);
jack1930 0:0e7984c29a82 38 freigabe=0;
jack1930 0:0e7984c29a82 39 seg7On=1;
jack1930 0:0e7984c29a82 40 }
jack1930 0:0e7984c29a82 41
jack1930 0:0e7984c29a82 42 int main()
jack1930 0:0e7984c29a82 43 {
jack1930 0:0e7984c29a82 44 init();
jack1930 0:0e7984c29a82 45 while (true) {
jack1930 0:0e7984c29a82 46 //Ihr Code Aufgabe 2
jack1930 0:0e7984c29a82 47 }
jack1930 0:0e7984c29a82 48 }