Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
main.cpp
- Committer:
- jksoft
- Date:
- 2013-08-10
- Revision:
- 0:1960122209f8
File content as of revision 0:1960122209f8:
#include "mbed.h"
#define SENSOR_NUM  4
AnalogIn floor_sensor[] = { (p15) , (p16) , (p17) , (p18) };
Serial pc(USBTX, USBRX);
int main() {
    int ain[SENSOR_NUM];
    while(1) {
        for(int i=0;i<SENSOR_NUM;i++)
        {
            ain[i] = floor_sensor[i].read_u16();
        }
        pc.printf("[0]:%05d\t[1]:%05d\t[2]:%05d\t[3]:%05d\r\n",ain[0],ain[1],ain[2],ain[3]);
    }
}