![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
test
main.cpp
- Committer:
- davyu
- Date:
- 2017-10-05
- Revision:
- 0:5ec2204f1886
- Child:
- 1:94986ca0db0a
File content as of revision 0:5ec2204f1886:
// For NuMaker-PFM-NUC472 GPIO pins connected to rgbled, green led, buzzer #include "mbed.h" Serial pc(USBTX, USBRX); // tx, rx DigitalOut rgbled_B(PD_8); // low-active DigitalOut rgbled_R(PD_9); // low-active DigitalOut rgbled_G(PA_4); // low-active // main() runs in its own thread in the OS // (note the calls to Thread::wait below for d elays) int main() { rgbled_R=1;rgbled_G=1;rgbled_B=1; while (true) { rgbled_R=0; rgbled_G=1; rgbled_B=1; wait(1); rgbled_R=1; rgbled_G=0; rgbled_B=1; wait(1); rgbled_R=1; rgbled_G=1; rgbled_B=0; wait(1); pc.printf("Hello World!\n"); } }