Device-WebIO
view release on metacpan or search on metacpan
lib/Device/WebIO.pm view on Meta::CPAN
=item * "V50" (5.0 volt power)
=item * "GND" (ground)
=back
=head2 Input
=head3 set_as_input
set_as_input( $name, $pin );
Set the given pin as input.
=head3 is_set_input
is_set_input( $name, $pin );
Check if the given pin is already set as input.
=head3 digital_input_pin_count
digital_input_pin_count( $name );
Returns how many input pins there are for this device.
=head3 digital_input
digital_input( $name, $pin );
Returns the input status of the given pin. 1 for on, 0 for off.
=head3 digital_input_port
digital_input_port( $name );
Returns an integer with each bit representing the on or off status of the
associated pin.
=head2 Input Callback
These can be used if the device does the C<DigialInputCallback> role.
=head3 digital_input_callback
digital_input_callback( $name, $pin, $type, $callback );
Set a callback that will be triggered when C<$pin> changes state. C<$type>
is one of the constants in the C<DigitalInputCallback> role, which controls
when the callback is triggered--C<TRIGGER_RISING>, C<TRIGGER_FALLING>, or
C<TRIGGER_RISING_FALLING>.
C<$callback> is a subref that will be called.
=head3 digital_input_begin_loop
digital_input_begin_loop( $name );
Start the loop that will trigger callbacks.
=head2 Input AnyEvent
These can be used if the device does the C<DigitalInputAnyEvent> role.
=head3 set_anyevent_condvar
set_anyevent_condvar( $name, $pin, $cv );
Set an AnyEvent condvar, which will trigger on both the rising and falling
edge. When triggered, the condvar's callback will be called.
=head2 Output
=head3 set_as_output
set_as_output( $name, $pin );
Set the given pin as output.
=head3 is_set_output
is_set_output( $name, $pin );
Check if the given pin is set as output.
=head3 digital_output_pin_count
digital_output_pin_count( $name );
Returns the number of output pins.
=head3 digital_output
digital_output( $name, $pin, $value );
Sets the value of the output for the given pin. 1 for on, 0 for off.
=head3 digital_output_port
digital_output_port( $name, $int );
Sets the value of all output pins. Each bit of C<$int> corresponds to a pin.
=head2 Analog-to-Digital
=head3 adc_count
adc_count( $name );
Returns the number of ADC pins.
=head3 adc_resolution
adc_resolution( $name, $pin );
Returns the number of bits of resolution for the given pin.
=head3 adc_max_int
lib/Device/WebIO.pm view on Meta::CPAN
vid_height( $name, $channel );
Return the height of the video channel.
=head3 vid_fps
vid_fps( $name, $channel );
Return the Frames Per Second of the video channel.
=head3 vid_kbps
vid_kbps( $name, $channel );
Return the bitrate of the video channel.
=head3 vid_set_width
vid_set_width( $name, $channel, $width );
Set the width of the video channel.
=head3 vid_set_height
vid_set_height( $name, $channel, $height );
Set the height of the video channel.
=head3 vid_allowed_content_types
vid_allowed_content_types( $name, $channel );
Returns a list of MIME types allowed for the given video channel.
=head3 vid_stream
vid_stream( $name, $channel, $type );
Returns a filehandle for streaming the video channel. C<$type> is one of the
MIME types returned by C<vid_allowed_content_types()>.
=head2 Video Callback
These can be used if the device does the C<VideoOutputCallback> role.
=head3 vid_stream_callback
vid_stream_callback( $name, $channel, $type, $callback );
Set a callback that will be triggered when the given video channel gets a
new frame. C<$type> is one of the MIME types returned by
C<vid_allowed_content_types()>.
Only 1 callback per channel will be kept.
=head3 vid_stream_begin_loop
vid_stream_begin_loop( $name, $channel );
Start the loop that will trigger callbacks.
=head2 Still Image
=head3 img_channels
img_channels( $name );
Get the number of still image channels.
=head3 img_width
img_width( $name, $channel );
Return the width of the image channel.
=head3 img_height
img_height( $name, $channel );
Return the height of the image channel.
=head3 img_quality
img_quality( $name, $channel );
Return the quality of the image channel.
=head3 img_set_width
img_set_width( $name, $channel, $width );
Set the width of the image channel.
=head3 img_set_height
img_set_height( $name, $channel, $height );
Set the height of the image channel.
=head3 img_set_quality
img_set_quality( $name, $channel, $height );
Set the quality of the image channel.
=head3 img_allowed_content_types
img_allowed_content_types( $name, $channel );
Returns a list of MIME types allowed for the given video channel.
=head3 img_stream
img_stream( $name, $channel, $type );
Returns a filehandle for streaming the video channel. C<$type> is one of the
MIME types return by C<img_allowed_content_types()>.
=head2 I2C
( run in 0.642 second using v1.01-cache-2.11-cpan-cdf2f3d4e48 )