RGB Ampel

Dependencies:   mbed

Fork of _B14_Lektion05b by BULME_BERTL14

main.cpp

Committer:
Enenkel
Date:
2014-11-13
Revision:
0:c2a3df878b8a
Child:
1:b94490b97a6a

File content as of revision 0:c2a3df878b8a:

/***********************************
name:   BERTL_2014_TEST
author: Gottfried Enenkel   HTL BULME
email:  ene@bulme.at
description:
    3 Blaue LEDs ON
    Die RGB LED leuchtet  rot grün blau 
    je 1 sec
***********************************/
#include "mbed.h"
// ************ DEKLARATIONEN **************
DigitalOut LED_blue(P1_28);    // Alle Blauen LED gehen auf einen Anschluß
                               // P1..Port1 _28 Anschluß 28     
DigitalOut RGB_bl(P1_24);      // BLAU    
                               // am uP -> P1..Port1 
                               //       -> 24..IO Anschluss 24 
DigitalOut RGB_rt(P1_23);      // ROT        
DigitalOut RGB_gr(P1_25);      // GRÜN P26 geht zum uP Port P1_25 

// ************  HAUPT PROGRAMM **************
int main() {
    RGB_bl=1;  //blau  AUS
    RGB_rt=1;  //rot 
    RGB_gr=1;  //grün
    
    while(1) {
        LED_blue=1;  //blaue LED AUS! 
        wait(1);
        LED_blue=0;  //blaue LED EIN
        RGB_bl=0;    //blau
        wait(1);
        RGB_bl=1;
        RGB_gr=0;    //grün
        wait(1);
        RGB_gr=1;
        RGB_rt=0;    //rot
        wait(1);
        RGB_rt=1;
        wait(1);
    }
 }
 
 // *****************  ENDE  ********************