Skip to content

Commit

Permalink
Fixed the issue that the ultrasonic module ECHO pin cannot use the bo…
Browse files Browse the repository at this point in the history
…ard input pins
  • Loading branch information
zhengyangliu committed Dec 17, 2024
1 parent e6ae653 commit 3984f4c
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions extensions/ultrasonic/blocks.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@ function registerBlocks (Blockly) {
const color = '#D39DDB';
const secondaryColour = '#BA55D3';

const digitalPins = Blockly.Device.getPinOptions('arduino_pin_setDigitalOutput');
const outPins = Blockly.Device.getPinOptions('arduino_pin_setDigitalOutput');
const inputPins = Blockly.Device.getPinOptions('arduino_pin_readDigitalPin');

Blockly.Blocks.ultrasonic_readDistance = {
init: function () {
Expand All @@ -15,12 +16,12 @@ function registerBlocks (Blockly) {
{
type: 'field_dropdown',
name: 'TRIG',
options: digitalPins
options: outPins
},
{
type: 'field_dropdown',
name: 'ECHO',
options: digitalPins
options: inputPins
},
{
type: 'field_dropdown',
Expand Down

0 comments on commit 3984f4c

Please sign in to comment.