@@ -8,13 +8,14 @@ import {
88 MICROBIT_HAL_PIN_P0 ,
99 MICROBIT_HAL_PIN_P1 ,
1010 MICROBIT_HAL_PIN_P2 ,
11+ MICROBIT_HAL_PIN_P3 ,
1112} from "./constants" ;
1213import * as conversions from "./conversions" ;
1314import { DataLogging } from "./data-logging" ;
1415import { Display } from "./display" ;
1516import { FileSystem } from "./fs" ;
1617import { Microphone } from "./microphone" ;
17- import { Pin } from "./pins" ;
18+ import { Pin , StubPin , TouchPin } from "./pins" ;
1819import { Radio } from "./radio" ;
1920import { RangeSensor , State } from "./state" ;
2021import { ModuleWrapper } from "./wasm" ;
@@ -121,17 +122,24 @@ export class Board {
121122 ) ,
122123 ] ;
123124 this . pins = Array ( 33 ) ;
124- this . pins [ MICROBIT_HAL_PIN_FACE ] = new Pin (
125+ this . pins [ MICROBIT_HAL_PIN_FACE ] = new TouchPin (
125126 "pinLogo" ,
126127 {
127128 element : this . svg . querySelector ( "#Logo" ) ! ,
128129 label : ( ) => this . formattedMessage ( { id : "touch-logo" } ) ,
129130 } ,
130131 onChange
131132 ) ;
132- this . pins [ MICROBIT_HAL_PIN_P0 ] = new Pin ( "pin0" , null , onChange ) ;
133- this . pins [ MICROBIT_HAL_PIN_P1 ] = new Pin ( "pin1" , null , onChange ) ;
134- this . pins [ MICROBIT_HAL_PIN_P2 ] = new Pin ( "pin2" , null , onChange ) ;
133+ this . pins [ MICROBIT_HAL_PIN_P0 ] = new TouchPin ( "pin0" , null , onChange ) ;
134+ this . pins [ MICROBIT_HAL_PIN_P1 ] = new TouchPin ( "pin1" , null , onChange ) ;
135+ this . pins [ MICROBIT_HAL_PIN_P2 ] = new TouchPin ( "pin2" , null , onChange ) ;
136+ for ( let pin = 3 ; pin <= 19 ; ++ pin ) {
137+ if ( pin === 17 || pin === 18 ) {
138+ continue ;
139+ }
140+ this . pins [ pin ] = new StubPin ( `pin${ pin } ` ) ;
141+ }
142+
135143 this . audio = new Audio ( ) ;
136144 this . temperature = new RangeSensor ( "temperature" , - 5 , 50 , 21 , "°C" ) ;
137145 this . accelerometer = new Accelerometer ( onChange ) ;
0 commit comments