BlocklyProp blocks for analog and pulse I/O. Block availability will vary by board type.
For Propeller Activity Board WX, FLiP and Other board types. Not available for Badge or Scribbler Robot board types.
The RC time (formerly RC charge/discharge) block sets the specified Propeller I/O pin to an input and reports how long it takes for an RC (resistor/capacitor) circuit to either charge or discharge across the pin's logic threshold. The value provided by the block is in microsecond units. This block must be used in conjunction with other blocks to charge (or discharge) the circuit before taking the measurement.
The PIN menu this block can be set to "other." When "other" is chosen, the dropdown menu disappears, and it is replaced with an input. You can then use any block that provides a numeric value such as a number value, get variable, or constant value block:
The RC time block is useful for circuits with a variable resistor or other means to affect current flow, including potentiometers, phototransistors, thermistors, and some pressure sensors. See Read a Potentiometer with RC Time [1] for an example of this block in action.
Block availability varies by board type.
Propeller Activity Board board type only
The A/D read block is designed for the A/D and D/A circuits built directly into the Propeller Activity Board (original and WX)
This block reads and reports the voltage input on the A/D channel chosen in the drop-down menu. The value provided by the block is in volt-hundredths: if +2.50 volts is applied to the A/D channel, the block will provide a value of 250. It can be attached to a variable set block or used wherever a number value block is accepted.
Propeller Activity Board board type only
This block launches a processor automatically. Using a second block for an additional D/A channel will not launch an additional processor.
The D/A output block sets the output voltage on the D/A channel chosen in the drop-down menu. The block expects a value in volt-hundredths: if value block placed in this block is 250, the D/A will output +2.50 volts.
Propeller FLiP or Project Board and Other board types only
The A/D chip read block is designed for specific analog to digital converter chips that can be added to the prototyping area of Propeller boards. This includes the ADC0831 [2]and MCP3002 [3]carried by Parallax, as well as other chips in the MCP3 line.
This block reports the voltage input on a channel of a supported A/D converter chip. It can be attached to a variable set block or used wherever a number value block is accepted. To use the block:
The value provided by the block is in volt-hundredths: if +2.50 volts is applied to the A/D channel, the block will provide a value of 250. Unless the A/D chip set Vref block is used, this block assumes that the A/D chip's Vref pin is connected to +3.3 volts.
Propeller FLiP or Project Board and Other board types only
The A/D chip set Vref block is designed for specific analog to digital converter chips that can be added to the prototyping area of Propeller boards. This includes the ADC0831 [2]and MCP3002 [3]carried by Parallax, as well as other chips in the MCP3 line.
This block is used to improve the accuracy of the value returned by the A/D chip read block and/or to use a different voltage (such as +5.0 volts) for the A/D chip's measurements. Use this block before the A/D chip read block in your project, or at the beginning of your program to set the Vref value globally. Enter the value of the voltage applied to the A/D chip's Vref pin. The number entered is in volt-hundredths; if +3.3 volts is applied to Vref, enter 330.
For Propeller Activity Board WX, FLiP and Other board types. Not available for Badge or Scribbler Robot board types.
The PIN menu on each of these blocks can be set to "other." When "other" is chosen, the dropdown menu disappears and it is replaced with an input. You can then use any block that provides a numeric value such as a number value, get variable, or constant value block:
The pulse-in block provides a value that represents a measurement of how long a pulse is in a low or high state in units of microseconds. The Propeller microcontroller begins measuring as soon as the PIN transitions into the state and stops and reports the measurement when it transitions out of the state.
The pulse-out block sends a pulse out on the PIN set by the drop-down menu. The value block sets the width of the pulse output in microseconds.
The count pulses block provides the number of pulses detected over a certain period of time.
For Propeller Activity Board WX, FLiP and Other board types. Not available for Badge or Scribbler Robot board types. Not available for Badge or Scribbler Robot board types.
This block launches a processor automatically. Each subsequent instance of this block changes the PWM behavior as configured, but does not launch an additional processor.
The PWM set block begins outputting a pulse-width modulated signal on the pin specified in the drop-down box with a duty cycle set by the value block is. For example, if the value block is set to 75, the PWM signal will be on 75% of the time and off 25% of the time. There are two PWM channels available on the Propeller microcontroller, so up to two PWM set blocks (one set to channel A and the other set to channel B) operating at one time. Setting the duty cycle to 0 (zero) turns the PWM signal off.
The PIN menu this block can be set to "other." When "other" is chosen, the drop-down menu disappears, and it is replaced with an input. You can then use any block that provides a numeric value such as a number value, get variable, or constant value block:
Note that the PWM Initialize block has been deprecated, and its functionality was added to the PWM set block
The PWM stop block stops the PWM process and frees up the resources it was using on the Propeller microcontroller.
Links
[1] http://learn.parallax.com/tutorials/language/blocklyprop/circuit-practice-blocklyprop/read-potentiometer-rc-time
[2] http://learn.parallax.com/tutorials/language/blocklyprop/tilt-tones-blocklyprop
[3] https://www.parallax.com/product/603-00039