You can have up to 4 proximity sensors

Config commands

proximity config [(info)]; // print config info
proximity config enable [(yes)|no];
proximity config remove; // removes the current config, sets to enable=false;
proximity config default; // removes the current then sets the default configuration.
proximity config clear; // clears current event flags, re initialises.
proximity[n] config smart [value]; // change smart change to [value] While doing smart streaming a change must be greater than this generate output. Default is 5

The default configuration is


proximity[n] config set [CUTTOFF(80)] [PIN]; // note if pin is not entered, it isn’t changed. cutoff is 20-80

proximity0 config set 20 35;
proximity config enable yes;

proximity [(read)]; // does a read;
ie {“Proximity”:[[4,1],[0,1],[100,0],[100,0]]} returned. returns range first from 0-100 then 0/1- 1 means something is close, 0 means nothing is. In order of ‘n’

proximity stop [(on)|off]; // turn the wheel auto stop (when going from 0 to 1) on or off. Doesn’t survive reboot.
proximity events [(on)|off] ; // turn doing events on or off. Default is on. Is always turned on at reboot. Min time value is 50ms
proximity update [TIMEMS(100)]; // update time for events/error checking. Default is 100ms. Min is 50ms.
proximity stream [(on)|off] [TIMEMS(100)]; // sets the streaming on off, and interval. Default is 100. Min allowed is 50msec.

you can use ‘prox’ instead of ‘proximity’ in all of the above.


#define ebEVENT_PROXIMITY_0_ON 44
#define ebEVENT_PROXIMITY_0_OFF 45
#define ebEVENT_PROXIMITY_1_ON 46
#define ebEVENT_PROXIMITY_1_OFF 47
#define ebEVENT_PROXIMITY_2_ON 48
#define ebEVENT_PROXIMITY_2_OFF 49
#define ebEVENT_PROXIMITY_3_ON 50
#define ebEVENT_PROXIMITY_3_OFF 51

{“evt”:48,”i”:”Proximity 2 On”}
{“evt”:49,”i”:”Proximity 2 Off”}