@@ -673,6 +673,7 @@ Blockly.Blocks['board_ready'] = {
673673 [ "50 ms" , "50" ] ,
674674 [ "75 ms" , "75" ] ,
675675 [ "100 ms" , "100" ] ,
676+ [ "250 ms" , "250" ] ,
676677 [ "500 ms" , "500" ] ,
677678 [ "1 sec" , "1000" ]
678679 ] ) , "rate_" )
@@ -759,10 +760,10 @@ Blockly.Blocks['board_pin_state'] = {
759760 }
760761} ;
761762
762- Blockly . Blocks [ 'pin_new ' ] = {
763+ Blockly . Blocks [ 'pin_get ' ] = {
763764 init : function ( ) {
764765 this . appendDummyInput ( )
765- . appendField ( Blockly . Msg . WEBDUINO_PIN , "pin " )
766+ . appendField ( Blockly . Msg . WEBDUINO_PIN , "Pin " )
766767 . appendField ( new Blockly . FieldDropdown ( [
767768 [ "2" , "2" ] ,
768769 [ "3" , "3" ] ,
@@ -790,6 +791,71 @@ Blockly.Blocks['pin_new'] = {
790791 }
791792} ;
792793
794+ Blockly . Blocks [ 'pin_get_num' ] = {
795+ init : function ( ) {
796+ this . appendValueInput ( "number_" )
797+ . setCheck ( "Number" )
798+ . appendField ( Blockly . Msg . WEBDUINO_PIN , "Pin" ) ;
799+ this . appendValueInput ( "board_" )
800+ . setCheck ( "String" )
801+ . appendField ( Blockly . Msg . WEBDUINO_PIN_ON , "On" )
802+ . appendField ( Blockly . Msg . WEBDUINO_BOARD , "Board" ) ;
803+ this . setInputsInline ( true ) ;
804+ this . setOutput ( true ) ;
805+ this . setColour ( 230 ) ;
806+ this . setTooltip ( '' ) ;
807+ this . setHelpUrl ( 'http://www.example.com/' ) ;
808+ }
809+ } ;
810+
811+ Blockly . Blocks [ 'pin_set_mode' ] = {
812+ init : function ( ) {
813+ this . appendDummyInput ( )
814+ . appendField ( Blockly . Msg . WEBDUINO_PIN_SET , "Set" )
815+ . appendField ( new Blockly . FieldVariable ( "pin" ) , "pin_" )
816+ . appendField ( Blockly . Msg . WEBDUINO_PIN_MODE , "Mode" )
817+ . appendField ( new Blockly . FieldDropdown ( [
818+ [ Blockly . Msg . WEBDUINO_PIN_DIN , "0" ] ,
819+ [ Blockly . Msg . WEBDUINO_PIN_DOUT , "1" ] ,
820+ [ Blockly . Msg . WEBDUINO_PIN_AIN , "2" ] ,
821+ [ Blockly . Msg . WEBDUINO_PIN_AOUT , "3" ]
822+ ] ) , "mode_" ) ;
823+ this . setInputsInline ( true ) ;
824+ this . setPreviousStatement ( true ) ;
825+ this . setNextStatement ( true ) ;
826+ this . setColour ( 65 ) ;
827+ this . setTooltip ( '' ) ;
828+ this . setHelpUrl ( 'http://www.example.com/' ) ;
829+ }
830+ } ;
831+
832+ Blockly . Blocks [ 'pin_read' ] = {
833+ init : function ( ) {
834+ this . appendDummyInput ( )
835+ . appendField ( Blockly . Msg . WEBDUINO_PIN_READ )
836+ . appendField ( new Blockly . FieldVariable ( "pin" ) , "pin_" )
837+ . appendField ( Blockly . Msg . WEBDUINO_PIN_VALUE ) ;
838+ this . setOutput ( true ) ;
839+ this . setColour ( 65 ) ;
840+ this . setTooltip ( '' ) ;
841+ this . setHelpUrl ( 'http://www.example.com/' ) ;
842+ }
843+ } ;
844+
845+ Blockly . Blocks [ 'pin_write' ] = {
846+ init : function ( ) {
847+ this . appendValueInput ( "value_" )
848+ . appendField ( Blockly . Msg . WEBDUINO_PIN_WRITE )
849+ . appendField ( new Blockly . FieldVariable ( "pin" ) , "pin_" )
850+ . appendField ( Blockly . Msg . WEBDUINO_PIN_VALUE ) ;
851+ this . setPreviousStatement ( true ) ;
852+ this . setNextStatement ( true ) ;
853+ this . setColour ( 65 ) ;
854+ this . setTooltip ( '' ) ;
855+ this . setHelpUrl ( 'http://www.example.com/' ) ;
856+ }
857+ } ;
858+
793859Blockly . Blocks [ 'led_new' ] = {
794860 init : function ( ) {
795861 this . appendDummyInput ( )
0 commit comments