Mock sensor data in simulator #1204
Unanswered
toysonlocation
asked this question in
Q&A
Replies: 1 comment
-
The source for simulators in the jacdac-docs web site are at https://github.com/microsoft/jacdac-ts/tree/main/src/servers . You can see that mostly they are just object holding the state of registers and don't have any logic in them. Back in the days, we also experiemented with loading sensors information from a CSV file at https://github.com/microsoft/jacdac-ts/blob/main/tests/jdom/servercsvsource.ts but we haven't done much with this lately. It is used here: https://github.com/microsoft/jacdac-ts/blob/main/tests/jdom/csvtrace.spec.ts |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Is there a makecode/JS example I can pull apart that simulates sensor data (e.g., light, orientation)? This is somewhat along the lines of the Unit Test question #505 in looking for the ability to do mocks. I think I understand that I need to make a server and publish data on the bus, but I'm unclear on all counts on how to implement such a thing, and make it available/functional in the simulator.
Beta Was this translation helpful? Give feedback.
All reactions