📄 tos.interfaces.pot.nc.html
字号:
<html><head><title>Interface: Pot</title></head><body><table BORDER="0" CELLPADDING="3" CELLSPACING="0" width="100%"><tr><td><font size="-1"><b><font color="blue"><a href="apps_p.html">Apps</a></font></b> <b><a href="components_p.html">Components</a></b> <b><a href="interfaces_p.html">Interfaces</a></b> <b><a href="allfiles_p.html">All Files</a></b> <b><a href="index.html">Source Tree</a></b> </font></td><td align="right"><font size="-1">source: <b><a href="tos.interfaces.Pot.nc.source">tos.interfaces.Pot.nc</a></b></font></td></tr></table><hr><h1 align="center">Interface: Pot</h1><p> The Pot interface allows users to adjust the potentiometer on the input to the RFM radio which controls the RF transmit power or connectivity range. The interface controls the potentiometer, rather than the signal strength, so the settings may be a bit counterintuitive: the low potentiometer settings correspond to high transmission power, and high potentiometer settings correspond to low transmission power. Valid range depends on the platform being used: <ul> <li> <bold>Mica</bold> -- parameters range from 0 to 99; the actual transmission range is heavily dependent on the antenna. With the built-in antenna one can generally expect the range from 1 inch to 15 feet; with the external antenna the range is from 1 foot to 100 feet. <li> <bold>Rene</bold> -- parameters range from 20 to 77, though the exact upper bound depends heavily on battery voltage. The exact range achieved depends heavily on the battery used, but covers roughly the same range as Mica (from 1 to 100 feet). <em> Let us emphasize this again: The exact low transmission power bound for the Rene is dependent on battery voltage; it is VERY difficult to get a reliable short range communication over an extended time period without active control of the potentiometer. </em> </ul> <em>Note:</em> the transmission power is NOT linear with respect to the potentiometer setting; see mote schematics and RFM TR1000 manual for more information. </p> <em>Note:</em> any change to the potentiometer value will cause LEDs to blink. This behavior is normal, expected, and unavoidable; at the end of a potentiometer setting operation you may be left with an inconsistent LED state, though the functions provided by the LED component will continue to work correctly. <table border="0" cellpadding="0"><tr valign="top"><td><b>Author:</b><td> Jason Hill </td></tr><tr valign="top"><td> </td><td> David Gay </td></tr><tr valign="top"><td> </td><td> Philip Levis</td></tr></table><p><dl><dt>Components providing this interface:<dd> <a href="tos.system.PotC.nc.html">tos.system.PotC</a><br> <a href="tos.system.PotM.nc.html">tos.system.PotM</a><br></dl><p><dl><dt>Components requiring this interface:<dd> <a href="tos.system.RealMain.nc.html">tos.system.RealMain</a><br></dl><p><table BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><tr BGCOLOR="#CCCCFF"><td><h3>Commands</h3></td></tr></table><ul><li> result_t <a href="# result_t init(uint8_t initialSetting)"><b>init</b> </a>(uint8_t initialSetting)<menu> Initialize the potentiometer and set it to a specified value. </menu><p><li> result_t <a href="# result_t set(uint8_t setting)"><b>set</b> </a>(uint8_t setting)<menu> Set the potentiometer value</menu><p><li> result_t <a href="# result_t increase(void)"><b>increase</b> </a>(void)<menu> Increment the potentiometer value by 1.</menu><p><li> result_t <a href="# result_t decrease(void)"><b>decrease</b> </a>(void)<menu> Decrement the potentiometer value by 1.</menu><p><li> uint8_t <a href="# uint8_t get(void)"><b>get</b> </a>(void)<menu> Return the current setting of the potentiometer. </menu><p></ul><table BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"><tr BGCOLOR="#CCCCFF"><td><h3>Commands - Details</h3></td></tr></table> <a name=" result_t init(uint8_t initialSetting)"></a> <h4>init</h4> result_t <b>init</b>(uint8_t initialSetting)<P><menu> Initialize the potentiometer and set it to a specified value. <table border="0" cellpadding="0"></td></tr><tr valign="top"><td><br><b>Parameters:</b></td><td><menu><p STYLE="text-indent: -1cm"><b>initialSetting</b> - The initial value for setting of the signal strength; see above for valid ranges and communication radii achieved with them. </menu></td></tr><tr valign="top"><td><b>Returns:</b></td><td> Returns SUCCESS upon successful initialization. </td></tr></table></menu><hr> <a name=" result_t set(uint8_t setting)"></a> <h4>set</h4> result_t <b>set</b>(uint8_t setting)<P><menu> Set the potentiometer value <table border="0" cellpadding="0"></td></tr><tr valign="top"><td><br><b>Parameters:</b></td><td><menu><p STYLE="text-indent: -1cm"><b>setting</b> - The new value of the potentiometer. </menu></td></tr><tr valign="top"><td><b>Returns:</b></td><td> Returns SUCCESS if the setting was successful. The operation returns FAIL if the component has not been initialized or the desired setting is outside of the valid range. </td></tr></table></menu><hr> <a name=" result_t increase(void)"></a> <h4>increase</h4> result_t <b>increase</b>(void)<P><menu> Increment the potentiometer value by 1. This function proves to be quite useful in active potentiometer control scenarios. <table border="0" cellpadding="0"><tr valign="top"><td><b>Returns:</b></td><td> Returns SUCCESS if the increment was successful. Returns FAIL if the component has not been initialized or if the potentiometer cannot be incremented further. </td></tr></table></menu><hr> <a name=" result_t decrease(void)"></a> <h4>decrease</h4> result_t <b>decrease</b>(void)<P><menu> Decrement the potentiometer value by 1. This function proves to be quite useful in active potentiometer control scenarios. <table border="0" cellpadding="0"><tr valign="top"><td><b>Returns:</b></td><td> Returns SUCCESS if the decrement was successful. Returns FAIL if the component has not been initialized or if the potentiometer cannot be decremented further. </td></tr></table></menu><hr> <a name=" uint8_t get(void)"></a> <h4>get</h4> uint8_t <b>get</b>(void)<P><menu> Return the current setting of the potentiometer. <table border="0" cellpadding="0"><tr valign="top"><td><b>Returns:</b></td><td> An unsigned 8-bit value denoting the current setting of the potentiometer. </td></tr></table></menu>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -