Home | Trees | Indices | Help |
---|
|
This class exposes and implements the pymata_core asyncio API, It includes the public API methods as well as a set of private methods. If your application is using asyncio, this is the API that you should use.
After instantiating this class, its "start" method MUST be called to perform Arduino pin auto-detection.
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|||
|
|
This is the "constructor" method for the PymataCore class.
|
This method must be called immediately after the class is instantiated. It instantiates the serial interface and then performs auto pin discovery.
|
Retrieve the last data update for the specified analog pin.
|
Set the selected pin to the specified value.
|
Retrieve the last data update for the specified digital pin.
|
Set the specified pin to the specified value.
|
Disables analog reporting for a single analog pin.
|
Disables digital reporting. By turning reporting off for this pin, Reporting is disabled for all 8 bits in the "port" -
|
This command enables the rotary encoder (2 pin + ground) and will enable encoder reporting. NOTE: This command is not currently part of standard arduino firmata, but is provided for legacy support of CodeShield on an Arduino UNO. Encoder data is retrieved by performing a digital_read from pin a (encoder pin_a)
|
This method retrieves the latest encoder data value
|
Enables analog reporting. By turning reporting on for a single pin,
|
Enables digital reporting. By turning reporting on for all 8 bits in the "port" - this is part of Firmata's protocol specification.
|
This method will send an extended-data analog write command to the selected pin.
|
A list is returned containing the latch state for the pin, the latched value, and the time stamp [latched_state, threshold_type, threshold_value, latched_data, time_stamp]
|
This method requests a Firmata analog map query and returns the results.
|
This method requests and returns a Firmata capability query report
|
A list is returned containing the latch state for the pin, the latched value, and the time stamp [pin_num, latch_state, latched_value, time_stamp]
|
This method retrieves the Firmata firmware version
|
This method returns the major and minor values for the protocol version, i.e. 2.4
|
This method retrieves a pin state report for the specified pin
|
This method retrieves the PyMata version number
|
NOTE: THIS METHOD MUST BE CALLED BEFORE ANY I2C REQUEST IS MADE This method initializes Firmata for I2c operations.
|
This method retrieves cached i2c data to support a polling mode.
|
This method requests the read of an i2c device. Results are retrieved by a call to i2c_get_read_data(). or by callback. If a callback method is provided, when data is received from the device it will be sent to the callback method. Some devices require that transmission be restarted (e.g. MMA8452Q acceleromater). Use I2C_READ | I2C_RESTART_TX for those cases.
|
Write data to an i2c device.
|
This method will call the Tone library for the selected pin. It requires FirmataPlus to be loaded onto the arduino If the tone command is set to TONE_TONE, then the specified tone will be played. Else, if the tone command is TONE_NO_TONE, then any currently playing tone will be disabled.
|
Send a Sysex reset command to the arduino
|
Configure a pin as a servo pin. Set pulse min, max in ms. Use this method (not set_pin_mode) to configure a pin for servo operation.
|
This method "arms" an analog pin for its data to be latched and saved in the latching table If a callback method is provided, when latching criteria is achieved, the callback function is called with latching data notification. Data returned in the callback list has the pin number as the first element,
|
This method "arms" a digital pin for its data to be latched and saved in the latching table If a callback method is provided, when latching criteria is achieved, the callback function is called with latching data notification. Data returned in the callback list has the pin number as the first element,
|
This method sets the pin mode for the specified pin. For Servo, use servo_config() instead.
|
This method sends the desired sampling interval to Firmata. Note: Standard Firmata will ignore any interval less than 10 milliseconds
|
This method attempts an orderly shutdown
|
This method is a proxy method for asyncio.sleep
|
Configure the pins,ping interval and maximum distance for an HC-SR04 type device. Single pin configuration may be used. To do so, set both the trigger and echo pins to the same value. Up to a maximum of 6 SONAR devices is supported If the maximum is exceeded a message is sent to the console and the request is ignored. NOTE: data is measured in centimeters
|
Retrieve Ping (HC-SR04 type) data. The data is presented as a dictionary. The 'key' is the trigger pin specified in sonar_config() and the 'data' is the current measured distance (in centimeters) for that pin. If there is no data, the value is set to None.
|
Configure stepper motor prior to operation. This is a FirmataPlus feature.
|
Move a stepper motor for the number of steps at the specified speed This is a FirmataPlus feature.
|
This is a private method. It continually accepts and interprets data coming from Firmata,and then dispatches the correct handler to process the data.
|
This is a private message handler method. It is a message handler for the analog mapping response message
|
This is a private message handler method. It is a message handler for analog messages.
|
This is a private message handler method. It is a message handler for capability report responses.
|
This is a private message handler method. It is a message handler for Digital Messages.
|
This is a private message handler method. It handles encoder data messages.
|
This is a private message handler method. It handles replies to i2c_read requests. It stores the data for each i2c device address in a dictionary called i2c_map. The data may be retrieved via a polling call to i2c_get_read_data(). It a callback was specified in pymata.i2c_read, the raw data is sent through the callback
|
This is a private message handler method. It handles pin state query response messages.
|
This is a private message handler method. This method handles the sysex 'report firmware' command sent by Firmata (0x79). It assembles the firmware version by concatenating the major and minor version number components and the firmware identifier into a string. e.g. "2.3 StandardFirmata.ino"
|
This is a private message handler method. This method reads the following 2 bytes after the report version command (0xF9 - non sysex). The first byte is the major number and the second byte is the minor number.
|
This method handles the incoming sonar data message and stores the data in the response table.
|
This is a private message handler method. It is the message handler for String data messages that will be printed to the console.
|
This is a private utility method. When a data change message is received this method checks to see if latching needs to be processed
|
This is a private utility method. This method attempts to discover the com port that the arduino is connected to.
|
This is a private utility method. This method formats a capability report if the user wishes to send it to the console
|
This is a private utility method. This method process latching events and either returns them via callback or stores them in the latch map
|
This is a private utility method. The method sends a non-sysex command to Firmata.
|
This is a private utility method. This method sends a sysex command to Firmata.
|
This is a private utility method. This method accumulates the requested number of bytes and then returns the full command
|
Home | Trees | Indices | Help |
---|
Generated by Epydoc 3.0.1 on Sat Jul 18 11:34:08 2015 | http://epydoc.sourceforge.net |