@@ -1841,9 +1841,9 @@ Blockly.Blocks['irrecv_on'] = {
18411841 init : function ( ) {
18421842 this . appendDummyInput ( )
18431843 . appendField ( new Blockly . FieldVariable ( "irrecv" ) , "name_" )
1844- . appendField ( Blockly . Msg . WEBDUINO_IRRECV_ON , "開始接收" ) ;
1844+ . appendField ( Blockly . Msg . WEBDUINO_IRRECV_ON , "開始接收" ) ;
18451845 this . appendStatementInput ( "on_" )
1846- . appendField ( Blockly . Msg . WEBDUINO_IRRECV_DO , "執行:" ) ;
1846+ . appendField ( Blockly . Msg . WEBDUINO_IRRECV_DO , "執行:" ) ;
18471847 this . setPreviousStatement ( true ) ;
18481848 this . setNextStatement ( true ) ;
18491849 this . setColour ( 65 ) ;
@@ -1856,7 +1856,7 @@ Blockly.Blocks['irrecv_val'] = {
18561856 init : function ( ) {
18571857 this . appendDummyInput ( )
18581858 . appendField ( new Blockly . FieldVariable ( "irrecv" ) , "name_" )
1859- . appendField ( Blockly . Msg . WEBDUINO_IRRECV_CODE , "接收的代碼" ) ;
1859+ . appendField ( Blockly . Msg . WEBDUINO_IRRECV_CODE , "接收的代碼" ) ;
18601860 this . setOutput ( true ) ;
18611861 this . setColour ( 65 ) ;
18621862 this . setTooltip ( '' ) ;
@@ -1868,7 +1868,7 @@ Blockly.Blocks['irrecv_off'] = {
18681868 init : function ( ) {
18691869 this . appendDummyInput ( )
18701870 . appendField ( new Blockly . FieldVariable ( "irrecv" ) , "name_" )
1871- . appendField ( Blockly . Msg . WEBDUINO_IRRECV_OFF , "停止接收" ) ;
1871+ . appendField ( Blockly . Msg . WEBDUINO_IRRECV_OFF , "停止接收" ) ;
18721872 this . setPreviousStatement ( true ) ;
18731873 this . setNextStatement ( true ) ;
18741874 this . setColour ( 65 ) ;
@@ -1881,20 +1881,9 @@ Blockly.Blocks['irrecv_off'] = {
18811881Blockly . Blocks [ 'irled_new' ] = {
18821882 init : function ( ) {
18831883 this . appendDummyInput ( )
1884- . appendField ( Blockly . Msg . WEBDUINO_IRLED , "紅外線發射,腳位:" )
1884+ . appendField ( Blockly . Msg . WEBDUINO_IRLED , "紅外線發射,腳位:" )
18851885 . appendField ( new Blockly . FieldDropdown ( [
1886- [ "2" , "2" ] ,
1887- [ "3" , "3" ] ,
1888- [ "4" , "4" ] ,
1889- [ "5" , "5" ] ,
1890- [ "6" , "6" ] ,
1891- [ "7" , "7" ] ,
1892- [ "8" , "8" ] ,
1893- [ "9" , "9" ] ,
1894- [ "10" , "10" ] ,
1895- [ "11" , "11" ] ,
1896- [ "12" , "12" ] ,
1897- [ "13" , "13" ]
1886+ [ "9" , "9" ]
18981887 ] ) , "pin_" ) ;
18991888 this . setOutput ( true ) ;
19001889 this . setColour ( 230 ) ;
@@ -1908,11 +1897,72 @@ Blockly.Blocks['irled_launch'] = {
19081897 this . appendValueInput ( "code_" )
19091898 . setCheck ( "String" )
19101899 . appendField ( new Blockly . FieldVariable ( "irled" ) , "name_" )
1911- . appendField ( Blockly . Msg . WEBDUINO_IRLED_LAUNCHCODE , "發射代碼 ( 十六進位,八碼 ):" ) ;
1900+ . appendField ( Blockly . Msg . WEBDUINO_IRLED_LAUNCHCODE , "發射代碼 ( 十六進位 ):" ) ;
19121901 this . setPreviousStatement ( true ) ;
19131902 this . setNextStatement ( true ) ;
19141903 this . setTooltip ( '' ) ;
19151904 this . setColour ( 65 ) ;
19161905 this . setHelpUrl ( 'http://www.example.com/' ) ;
19171906 }
1918- } ;
1907+ } ;
1908+
1909+
1910+ Blockly . Blocks [ 'adxl345_new' ] = {
1911+ init : function ( ) {
1912+ this . appendDummyInput ( )
1913+ . appendField ( "三軸加速度計,SDA" )
1914+ . appendField ( new Blockly . FieldDropdown ( [
1915+ [ "A4" , "4" ]
1916+ ] ) , "sda_" )
1917+ . appendField ( " SCL" )
1918+ . appendField ( new Blockly . FieldDropdown ( [
1919+ [ "A5" , "5" ]
1920+ ] ) , "scl_" ) ;
1921+ this . setOutput ( true ) ;
1922+ this . setColour ( 230 ) ;
1923+ this . setTooltip ( '' ) ;
1924+ this . setHelpUrl ( 'http://www.example.com/' ) ;
1925+ }
1926+ } ;
1927+
1928+ Blockly . Blocks [ 'adxl345_on' ] = {
1929+ init : function ( ) {
1930+ this . appendDummyInput ( )
1931+ . appendField ( new Blockly . FieldVariable ( "adxl" ) , "name_" )
1932+ . appendField ( "開始偵測" ) ;
1933+ this . appendStatementInput ( "on_" )
1934+ . appendField ( "執行:" ) ;
1935+ this . setPreviousStatement ( true ) ;
1936+ this . setNextStatement ( true ) ;
1937+ this . setColour ( 65 ) ;
1938+ this . setTooltip ( '' ) ;
1939+ this . setHelpUrl ( 'http://www.example.com/' ) ;
1940+ }
1941+ } ;
1942+
1943+ Blockly . Blocks [ 'adxl345_val' ] = {
1944+ init : function ( ) {
1945+ this . appendDummyInput ( )
1946+ . appendField ( new Blockly . FieldVariable ( "adxl" ) , "name_" )
1947+ . appendField ( "的" )
1948+ . appendField ( new Blockly . FieldDropdown ( [ [ "x" , "_x" ] , [ "y" , "_y" ] , [ "z" , "_z" ] , [ "roll" , "_r" ] , [ "pitch" , "_p" ] ] ) , "val_" )
1949+ . appendField ( "數值" ) ;
1950+ this . setOutput ( true ) ;
1951+ this . setTooltip ( '' ) ;
1952+ this . setColour ( 65 ) ;
1953+ this . setHelpUrl ( 'http://www.example.com/' ) ;
1954+ }
1955+ } ;
1956+
1957+ Blockly . Blocks [ 'adxl345_off' ] = {
1958+ init : function ( ) {
1959+ this . appendDummyInput ( )
1960+ . appendField ( new Blockly . FieldVariable ( "adxl" ) , "name_" )
1961+ . appendField ( "停止偵測" ) ;
1962+ this . setPreviousStatement ( true ) ;
1963+ this . setNextStatement ( true ) ;
1964+ this . setColour ( 65 ) ;
1965+ this . setTooltip ( '' ) ;
1966+ this . setHelpUrl ( 'http://www.example.com/' ) ;
1967+ }
1968+ } ;
0 commit comments