@@ -63,6 +63,36 @@ export default function (Generator) {
63
63
return `microbit_more.pin_connected?(${ pin } )\n` ;
64
64
} ;
65
65
66
+ Generator . microbitMore_getLightLevel = function ( ) {
67
+ return `microbit_more.light_level\n` ;
68
+ } ;
69
+
70
+ Generator . microbitMore_getTemperature = function ( ) {
71
+ return `microbit_more.temperature\n` ;
72
+ } ;
73
+
74
+ Generator . microbitMore_getCompassHeading = function ( ) {
75
+ return `microbit_more.compass_heading\n` ;
76
+ } ;
77
+
78
+ Generator . microbitMore_getPitch = function ( ) {
79
+ return `microbit_more.pitch\n` ;
80
+ } ;
81
+
82
+ Generator . microbitMore_getRoll = function ( ) {
83
+ return `microbit_more.roll\n` ;
84
+ } ;
85
+
86
+ Generator . microbitMore_getMagneticForce = function ( block ) {
87
+ const axis = Generator . valueToCode ( block , 'AXIS' , Generator . ORDER_NONE ) || null ;
88
+ return `microbit_more.get_magnetic_force(${ axis } )\n` ;
89
+ } ;
90
+
91
+ Generator . microbitMore_getAcceleration = function ( block ) {
92
+ const axis = Generator . valueToCode ( block , 'AXIS' , Generator . ORDER_NONE ) || null ;
93
+ return `microbit_more.get_acceleration(${ axis } )\n` ;
94
+ } ;
95
+
66
96
Generator . microbitMore_menu_buttons = function ( block ) {
67
97
const buttons = Generator . quote_ ( Generator . getFieldValue ( block , 'buttons' ) || 'A' ) ;
68
98
return [ buttons , Generator . ORDER_ATOMIC ] ;
@@ -93,6 +123,11 @@ export default function (Generator) {
93
123
return [ gpio , Generator . ORDER_ATOMIC ] ;
94
124
} ;
95
125
126
+ Generator . microbitMore_menu_axis = function ( block ) {
127
+ const axis = Generator . getFieldValue ( block , 'axis' ) || 'absolute' ;
128
+ return [ axis , Generator . ORDER_ATOMIC ] ;
129
+ } ;
130
+
96
131
Generator . matrix = function ( block ) {
97
132
let matrix = Generator . getFieldValue ( block , 'MATRIX' ) || '0000000000000000000000000' ;
98
133
matrix = matrix . replace ( / 0 / g, '.' ) ;
0 commit comments