<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://nearbus.xyz/mediawiki/index.php?action=history&amp;feed=atom&amp;title=NearAPI_Java_Script_Documentation</id>
		<title>NearAPI Java Script Documentation - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://nearbus.xyz/mediawiki/index.php?action=history&amp;feed=atom&amp;title=NearAPI_Java_Script_Documentation"/>
		<link rel="alternate" type="text/html" href="https://nearbus.xyz/mediawiki/index.php?title=NearAPI_Java_Script_Documentation&amp;action=history"/>
		<updated>2026-04-29T15:04:53Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https://nearbus.xyz/mediawiki/index.php?title=NearAPI_Java_Script_Documentation&amp;diff=131&amp;oldid=prev</id>
		<title>Nearwiki: Created page with &quot;  JavaScript API Features ( Alpha )   This page describes the Java Script API features intended to deploy applications in JavaScript code running from a simple browser.   ===N...&quot;</title>
		<link rel="alternate" type="text/html" href="https://nearbus.xyz/mediawiki/index.php?title=NearAPI_Java_Script_Documentation&amp;diff=131&amp;oldid=prev"/>
				<updated>2018-03-29T20:46:01Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;  JavaScript API Features ( Alpha )   This page describes the Java Script API features intended to deploy applications in JavaScript code running from a simple browser.   ===N...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&lt;br /&gt;
&lt;br /&gt;
JavaScript API Features ( Alpha )&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
This page describes the Java Script API features intended to deploy applications in JavaScript code running from a simple browser.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
===Near API Code===&lt;br /&gt;
&lt;br /&gt;
In order to run the NearAPI (v05) you should include the following line in your java script code.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
 &amp;lt;script type='text/javascript' src='http://nearbus.net/downloads/js_apps/nearapi_v05.js'&amp;gt;&amp;lt;/script&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
