splits m:b simulator state
This commit is contained in:
22
sim/state/compass.ts
Normal file
22
sim/state/compass.ts
Normal file
@ -0,0 +1,22 @@
|
||||
namespace pxsim.input {
|
||||
export function compassHeading(): number {
|
||||
let b = board().compassState;
|
||||
if (!b.usesHeading) {
|
||||
b.usesHeading = true;
|
||||
runtime.queueDisplayUpdate();
|
||||
}
|
||||
return b.heading;
|
||||
}
|
||||
|
||||
export function magneticForce(): number {
|
||||
// TODO
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
namespace pxsim {
|
||||
export class CompassState {
|
||||
usesHeading = false;
|
||||
heading = 90;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user