Demonstrates the MAX44000 library and some of the features of the MAX44000

Dependencies:   MAX44000 ard2pmod mbed

Fork of ALS_ARD2PMOD_Demo by Maxim Integrated

MAX44000PMB1 Demonstration

This demonstrates some of the capabilities of the MAX44000. This is written to work with the MAXREFDES72# adapter board and the MAX44000PMB1 peripheral module. It uses the standard Arduino pin names and it will compile for most arduino form-factor mbed boards. /media/uploads/switches/max44000pmb1_demo.jpg To run this demonstration you will need:

In this demonstration the LEDs are changed based on data from the sensor.

  • LED1 toggles when something is first detected by the proximity sensor.
  • LED2 indicates when the Ambient Light Sensor reads greater than a set value (alsLim).
  • LED3 will stay on whenever something is detected by the proximity sensor and stay on for an additional 5s after it is no longer detected.

Note: Some boards use D13 for an LED signal, so this example uses the second row (row B, pins 7 through 12) of the Pmod connector. /media/uploads/switches/max44000_align.jpg

Tested platform boards

Links to external supporting material

Revision:
11:a799d1525a4d
Parent:
10:102944c2d59c
Child:
13:fb522023a522
--- a/main.cpp	Wed May 04 16:40:23 2016 +0000
+++ b/main.cpp	Wed May 04 18:04:14 2016 +0000
@@ -1,20 +1,20 @@
 /* MAX44000 Ambient Light Sensor / Proximity Sensor Demo
  * This demonstrates some of the capabilities of the MAX44000.
- * 
- * This is written to work with the ARD2PMD adapter board and 
- * the MAX44000PMB1.  It uses the standard Arduino pin names 
+ *
+ * This is written to work with the ARD2PMD adapter board and
+ * the MAX44000PMB1.  It uses the standard Arduino pin names
  * and it will compile for most arduino form-factor mbed boards.
  *
  * LED1 toggles when something is first detected by the proximity sensor.
  * LED2 indicates when the Ambient Light Sensor reads grater than alsLim.
- * LED3 will stay on whenever something is detected by the proximity sensor 
+ * LED3 will stay on whenever something is detected by the proximity sensor
  *   and stay on for an additional 5s after it is no longer detected.
  *
  * The following boards have been tested to work:
  *   MAX32600MBED
- *  
- * Some boards use D13 for an LED signal, so this example uses the second 
- *   row (row B, pins 7 through 12) of the Pmod connector.  
+ *
+ * Some boards use D13 for an LED signal, so this example uses the second
+ *   row (row B, pins 7 through 12) of the Pmod connector.
  */
 
 #include "mbed.h"
@@ -59,7 +59,10 @@
         } else {
             lastProx = false;
         }
-        if (offDelay > 0) { offDelay -= 1; }
-        else { dly = true; }
+        if (offDelay > 0) {
+            offDelay -= 1;
+        } else {
+            dly = true;
+        }
     }
 }
\ No newline at end of file