Skip to contents

Import the API and module-specific extensions and register to communicate through a virtual or physical hub.

Usage

y_initialise(..., hub.url = "localhost:4444")

y_initialize(..., hub.url = "localhost:4444")

Arguments

...

character Names of the yoctopuce APIs to import.

hub.url

character vector of URLs to YoctoHubs, including the port on the hub to connect to, defaults to a virtual hub running locally, but hardware and virtual hubs can be accessed through a LAN or the internet. Passing `NULL` or `character()` skips hub registration.

Details

With this function we initialize the API and register to use a specific hub. The main API can be accessed through object yocto_api using the $ notation, and specific APIs using objects named after the APIs. Beware that there is more than one level of nesting, so more than one `$` can be needed. For example, for Python module 'yoctopuce.yocto_relay' the object yocto_relay is created and can be used to access its members.

This function uses the Python API to check that the requested API extensions are available, so it should work unchanged with future updates to the YoctoPuce Python library, including after new modules are released as long as the Python library installed is up-to-date.

Warning!

Although the objects created to access Python library modules can persist from one R session to a later one, their link to the Python library is not restored. This, function `y_initialise` has to be run at the start of a new R session, and Python modules reimported. In general it is recommended not to import the same Python modules more than once on a given session.