platypush/plugins/esp/__init__.py
def adc_read(self, pin: int = 0, **kwargs) -> int:
        """
        Read an analog value from a PIN. Note that the ESP8266 only has one analog PIN, accessible on
        the channel ``0``. If you are interested in the actual voltage that is measured then apply
        ``V = Vcc * (value/1024)``, where ``Vcc`` is the supply voltage provided to the device (usually 3V if
        connected to the Vcc PIN of an ESP8266).

        :param pin: GPIO PIN number (default: 0).
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        :return: A value between ``0`` and ``1024``.
        """
        code = '''
import machine
adc = machine.ADC({pin})
adc.read()
'''.format(pin=pin)

        response = self.execute(code, **kwargs)
        return int(response.output)

        Read an analog value from a PIN. Note that the ESP8266 only has one analog PIN, accessible on
        the channel ``0``. If you are interested in the actual voltage that is measured then apply
        ``V = Vcc * (value/1024)``, where ``Vcc`` is the supply voltage provided to the device (usually 3V if
        connected to the Vcc PIN of an ESP8266).

        :param pin: GPIO PIN number (default: 0).
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        :return: A value between ``0`` and ``1024``.
        
Read an analog value from a PIN. Note that the ESP8266 only has one analog PIN, accessible on
the channel ``0``.
Read an analog value from a PIN . Note that the ESP8266 only has one analog PIN accessible on the channel ` ` 0 ` ` .
def adc_read(self, pin: int = 0, **kwargs) -> int:
        code = '''
import machine
adc = machine.ADC({pin})
adc.read()
'''.format(pin=pin)
        response = self.execute(code, **kwargs)
        return int(response.output)
def adc_read ( self , pin : int = 0 , ** kwargs ) -> int : code = '''
import machine
adc = machine.ADC({pin})
adc.read()
''' . format ( pin = pin ) response = self . execute ( code , ** kwargs ) return int ( response . output )
Read an analog value from a PIN.
Read an analog value from a PIN .
"""
        Read an analog value from a PIN. Note that the ESP8266 only has one analog PIN, accessible on
        the channel ``0``. If you are interested in the actual voltage that is measured then apply
        ``V = Vcc * (value/1024)``, where ``Vcc`` is the supply voltage provided to the device (usually 3V if
        connected to the Vcc PIN of an ESP8266).

        :param pin: GPIO PIN number (default: 0).
        :param kwargs: Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
        :return: A value between ``0`` and ``1024``.
        """
None
self
pin
int
GPIO PIN number (default: 0).
GPIO PIN number ( default : 0 ) .
kwargs
Parameters to pass to :meth:`platypush.plugins.esp.EspPlugin.execute`.
Parameters to pass to : meth : ` platypush . plugins . esp . EspPlugin . execute ` .