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

Files at this revision

API Documentation at this revision

Comitter:
switches
Date:
Wed Nov 26 00:53:17 2014 +0000
Parent:
4:226ef11c3ef4
Child:
6:b6458d1b6b31
Commit message:
Committing ard2pmod demo code for MAX44000 I2C ambient light sensor

Changed in this revision

MAX14661.lib Show diff for this revision Revisions of this file
ard2pmod.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
mbed.bld Show annotated file Show diff for this revision Revisions of this file
--- a/MAX14661.lib	Mon Jun 30 22:32:02 2014 +0000
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,1 +0,0 @@
-http://mbed.org/users/gsteiert/code/MAX14661/#c3525ee2d636
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/ard2pmod.lib	Wed Nov 26 00:53:17 2014 +0000
@@ -0,0 +1,1 @@
+http://developer.mbed.org/teams/Maxim-Integrated/code/ard2pmod/#349f2ec17a4b
--- a/main.cpp	Mon Jun 30 22:32:02 2014 +0000
+++ b/main.cpp	Wed Nov 26 00:53:17 2014 +0000
@@ -15,35 +15,34 @@
  *   FRDM-K64F
  *   Seeeduino Arch (LEDs inverted)
  *   Seeeduino Arch Pro
- *   ST Nucleo F401RE (only one LED, inverted)
+ *   ST Nucleo L152RE/F401RE (B row only, single LED, inverted)
+ *   LPCXpresso1549
  *  
  * 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"
-#include "MAX14661.h"
+#include "ard2pmod.h"
 
-MAX14661 mux(D14, D15);
 I2C i2c(D14, D15);
 DigitalOut tog(LED1);
 DigitalOut als(LED2);
 DigitalOut dly(LED3);
 DigitalIn pb3(D6);  // Set as input to remove load from PB3
 DigitalIn pb4(D7);  // Set as input to remove load from PB4
+DigitalIn pa3(D12);  // Set as input to remove load from PA3
+DigitalIn pa4(D13);  // Set as input to remove load from PA4
 
 const int alsAddr = 0x94;
 const int alsLim = 0x0008;
 
 int main()
 {
+    Ard2Pmod ard2pmod(PMOD_TYPE_I2C_B);  // Configure ard2pmod multiplexer for I2C
     char cmd[2];
     int alsData;
 
-    //  SDA (D14) + PB4 (D7)     SCL (D15) + PB3 (D6)
-    mux.setAB((MAX14661::SW10 | MAX14661::SW08),
-              (MAX14661::SW09 | MAX14661::SW07));
-
     cmd[0] = 0x02;  // Receive Register
     cmd[1] = 0xFC;  // 1.56ms, 1x
     i2c.write(alsAddr, cmd, 2);
--- a/mbed.bld	Mon Jun 30 22:32:02 2014 +0000
+++ b/mbed.bld	Wed Nov 26 00:53:17 2014 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/mbed_official/code/mbed/builds/024bf7f99721
\ No newline at end of file
+http://mbed.org/users/mbed_official/code/mbed/builds/552587b429a1
\ No newline at end of file