SEARCH
TOOLBOX
LANGUAGES
modified on 17 September 2014 at 18:03 ••• 93,921 views

03-02 FlashingLEDspleLED

From Manuals

(Difference between revisions)
Jump to: navigation, search
Line 1: Line 1:
-
Alternately flashes LEDs connected to pins D0 and D1 on connector J9. Please see schematic below for further details.
+
Alternately flashes LEDs connected to pins D0 and D1 on connector J9 of the BAM210. Please see schematic below for further details.
 +
 
 +
[[Image:BAM210_03_02_SCH.png|center|alt=BAM210|frame|<div align="center">'''Schematic for example 03-02''']]
 +
 
 +
The following image shows the built circuit.
 +
[[Image:BAM210_flashLED.jpeg|center|]]
  /*Program Example 3.2: Flashes red and green LEDs in simple time-based pattern
  /*Program Example 3.2: Flashes red and green LEDs in simple time-based pattern
Line 18: Line 23:
     }
     }
  }
  }
-
 
-
[[Image:BAM210_flashLED.jpeg|center|]]
 
-
 
-
 
-
[[Image:BAM210_03_02_SCH.png|center|alt=BAM210|frame|<div align="center">'''Schematic for example 03-02''']]
 

Revision as of 15:19, 17 September 2014

Alternately flashes LEDs connected to pins D0 and D1 on connector J9 of the BAM210. Please see schematic below for further details.

BAM210
Schematic for example 03-02

The following image shows the built circuit.

/*Program Example 3.2: Flashes red and green LEDs in simple time-based pattern
                                            */
#include "mbed.h"
DigitalOut redled(D0);     //define and name a digital output on pin D0
DigitalOut greenled(D1);   //define and name a digital output on pin D1

int main()
{
    while(1) {
        redled = 1;
        greenled = 0;
        wait(0.2);
        redled = 0;
        greenled = 1;
        wait(0.2);
    }
}