@@ -93,6 +93,22 @@ export default function (Generator) {
93
93
return `microbit_more.get_acceleration(${ axis } )\n` ;
94
94
} ;
95
95
96
+ Generator . microbitMore_getAnalogValue = function ( block ) {
97
+ const pin = Generator . valueToCode ( block , 'PIN' , Generator . ORDER_NONE ) || null ;
98
+ return `microbit_more.get_analog_value(${ pin } )\n` ;
99
+ } ;
100
+
101
+ Generator . microbitMore_getDigitalValue = function ( block ) {
102
+ const pin = Generator . valueToCode ( block , 'PIN' , Generator . ORDER_NONE ) || null ;
103
+ return `microbit_more.get_digital_value(${ pin } )\n` ;
104
+ } ;
105
+
106
+ Generator . microbitMore_setPinMode = function ( block ) {
107
+ const pin = Generator . valueToCode ( block , 'PIN' , Generator . ORDER_NONE ) || null ;
108
+ const mode = Generator . getFieldValue ( block , 'MODE' ) || null ;
109
+ return `microbit_more.set_pin_mode(${ pin } , ${ mode } )\n` ;
110
+ } ;
111
+
96
112
Generator . microbitMore_menu_buttons = function ( block ) {
97
113
const buttons = Generator . quote_ ( Generator . getFieldValue ( block , 'buttons' ) || 'A' ) ;
98
114
return [ buttons , Generator . ORDER_ATOMIC ] ;
@@ -128,6 +144,16 @@ export default function (Generator) {
128
144
return [ axis , Generator . ORDER_ATOMIC ] ;
129
145
} ;
130
146
147
+ Generator . microbitMore_menu_analogIn = function ( block ) {
148
+ const axis = Generator . getFieldValue ( block , 'analogIn' ) || '0' ;
149
+ return [ axis , Generator . ORDER_ATOMIC ] ;
150
+ } ;
151
+
152
+ Generator . microbitMore_menu_pinMode = function ( block ) {
153
+ const axis = Generator . getFieldValue ( block , 'pinMode' ) || 'pullUp' ;
154
+ return [ axis , Generator . ORDER_ATOMIC ] ;
155
+ } ;
156
+
131
157
Generator . matrix = function ( block ) {
132
158
let matrix = Generator . getFieldValue ( block , 'MATRIX' ) || '0000000000000000000000000' ;
133
159
matrix = matrix . replace ( / 0 / g, '.' ) ;
0 commit comments