Skip to content
This repository has been archived by the owner on Nov 25, 2024. It is now read-only.

Commit

Permalink
Added variable text colours to sensor boxes in dataRecorder + Fixed i…
Browse files Browse the repository at this point in the history
…mage links in USER_GUIDE.MD
  • Loading branch information
KierPalin committed Sep 6, 2024
1 parent e0087a3 commit 850c2d3
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
10 changes: 5 additions & 5 deletions USER_GUIDE.MD
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# MicroData
![home_screen](https://github.com/KierPalin/MicroData/blob/main/resources/MicroData_1_5.jpg?raw=true)
![home_screen](https://github.com/KierPalin/MicroData/blob/main/resources/MicroData_1_5.png?raw=true)

MicroData is an open-source project meaning that modification and experimentation is encouraged!
See the ![experiments](https://github.com/KierPalin/MicroData/blob/main/EXPERIMENTS.MD) guide for a walkthrough that uses MicroData in two example experiments.
Expand All @@ -17,18 +17,18 @@ The latest stable release of MicroData is available ![here](https://github.com/K
* 020: Out of memory! Your program is so big that it does not fit in memory anymore… or we have a memory leak somewhere. Try resetting the micro:bit. This could occur if the datalog has a huge number of entries. You could try copying the MY_DATA.HTM file from the Microbit onto your PC and then resetting the datalog - either via MicroData or by deleting the MY_DATA.HTM file that is on the Microbit.

# Real-time graphing
MicroData can be used to see the readings of multiple sensors at once in real-time. The image below shows the accelerometer and temperature readings. You can scoll up and down to see information about these sensors, pressing A allows you to enable or disable them. Pressing A on the main graph will alow you to zoom in for a better view. ![live_data_viewer](https://github.com/KierPalin/MicroData/blob/main/resources/live_data_viewer.jpg?raw=true)
MicroData can be used to see the readings of multiple sensors at once in real-time. The image below shows the accelerometer and temperature readings. You can scoll up and down to see information about these sensors, pressing A allows you to enable or disable them. Pressing A on the main graph will alow you to zoom in for a better view. ![live_data_viewer](https://github.com/KierPalin/MicroData/blob/main/resources/live_data_viewer.png?raw=true)
Selecting the analog pins as sensors and connecting a wire to the pins of the Arcade Shield will allow you to see the flow of current in real-time.

# Recording data
MicroData allows you to select and independently configure multiple sensors to log at once. The information about the sensor, the time the reading was taken and the value of the sensor are stored in flash storage. This means that the information persists even when unpowered, and that you can see them on device. These logs can be viewed in a tabular format without the need of an connection to an external device. Connecting the microbit to a computer also allows you to get the MY_DATA.HTM file that contains these logs. Below are images of the tabular data viewer - which shows the logs for the 3 accelerometers.

![tabular_data_viewer_1](https://github.com/KierPalin/MicroData/blob/main/resources/tabular_data_viewer_1.jpg?raw=true)
![tabular_data_viewer_1](https://github.com/KierPalin/MicroData/blob/main/resources/tabular_data_viewer_1.png?raw=true)
You can scroll left and right to see the other columns:
![tabular_data_viewer_2](https://github.com/KierPalin/MicroData/blob/main/resources/tabular_data_viewer_2.jpg?raw=true)
![tabular_data_viewer_2](https://github.com/KierPalin/MicroData/blob/main/resources/tabular_data_viewer_2.png?raw=true)

MicroData also supports recording events. You can configure a sensor to only record readings that match an inequality condition - such as only taking a log of the temperature when the reading is > 20. The screen below shows the configuration screen for the Accelerometer on the X dimension. This screen is entered after pressing 'Done' on the sensor select screen().
![configuration_selection](https://github.com/KierPalin/MicroData/blob/main/resources/configuration_selection.jpg?raw=true)
![configuration_selection](https://github.com/KierPalin/MicroData/blob/main/resources/configuration_selection.png?raw=true)


# Distributed Logging (Commander Mode)
Expand Down
6 changes: 4 additions & 2 deletions dataRecorder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ namespace microcode {
const MAX_SENSORS_ON_SCREEN: number = 5
/** The colours that will be used for the lines & sensor information boxes */
const SENSOR_BOX_COLORS: number[] = [2,3,4,6,7,9]
/** The colours that will be used for writing the information about the sensor. */
const SENSOR_BOX_TEXT_COLORS: number[] = [1,1,1,1,15,15]

/**
* Responsible for invoking the logging commands for each sensor,
Expand Down Expand Up @@ -177,13 +179,13 @@ namespace microcode {
// Write the sensor information:
//------------------------------
const sensorInfo: string[] = (sensor.isInEventMode) ? sensor.getEventInformation() : sensor.getRecordingInformation();
sensorInfo.forEach((info) => {
sensorInfo.forEach((info, idx) => {
y += 12
screen().print(
info,
24,
y,
15
SENSOR_BOX_TEXT_COLORS[idx]
)
});
}
Expand Down

0 comments on commit 850c2d3

Please sign in to comment.