-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* generate unique profile for sounds on each client * change volume
- Loading branch information
Showing
16 changed files
with
76 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,4 +25,5 @@ machine.addClientFactory(jacdac.SRV_LED, devid => { | |
} | ||
}) | ||
client.setPixelColor(1, 0x00ff00) | ||
return client | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,7 @@ | ||
machine.addClientFactory(jacdac.SRV_LIGHT_LEVEL, devid => { | ||
machine.addClientFactory(jacdac.SRV_LIGHT_LEVEL, (devid, srvid, options) => { | ||
const client = new modules.LightLevelClient(devid) | ||
client.onLightLevelChangedBy(20, () => { | ||
machine.plot(client.lightLevel(), 100) | ||
machine.plot(client.lightLevel(), 100, options) | ||
}) | ||
return client | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
machine.addClientFactory(jacdac.SRV_MAGNETIC_FIELD_LEVEL, devid => { | ||
machine.addClientFactory(jacdac.SRV_MAGNETIC_FIELD_LEVEL, (devid, srvid, options) => { | ||
const client = new modules.MagneticFieldLevelClient(devid) | ||
client.onStrengthChangedBy(5, () => { | ||
const value = client.strength() | ||
machine.plot(value, 100) | ||
machine.plot(value, 100, options) | ||
}) | ||
return client | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,9 @@ | ||
machine.addClientFactory(jacdac.SRV_POTENTIOMETER, devid => { | ||
machine.addClientFactory(jacdac.SRV_POTENTIOMETER, (devid, srvid, options) => { | ||
const client = new modules.PotentiometerClient(devid) | ||
client.onPositionChangedBy(5, () => { | ||
const current = client.position() | ||
machine.plot(current, 100) | ||
machine.plot(current, 100, options) | ||
machine.microbit.emit(machine.POT_CHANGE, current) | ||
}) | ||
return client | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,5 @@ machine.addClientFactory(jacdac.SRV_SERVO, devid => { | |
client.setAngle(angle) | ||
} | ||
) | ||
return client | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters