Ulta Low Power I2C Multi-Sensor: Capacitive Touch, Magnetic Field & Inductive Proximity.

Dependencies:   IQS620DisplayTerminal IQS62x mbed

Fork of IQS620_HelloWorld by Azq Dev

Hello World! From Azoteq's IQS620 Ultra Low Power Multi-Sensor

This is an mbed hardware demo program for the Azoteq IQS620 ultra low power multisensor.

More details on the IQS620 (and verified mbed boards) on these component pages:

Components / IQS620A
Ultra low power sensor for magnetic field, capacitive touch and inductive proximity. Empowers next-generation user interfaces.

Low Cost Evaluation Board For Azoteq IQS620A ultra low power sensor for magnetic field, capacitance, inductive proximity and temperature. Empowers next-generation user interfaces.


/media/uploads/AzqDev/iqs620-mbed-lpc1768-azoteq-touch-magnetic-inductive-temperature-sensor.gif
IQS620 Eval Kit board Connected to mbed LPC1768 board.

Committer:
AzqDev
Date:
Tue Jan 23 15:14:27 2018 +0000
Revision:
20:3037e1b6aaaf
Parent:
19:b532417017e2
Updated mbed library

Who changed what in which revision?

UserRevisionLine numberNew contents of line
AzqDev 0:f1f07b4c5580 1 // IQS620-HelloWorld.cpp
AzqDev 0:f1f07b4c5580 2
AzqDev 0:f1f07b4c5580 3 // Hello World program for Azoteq IQS620 ultra low power sensor for magnetic field, capacitive touch and inductive proximity sensor.
AzqDev 0:f1f07b4c5580 4
AzqDev 13:22df25a61e14 5 // More info on Azoteq IQS620 page: http://www.azoteq.com/products/proxfusion/iqs620?mbed
AzqDev 13:22df25a61e14 6
AzqDev 13:22df25a61e14 7 // ProxFusion 5-minute YouTube video: https://youtu.be/l7tO2ra5y74
AzqDev 0:f1f07b4c5580 8
AzqDev 13:22df25a61e14 9 // IQS620 hardware page on mbed: https://developer.mbed.org/components/IQS620/
AzqDev 13:22df25a61e14 10
AzqDev 13:22df25a61e14 11 // IQS620 eval kit page on mbed: https://developer.mbed.org/components/IQS620-EVAL-1/
AzqDev 0:f1f07b4c5580 12
AzqDev 0:f1f07b4c5580 13 // Copyright 2017 Azoteq. Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
AzqDev 0:f1f07b4c5580 14
AzqDev 13:22df25a61e14 15 // Output is via the USB debug serial port to any VT100-compatible terminal emulator such as Tera Term or Putty. (Set background to white)
AzqDev 0:f1f07b4c5580 16
AzqDev 13:22df25a61e14 17 // Tested on the following MBED hardware
AzqDev 0:f1f07b4c5580 18 // Note: When compiling for new hardware, use "Compile All" to rebuild everything
AzqDev 3:481d56f2b398 19 // 1. ST Micro Nucleo-L152RE Azoteq Adapter Boards: AZP694A02, AZP690A02
AzqDev 3:481d56f2b398 20 // 2. ST Micro Nucleo-F401RE Azoteq Adapter Boards: AZP694A02, AZP690A02
AzqDev 3:481d56f2b398 21 // 3. ST Micro Nucleo-L476RG Azoteq Adapter Boards: AZP694A02, AZP690A02
AzqDev 3:481d56f2b398 22 // 4. ST Micro Nucleo-L053R8 Azoteq Adapter Boards: AZP694A02, AZP690A02
AzqDev 3:481d56f2b398 23 // 5. ST Micro Nucleo-F446RE Azoteq Adapter Boards: AZP694A02, AZP690A02
AzqDev 3:481d56f2b398 24 // 6. ST Micro Disco-F746NG Azoteq Adapter Boards: AZP694A02, AZP690A02
AzqDev 3:481d56f2b398 25 // 7. Freescale FRDM-KL46Z Azoteq Adapter Boards: AZP694A02, AZP690A02
AzqDev 3:481d56f2b398 26 // 8. Freescale FRDM-KL25Z Azoteq Adapter Boards: AZP694A02, AZP690A02
AzqDev 0:f1f07b4c5580 27 // 9. mbed LPC1768 Azoteq adapter AZP690A02 [SDA,SCL,RDY] wired to LPC1768 [p28,p27,p26]
AzqDev 0:f1f07b4c5580 28 // 10. mbed LPC11U24 Azoteq adapter AZP690A02 [SDA,SCL,RDY] wired to LPC11U24 [p28,p27,p26]
AzqDev 0:f1f07b4c5580 29
AzqDev 13:22df25a61e14 30 // These two boards additionally require you to import the USBDevice library: https://developer.mbed.org/users/mbed_official/code/USBDevice/
AzqDev 2:ce90bf4d3273 31 // 11. Teensy 3.1 Azoteq adapter AZP690A02 [SDA,SCL,RDY] wired to Teensy 3.1 [p18,p19,p2]
AzqDev 2:ce90bf4d3273 32 // 12. Teensy 3.2 Azoteq adapter AZP690A02 [SDA,SCL,RDY] wired to Teensy 3.2 [p18,p19,p2]
AzqDev 0:f1f07b4c5580 33
AzqDev 19:b532417017e2 34 // Direct wiring of ST Micro Nucleo boards to AZP690A02 (IQS620-EVAL-1 board)
AzqDev 13:22df25a61e14 35 // [SDA,SCL,RDY] wired to Nucleo [CN10-5,CN10-3,CN10-33], [GND,3.3V] wired to Nucleo [CN11,CN7-16]
AzqDev 3:481d56f2b398 36
AzqDev 3:481d56f2b398 37
AzqDev 0:f1f07b4c5580 38 #include "mbed.h"
AzqDev 0:f1f07b4c5580 39 #include "IQS62x.h"
AzqDev 0:f1f07b4c5580 40 #include "IQS620DisplayTerminal.h"
AzqDev 0:f1f07b4c5580 41
AzqDev 0:f1f07b4c5580 42 IQS620Display terminal; // class to display IQS62x registers on a terminal
AzqDev 13:22df25a61e14 43 IQS62xIO iqs62x; // class for basic IQS62x reads and writes using I2C
AzqDev 0:f1f07b4c5580 44
AzqDev 0:f1f07b4c5580 45 int main() {
AzqDev 2:ce90bf4d3273 46 terminal.helloMessage(false); // say hello but don't wait for a keypress
AzqDev 13:22df25a61e14 47 iqs62x.configure(); // configure the IC contents of IQS62x_Init.h
AzqDev 14:d9e92073fd3f 48 char * color = iqs62x.getTable( color_any_register_that_changed_in_the_previous_20_reads ); // table that contains changes to register values
AzqDev 10:3f86cd2277cc 49 while(1) {
AzqDev 6:250df5794541 50 iqs62x.readIqsRegisters(0,NUMBER_OF_REGISTERS); // read all the registers
AzqDev 0:f1f07b4c5580 51 terminal.showStatus(iqs62x.I2Cspeed,iqs62x.I2CErrorCount); // show heading and number of I2C errors
AzqDev 10:3f86cd2277cc 52 terminal.showRegisters(iqs62x.registers, color, false); // display registers, color the registers that changed
AzqDev 10:3f86cd2277cc 53 }
AzqDev 0:f1f07b4c5580 54 }
AzqDev 0:f1f07b4c5580 55 // end of IQS620_HelloWorld.cpp