Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Fork of _B15Test1 by
Revision 2:040855fee6fa, committed 2015-05-27
- Comitter:
- Enenkel
- Date:
- Wed May 27 21:29:10 2015 +0000
- Parent:
- 1:628da1b465a4
- Commit message:
- 3V7 & 3V3 ON -> LED & Taster Test
Changed in this revision
main.cpp | Show annotated file Show diff for this revision Revisions of this file |
diff -r 628da1b465a4 -r 040855fee6fa main.cpp --- a/main.cpp Wed May 27 07:41:01 2015 +0000 +++ b/main.cpp Wed May 27 21:29:10 2015 +0000 @@ -4,34 +4,31 @@ description: D1_D4 Lauflicht ***********************************/ - #include "mbed.h" -DigitalOut LedD10 (P1_8); // LED D10 bis D13 IO Definieren +// 3,3 und 3,7V Schiene +DigitalOut LedD10 (P1_8); // LED D10 bis D13 IO Definieren DigitalOut LedD11 (P1_9); DigitalOut LedD12 (P1_10); DigitalOut LedD13 (P1_11); -DigitalOut LedRT (P1_24); //RGB LED -DigitalOut LedGR (P1_23); // -DigitalOut LedBL (P1_22); // + +I2C i2c(p28, p27); // die Adressen des I2C Busses am uP + // p28 -> SDA + // p27 -> SCL -DigitalOut Von (P1_2); -I2C i2c(p28, p27); // die Adressen des I2C Busses am uP - // p28 -> SDA - // p27 -> SCL +// 5V Schiene & Motor Spannung + DigitalOut Von (P1_2); // SPANNUNG 10V & 5V +// DigitalOut LedBLUE(P1_28); // Blaue LED unter dem B15 +// DigitalOut LedBL (P1_24); // RGB LED +// DigitalOut LedGR (P1_25); // +// DigitalOut LedRT (P1_23); // RT -void RT(); -void BL(); -void GR(); -void WS(); - -void count(); -void LedSt(); double counter1; int a; int main() { + Von=0; // muss 0 sein, sonst leuchtet RGB !!! a=1; char btn = 0; // **** Config PCA9555 I0 as output ******* @@ -41,19 +38,28 @@ i2c.write(0x06); // Befehl für das IO Port 0 -> siehe SCHEMA des PCA9555 i2c.write(0x00); // Schalte alle Pins des Ports als OUTPUT i2c.stop(); - - - LedRT=1; - wait (1); - LedRT=0; - LedGR=1; - wait (1); - LedGR=0; - LedBL=1; - wait (1); - LedBL=0; - - + + // D10-D13 Lauflicht + a=0; + while (a<4) + { + LedD10=1; + wait (0.5); + LedD10=0; + LedD11=1; + wait (0.5); + LedD11=0; + LedD12=1; + wait (0.5); + LedD12=0; + LedD13=1; + wait (0.5); + LedD13=!LedD13; + a=a++; + } + + + //Taster und LED Test while(1) { counter1=1; @@ -80,66 +86,5 @@ i2c.write(~btn); // schriebn auf Port 0 den INVERSEN Wert von btn i2c.stop(); } - if (a==1) - { - RT(); - } - if (a==2) - { - GR(); - } - - - - a=a++; - if (a==4) { - a=1; - } - - } -} -/************************** ***********************/ -void RT() - { - LedD10=1; - LedD11=LedD12=LedD13=0; - LedRT=1; - LedGR=LedBL=0; - } - -void GR() - { - - } - - - - -void count() - { - a=1; - counter1=counter1++; - a=a++; - if(a ==5) { - - a=0; - } - - - -/* - if(counter1 > 10000) - { - count= 0; - if(LedD10 = 1) - { - LedD10=0; - LedD11=1; - } - if (LedD12=1) - { - LedD11=0; - } - } - */ - } \ No newline at end of file + } + } \ No newline at end of file