The ArduinoGUI module provides tools to create simple graphical user interfaces for Arduino programs using the PyQt4 library. It may optionally use the PyQwt library to render a dynamic plot window.
ArduinoConsole.py
PyQt4 window implementing a generic control console for an Arduino sketch, including command line, plot window, and serial port controls. Functions are provide to allow extending the basic interface with custom buttons and sliders without needing to use Qt Designer.
Copyright (c) 2013-2015, Garth Zeglin. All rights reserved. Licensed under the terms of the BSD 3-clause license as included in LICENSE.
A custom window which inherits both from the QMainWindow class and the custom Ui_ArduinoConsoleWindow defined using Qt Designer.
Callback invoked whenever the Arduino Connect checkbox changes state.
Callback invoked whenever text is entered into the Arduino Port field.
Add a button to the general-purpose button area of the interface. The title argument should be a short string to appear on the face of the button. The callback function is invoked whenever the button is pressed.
Add a named channel to the ArduinoScope plotting widget. The arguments are passed unchanged to add_channel().
Add a set of new samples to a given named channel to the ArduinoScope plotting widget. The arguments are passed unchanged to add_samples().
Add a horizontal slider to the controls area. The range is fixed over [0,1.0).
Parameters: |
|
---|
Set the callback function to be invoked when the user enters a command.
Parameters: | callback – callback( command_string ) |
---|
Set the callback function to be invoked when the user requests a connect or disconnect from the Arduino.
Parameters: | callback – callback( port_name, flag ) flag is True for connect, False for disconnect |
---|
Convenience function to create a notification callback when input is available on a file descriptor.
Parameters: |
|
---|---|
Returns: | the underlying QSocketNotifier object |
Convenience function to create a periodic timer which calls a function at the given interval.
Parameters: |
|
---|---|
Returns: | the underlying QTimer object |
Convenience function to set up a single-shot timer which calls a function once after the given interval.
Parameters: |
|
---|
ArduinoScope.py : Qt/Qwt widget to show a real-time oscilloscope-like display of signals
Copyright (c) 2015, Garth Zeglin. All rights reserved. Licensed under the terms of the BSD 3-clause license.
Plot widget to show real-time data like a multichannel oscilloscope. Implemented as a subclass of the QwtPlot widget provided in the Qwt5 package. Requires Qwt5 and PyQwt5.
Add a new channel to the oscilloscope. The parameters are passed to ScopeChannel.init.
Parameters: |
|
---|
Add one or more data samples to the buffer in the channel. If a maximum duration was specified during creation, the data buffer will be truncated to hold the specified maximum amount of history. After all channels have been updated, call the replot() method to update the display.
Parameters: |
|
---|
Internal class to represent the state of one channel in an ArduinoScope widget. See ArduinoScope.add_channel() for arguments.
Add one or more data samples to the buffer in the channel. If a maximum duration was specified during creation, the data buffer will be truncated to hold the specified maximum amount of history.
Parameters: |
|
---|
This file is generated from an XML interface description using the pyuic interface compiler. The XML description represents the basic interface layout, created and edited using Qt Designer and saved as the XML file ArduinoConsoleWindow.ui.