'''Note:''' The NearAPIjs will return &amp;quot;DOWN&amp;quot; if the remote device has been disconnected.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DIG_OUTPUT===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function sets a channel (port) to the specified value. &lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''DIG_OUTPUT'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : the value to set (0 or 1).&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, &amp;quot;DONE&amp;quot; on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DIG_INPUT===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function reads the value on a specified channel (port).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''DIG_INPUT'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : the value to set (0 or 1). &lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, the specified value (0 or 1) on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===WAIT_DIG_INPUT===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function waits for a specified value on a specified channel (port).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''WAIT_DIG_INPUT'''&lt;br /&gt;
 &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : the input value to wait for.&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, the read value (1 or 0) on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ADC_INPUT===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function reads the analog value with 10 bit resolution on a specified channel (port).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''ADC_INPUT'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : the value to set (0 or 1).&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, a 10 bits Analog Input [ 0 to 1023 ] on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===ADC_INPUT_CONFIG===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function configures the ADC reference value to 1100mV or 5000mV (default).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''ADC_INPUT_CONFIG'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : this argument (set to 1100) allows to configure the 1100mV internal reference (Not available on Arduino Leonardo). The default is 5000mV as ADC reference (or 3300mv on 3.3V boards).&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, &amp;quot;DONE&amp;quot; on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RMS_INPUT===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function returns the '''True RMS''' value of the channel signal. It is indicated to measure signal up to 60 Hz and a peak signal value up tp 5000 mV. It is supported on PINs A0 to A6 on Arduino Platforms. &lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''RMS_INPUT'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : None &lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, the True RMS value of a balanced input signal (without DC component). on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RMS_INPUT_CONFIG===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function configures the ADC reference value to 1100mV or 5000mV (default).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''RMS_INPUT_CONFIG'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : this argument (set to 1100) allows to configure the 1100mV internal reference (Not available on Arduino Leonardo). The default is 5000mV as ADC reference (or 3300mv on 3.3V boards).&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, &amp;quot;DONE&amp;quot; on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===PWM_OUTPUT===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function generates a Pulse Width Modulated output (it allows to control servo motors).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''PWM_OUTPUT'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : it ranges from 800 to 2200 (the standard servomotor duty cycle).&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, &amp;quot;DONE&amp;quot; on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===PULSE_OUTPUT===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function generates Programmable Pulse Output of &amp;quot;x&amp;quot; milliseconds.&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''PULSE_OUTPUT'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : it represents the pulse duration in milliseconds. It ranges from 1 to (2^32) ( 1ms to 50 days ).&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, &amp;quot;DONE&amp;quot; on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
  &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===GET_PULSE_OUTPUT===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
Returns the pulse output level (to figure out if the pulse has finished).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''GET_PULSE_OUTPUT'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : None&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, the pulse output value (1 while the pulse is UP and 0 when it has finished), &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===TRIGGER_INPUT===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function caches a trigger pulse on a digital input channel (port).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''TRIGGER_INPUT'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : null.&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, 1 if a trigger was caught or 0 if not, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===TRIGGER_INPUT_CONFIG===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function configures the the trigger pulse edge.&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''TRIGGER_INPUT_CONFIG'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx )&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : it allows to configure the pulse edge: [1 -&amp;gt; rising_edge] [0 -&amp;gt; falling_edge].&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, &amp;quot;DONE&amp;quot; on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DIG_COUNTER===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function counts pulses on the selected channel (over a specified period of time).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''DIG_COUNTER'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : None&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, the accumulated input pulses (on falling edges) over a specified period of time ( from 1 to 50 days ), &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Features'''&lt;br /&gt;
* It works in steps of 5 ms (system accuracy). The input is configured with a '''Pull-Up resistor''' (20 K), intended to work with dry-contact switchs and open collector devices. &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DIG_COUNTER_CONFIG===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function allows to set the counter period.&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''DIG_COUNTER_CONFIG'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : the counting period in ms, it ranges from 1 to 2^32( from 1ms to 50 days ).&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, &amp;quot;DONE&amp;quot; on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DIG_ACCUMULATOR===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function accumulates pulses on an input channel (port).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''DIG_ACCUMULATOR'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : : it returns the accumulated pulses on the selected channel since last reset.&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, the accumulated input pulses (on falling edges) on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
'''Features'''&lt;br /&gt;
* The NearBus will retains the accumulated pulses even if the remote device is reseted.&lt;br /&gt;
* It works in steps of 5 ms (system accuracy). The input is configured with a '''Pull-Up resistor''' (20 K), intended to work with dry-contact switchs and open collector devices.&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===DIG_ACCUMULATOR_RESET===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function resets the accumulator (sets to 0) on a specified channel (port).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''DIG_ACCUMULATOR_RESET'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform (MCU) port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : 0&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, &amp;quot;DONE&amp;quot; on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===NearTestAPIjs ( )===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This basic function allows you to use API commands in a &amp;quot;raw way&amp;quot; ( it is mainly intended to be used for testing and debugging ).&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearTestAPIjs ( (string) &amp;quot;service&amp;quot;, (string) &amp;quot;method&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''DIG_OUTPUT, DIG_INPUT, WAIT_DIG_INPUT, ADC_INPUT, ADC_INPUT_CONFIG, RMS_INPUT, RMS_INPUT_CONFIG, PWM_OUTPUT, PULSE_OUTPUT, GET_PULSE_OUTPUT, TRIGGER_INPUT, TRIGGER_INPUT_CONFIG, DIG_COUNTER, DIG_COUNTER_CONFIG, DIG_ACCUMULATOR, DIG_ACCUMULATOR_RESET'''.&lt;br /&gt;
  &lt;br /&gt;
 '''''method''''' : '''POST''' or '''GET'''.&lt;br /&gt;
 &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : the microcontroller platform port.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : the value to set (with POST), nothing (with GET).&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : none.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===Near_Timer ( )===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function allows to implement a delay of &amp;quot;x&amp;quot; seconds in the user's main loop.&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : Near_Timer ( seconds, command );&lt;br /&gt;
 &lt;br /&gt;
 '''''seconds''''' : the number of seconds to count.&lt;br /&gt;
 &lt;br /&gt;
 '''''command''''' : &amp;quot;RUN&amp;quot; and &amp;quot;RESET&amp;quot;(resets the timer).&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RESET_CHANNEL===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This function resets a specified channel (port).&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===RESET_MANUAL===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function resets the manual mode for the specified device.&lt;br /&gt;
 &lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value  );&lt;br /&gt;
 &lt;br /&gt;
 '''''service''''' : '''RESET_MANUAL'''&lt;br /&gt;
  &lt;br /&gt;
 '''''device_id''''' : the NearBus device identifier ( NB100xxx ).&lt;br /&gt;
 &lt;br /&gt;
 '''''channel''''' : set to 0.&lt;br /&gt;
 &lt;br /&gt;
 '''''value''''' : set to 0.&lt;br /&gt;
 &lt;br /&gt;
 '''''Return''''' : (string/int) this function returns &amp;quot;WAIT&amp;quot; while no data available, &amp;quot;DONE&amp;quot; on successful, &amp;quot;ERROR&amp;quot; if error.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===SET_POOLING_TIME===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
This function allows to change the NearBus pooling time period.&lt;br /&gt;
&lt;br /&gt;
 Not implemented.&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;br /&gt;
&lt;br /&gt;
===API SPECIAL FEATURES===&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&lt;br /&gt;
'''MODE PARAMETER'''&lt;br /&gt;
&lt;br /&gt;
 '''''Syntax''''' : NearAPIjs (  (string) &amp;quot;service&amp;quot;, (string) &amp;quot;device_id&amp;quot;, (int) channel, (int) value, '''&amp;quot;MODE&amp;quot;''' );&lt;br /&gt;
 &lt;br /&gt;
 The NearAPI supports the following modes:&lt;br /&gt;
 &lt;br /&gt;
 '''&amp;quot;FULL&amp;quot;''' This option allows full access to the API features (Read/Write). It is the API default mode.&lt;br /&gt;
  &lt;br /&gt;
 '''&amp;quot;RONLY&amp;quot;''': This option allows to GET a value as a Read-Only call. That means that you will get the last value in the NearBus data base, but no update will be sent to the remote device.&lt;br /&gt;
 &lt;br /&gt;
 '''&amp;quot;FLUSH&amp;quot;''' This option will &amp;quot;flush&amp;quot; any previous request queued for the specified device (it works with GET and POST methods).&lt;br /&gt;
 &lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
&amp;lt;br /&amp;gt;&lt;br /&gt;
----&lt;/div&gt;</summary>
		<author><name>Nearwiki</name></author>	</entry>

	</feed>