more tinkering
This commit is contained in:
parent
fb4a0c2e16
commit
aad9f0fd8a
@ -106,7 +106,7 @@ namespace sensors.internal {
|
||||
}
|
||||
}
|
||||
|
||||
function init() {
|
||||
export function init() {
|
||||
if (sensorInfos) return
|
||||
sensorInfos = []
|
||||
for (let i = 0; i < DAL.NUM_INPUTS; ++i) sensorInfos.push(new SensorInfo(i))
|
||||
|
@ -55,7 +55,7 @@ namespace motors {
|
||||
Size = 12
|
||||
}
|
||||
|
||||
function init() {
|
||||
export function init() {
|
||||
if (pwmMM) return
|
||||
pwmMM = control.mmap("/dev/lms_pwm", 0, 0)
|
||||
if (!pwmMM) control.fail("no PWM file")
|
||||
|
@ -2,5 +2,6 @@
|
||||
console.addListener(function(priority: ConsolePriority, msg: string) {
|
||||
control.dmesg(msg.substr(0, msg.length - 1))
|
||||
})
|
||||
|
||||
// boot sequence
|
||||
brick.showBoot();
|
@ -194,15 +194,11 @@ namespace brick {
|
||||
// pulse green, play startup sound, turn off light
|
||||
brick.setStatusLight(StatusLight.GreenPulse);
|
||||
// We pause for 100ms to give time to read sensor values, so they work in on_start block
|
||||
pause(400)
|
||||
sensors.internal.init();
|
||||
motors.init();
|
||||
pause(800)
|
||||
// and we're ready
|
||||
brick.setStatusLight(StatusLight.Off);
|
||||
// always show port by default if no UI is set
|
||||
control.runInParallel(function () {
|
||||
// show ports if nothing is has been shown
|
||||
if (screenMode != ScreenMode.None) return;
|
||||
showPorts();
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user