This demonstrates some of the capabilities of the MAX44000. It is written to work with the ARD2PMD adapter board and the MAX44000PMB1. It uses the standard Arduino pin names and will compile for most Arduino form-factor mbed boards.

Dependencies:   ard2pmod mbed

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 and it will compile for most Arduino form-factor mbed boards.

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.

  • 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 and stay on for an additional 5s after it is no longer detected.

The following boards have been tested to work:

  • MAX32600MBED
  • FRDM-KL25Z
  • FRDM-K64F
  • Seeeduino Arch (LEDs inverted)
  • Seeeduino Arch Pro
  • ST Nucleo F401RE (only one LED, inverted)
Committer:
gsteiert
Date:
Sat Apr 26 03:37:00 2014 +0000
Revision:
0:803011eae289
Child:
1:03aeb304d3b3
Tested to work with FRDM-KL25Z

Who changed what in which revision?

UserRevisionLine numberNew contents of line
gsteiert 0:803011eae289 1 #include "mbed.h"
gsteiert 0:803011eae289 2 #include "MAX14661.h"
gsteiert 0:803011eae289 3
gsteiert 0:803011eae289 4 MAX14661 mux(D14, D15);
gsteiert 0:803011eae289 5 DigitalOut pinRTS(D13);
gsteiert 0:803011eae289 6 DigitalIn pinRX(D0); // Set as input to remove load from mbedTX
gsteiert 0:803011eae289 7 DigitalIn pinTX(D1); // Set as input to remove load from mbedRX
gsteiert 0:803011eae289 8
gsteiert 0:803011eae289 9 int main()
gsteiert 0:803011eae289 10 {
gsteiert 0:803011eae289 11 pinRTS=0; // Not Ready to Send
gsteiert 0:803011eae289 12 // D0 (mbedTX) + PA2 (TXD) D1 (mbedRX) + PA3 (RXD)
gsteiert 0:803011eae289 13 mux.setAB((MAX14661::SW01 | MAX14661::SW13), (MAX14661::SW02 | MAX14661::SW12));
gsteiert 0:803011eae289 14 pinRTS=1; // Ready to Send
gsteiert 0:803011eae289 15 }