Testprogramm zu den Laborversuchen MPRO an der TH Bingen

Dependencies:   mbed

Committer:
prof_al
Date:
Mon Oct 25 10:14:30 2021 +0000
Revision:
2:a3df98386c21
Parent:
1:9792cfe2330a
Version_1_1

Who changed what in which revision?

UserRevisionLine numberNew contents of line
prof_al 0:146c55884a99 1 /***************************************************************************
prof_al 0:146c55884a99 2 * Titel : main.c
prof_al 0:146c55884a99 3 *
prof_al 0:146c55884a99 4 * Description : MPRO - Basisprogramm
prof_al 0:146c55884a99 5 *
prof_al 0:146c55884a99 6 * Revision List:
prof_al 0:146c55884a99 7 --------------------------------------------------------------------------
prof_al 0:146c55884a99 8 Date | Author | Change
prof_al 0:146c55884a99 9 --------------------------------------------------------------------------
prof_al 0:146c55884a99 10 10.05.21 | J. Altenburg | Ersterstellung
prof_al 0:146c55884a99 11 --------------------------------------------------------------------------
prof_al 1:9792cfe2330a 12 25.10.21 | J. Altenburg | Modifikation für Laborversuch 1 (HAPO WS2021)
prof_al 0:146c55884a99 13 ----------------------------------------------------------------------------
prof_al 0:146c55884a99 14 ****************************************************************************/
prof_al 0:146c55884a99 15 #include "mbed.h"
prof_al 0:146c55884a99 16 #include "cdef.h"
prof_al 0:146c55884a99 17
prof_al 0:146c55884a99 18 /* Vereinbarungen zu den Tasteneingängen */
prof_al 2:a3df98386c21 19 DigitalIn pinSW1(D8);
prof_al 0:146c55884a99 20
prof_al 0:146c55884a99 21 /* Ausgänge als "BUS" konfigurieren */
prof_al 2:a3df98386c21 22 BusOut bLedBus(/*A3,*/ A4, D2, D5, D4, D3);
prof_al 2:a3df98386c21 23
prof_al 2:a3df98386c21 24 /* Ausgänge als Einzelleitung festlegen */
prof_al 0:146c55884a99 25 DigitalOut pinRed1(A3);
prof_al 0:146c55884a99 26
prof_al 0:146c55884a99 27
prof_al 0:146c55884a99 28 /***************************************************************************
prof_al 0:146c55884a99 29 * Defines und Makros
prof_al 0:146c55884a99 30 ***************************************************************************/
prof_al 0:146c55884a99 31
prof_al 0:146c55884a99 32
prof_al 0:146c55884a99 33
prof_al 0:146c55884a99 34 /***************************************************************************
prof_al 0:146c55884a99 35 * Variablen
prof_al 0:146c55884a99 36 ***************************************************************************/
prof_al 0:146c55884a99 37 byte bLocalFoo;
prof_al 0:146c55884a99 38
prof_al 0:146c55884a99 39 /***************************************************************************
prof_al 0:146c55884a99 40 * lokale Funktionen
prof_al 0:146c55884a99 41 ***************************************************************************/
prof_al 0:146c55884a99 42 void vFoo( void ){
prof_al 0:146c55884a99 43 bLocalFoo++;
prof_al 0:146c55884a99 44 }
prof_al 0:146c55884a99 45
prof_al 0:146c55884a99 46
prof_al 0:146c55884a99 47 /***************************************************************************
prof_al 0:146c55884a99 48 * main()
prof_al 0:146c55884a99 49 ***************************************************************************/
prof_al 0:146c55884a99 50 int main() {
prof_al 0:146c55884a99 51 while(1){
prof_al 2:a3df98386c21 52 if(pinSW1 == 0){
prof_al 2:a3df98386c21 53 bLedBus = 0x10;
prof_al 2:a3df98386c21 54 pinRed1 = 0;
prof_al 0:146c55884a99 55 }
prof_al 0:146c55884a99 56 else{
prof_al 2:a3df98386c21 57 bLedBus = 0x00;
prof_al 2:a3df98386c21 58 pinRed1 = 1;
prof_al 0:146c55884a99 59 }
prof_al 0:146c55884a99 60 }
prof_al 0:146c55884a99 61 }
prof_al 0:146c55884a99 62
prof_al 0:146c55884a99 63 /* EOF */