Basic LED Demo for nexpaq development kit

Dependencies:   nexpaq_mdk

Fork of LED_Demo by Maxim nexpaq

LED Demo

MAX32625NEXPAQ development module

This project is a demonstration application for the MAX32625NEXPAQ development module. You will need the nexpaq application and a compatible phone to run this demo. This project demonstrates sending button information back to the application running on the phone, and the phone controlling the on board RGB LED.

Go to the nexpaq developers hub for details on how to load the code for the tile into the application.

Resources

Revision:
2:3842948024ca
Parent:
0:b86eda0e990d
Child:
3:9d15891f9352
--- a/main.cpp	Sat Sep 17 16:32:05 2016 +0000
+++ b/main.cpp	Mon Sep 19 09:06:46 2016 +0000
@@ -1,6 +1,13 @@
 #include "mbed.h"
 #include "nexpaq_mdk.h"
 
+#ifdef __cplusplus
+extern "C" {
+#endif
+extern volatile uint8_t flag_jump_bsl;
+#ifdef __cplusplus
+}
+#endif
 DigitalOut ledR(P2_4, LED_OFF);
 DigitalOut ledG(P2_5, LED_OFF);
 DigitalOut ledB(P2_6, LED_OFF);
@@ -67,14 +74,54 @@
 }
 
 int main(void){
+	
+	uint32_t cnt, i;
+	
+	cnt = 500;
+	ledR = 1;
+	ledG = 0;
+	ledB = 1;
+
 	np_api_init();
 	app_setup();
 	np_api_start();	
+	//Thread::wait(5000);
 	while(1){
 		app_loop();	
 		np_api_bsl_chk();
     	Thread::wait(50);
+    	
+    	if (cnt) {
+    		cnt--;
+			if (cnt == 0) {
+				ledR = 1;
+				ledG = 1;
+				ledB = 1;	
+				Thread::wait(50);
+				cnt = 1000;	
+				//NVIC_SystemReset();
+			}
+		}
+		
+		i = cnt%30;
+		if (i == 10)
+		{
+			ledR = 1;
+			ledG = 1;
+			ledB = 1;
+		}
+		else if (i == 20){
+			ledR = 1;
+			ledG = 0;
+			ledB = 1;	
+		}
+		else if (i == 0) {
+			ledR = 1;
+			ledG = 1;
+			ledB = 0;
+		}
 	}
+
 	return 0;
 }