Skip to content

Commit

Permalink
Some calibration stuff for UV
Browse files Browse the repository at this point in the history
  • Loading branch information
tahnok committed Aug 31, 2024
1 parent 2dc9854 commit ed3f2ed
Show file tree
Hide file tree
Showing 39 changed files with 122 additions and 20 deletions.
2 changes: 1 addition & 1 deletion movement/movement_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@
#include "movement_faces.h"

const watch_face_t watch_faces[] = {
simple_clock_face,
si1133_uv_face,
simple_clock_face,
set_time_face,
thermistor_readout_face,
voltage_face
Expand Down
16 changes: 9 additions & 7 deletions movement/watch_faces/sensor/si1133_uv_face.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ void si1133_uv_face_setup(movement_settings_t *settings, uint8_t watch_face_inde
state->needs_setup = true;
state->current_mux = SI1133_ADCMUX_UV;
state->current_hw_gain = SI1133_HW_GAIN_11;
state->current_sw_gain = SI1133_SW_GAIN_2;
state->current_sw_gain = SI1133_SW_GAIN_0;
state->hist_mode = si1133_hist_last_ten;
}
// Do any pin or peripheral setup here; this will be called whenever the watch wakes from deep sleep.
si1133_init();
Expand Down Expand Up @@ -90,7 +91,7 @@ static void settings_draw(si1133_uv_state_t *state) {
watch_display_string(buf, 0);
}

static void save_history(si1133_uv_state_t *state, uint16_t new_reading) {
static void __attribute__((optimize("O0"))) save_history(si1133_uv_state_t *state, uint32_t volatile new_reading) {
state->history[state->hist_loc] = new_reading;
state->hist_loc = (state->hist_loc + 1) % SI1133_HIST_LEN;
}
Expand Down Expand Up @@ -136,7 +137,7 @@ static void main_draw(si1133_uv_state_t *state) {
SI1133_RANGING_OFF,
state->current_hw_gain,
state->current_sw_gain,
SI1133_16_BIT,
SI1133_24_BIT,
SI1133_POST_SHIFT_0,
SI1133_THRESH_DISABLE,
SI1133_COUNTER_DISABLE
Expand Down Expand Up @@ -182,9 +183,10 @@ static void main_draw(si1133_uv_state_t *state) {

uint8_t hostout0 = watch_i2c_read8(SI1133_ADDR, SI1133_REG_HOSTOUT0);
uint8_t hostout1 = watch_i2c_read8(SI1133_ADDR, SI1133_REG_HOSTOUT1);
uint16_t adccount = hostout0 << 8 | hostout1;
uint8_t hostout2 = watch_i2c_read8(SI1133_ADDR, SI1133_REG_HOSTOUT2);
uint32_t adccount = (hostout0 << 16) | (hostout1 << 8) | (hostout2);
save_history(state, adccount);
uint16_t to_draw = 0;
uint32_t to_draw = 0;
uint8_t hist_mode = 0;
switch(state->hist_mode) {
case si1133_hist_current:
Expand All @@ -200,9 +202,9 @@ static void main_draw(si1133_uv_state_t *state) {
hist_mode = 0x80;
break;
}
sprintf(buf, "%02x%02x%04x ", hist_mode, to_draw, adccount);
sprintf(buf, "%02x%08lx", hist_mode, to_draw);
watch_display_string(buf, 0);
printf("reading: %04x\r\n", adccount);
printf("reading: %08lx\r\n", adccount);
printf("reading count: %02x\r\n", state->readings);
printf("current mux: %02x\r\n", state->current_mux);
state->readings++;
Expand Down
3 changes: 2 additions & 1 deletion movement/watch_faces/sensor/si1133_uv_face.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,15 @@ typedef struct {
si1133_hw_gain current_hw_gain;
si1133_sw_gain current_sw_gain;
si1133_hist_mode hist_mode;
uint16_t history[SI1133_HIST_LEN];
uint32_t history[SI1133_HIST_LEN];
size_t hist_loc;
} si1133_uv_state_t;

void si1133_uv_face_setup(movement_settings_t *settings, uint8_t watch_face_index, void ** context_ptr);
void si1133_uv_face_activate(movement_settings_t *settings, void *context);
bool si1133_uv_face_loop(movement_event_t event, movement_settings_t *settings, void *context);
void si1133_uv_face_resign(movement_settings_t *settings, void *context);
void measuring_alarm_button(si1133_uv_state_t *state);

#define si1133_uv_face ((const watch_face_t){ \
si1133_uv_face_setup, \
Expand Down
6 changes: 3 additions & 3 deletions uv-calibration/dump-gdb
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ target remote :2331
monitor halt
monitor reset 2
file build/watch.elf
#load
load

break ../watch_faces/sensor/si1133_uv_face.c:186
break save_history
command 1
p new_reading
append value raw/trace_log new_reading
append value trace.log new_reading
continue
end

Expand Down
19 changes: 19 additions & 0 deletions uv-calibration/fetch_current_uv.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#!/bin/bash

LAT="46.97"
LON="-64.10"
ALT="16"

OPENUV_API_KEY="openuv-5rtarlzefb7lr-io"
PIRATE_WEATHER_API_KEY="3s61kZ7eFhtuK98DXZ1vF7ztWanCWHqU"

NOW=$(date +%Y-%m-%d-%H-%M)

curl -sS -X GET "https://api.openuv.io/api/v1/uv?lat=$LAT&lng=$LON&alt=$ALT&dt=" \
-H 'x-access-token: $OPENUV_API_KEY' \
-o "weather/openuv-$NOW.json"

curl -sS "https://api.pirateweather.net/forecast/$PIRATE_WEATHER_API_KEY/$LAT,$LON?excluse=minutely,hourly,daily,alerts" \
-o "weather/pirateweather-$NOW.json"

jq .currently.uvIndex < "weather/pirateweather-$NOW.json"
Binary file added uv-calibration/raw/2024-08-05-09-20.raw
Binary file not shown.
Binary file added uv-calibration/raw/2024-08-05-11-29.raw
Binary file not shown.
Binary file added uv-calibration/raw/2024-08-05-13-06.raw
Binary file not shown.
Binary file added uv-calibration/raw/2024-08-05-15-02.raw
Binary file not shown.
Binary file added uv-calibration/raw/2024-08-05-15-03.raw
Binary file not shown.
Binary file added uv-calibration/raw/2024-08-05-15-04.raw
Binary file not shown.
Binary file added uv-calibration/raw/2024-08-06-12-05.raw
Binary file not shown.
Binary file added uv-calibration/raw/2024-08-11-15-01.raw
Binary file not shown.
1 change: 1 addition & 0 deletions uv-calibration/readings/2024-08-04-13-00_uvi-3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"recorded_at": "2024-08-04T13:00:00", "uvi": 3, "sw_gain": 0, "hw_gain": 11, "derived": {"min": 0, "max": 2304, "mean": 227.0188679245283, "mode": 256, "stdev": 223.83069095788025, "variance": 50100.1782146821}, "raw_readings": [256, 512, 256, 0, 768, 0, 512, 0, 0, 0, 0, 256, 0, 0, 256, 256, 256, 256, 0, 512, 0, 0, 256, 256, 256, 256, 256, 512, 0, 256, 256, 256, 0, 256, 512, 512, 0, 256, 0, 256, 512, 256, 256, 0, 0, 0, 256, 768, 512, 256, 256, 256, 512, 256, 0, 256, 0, 0, 0, 256, 256, 0, 256, 256, 256, 256, 512, 256, 256, 512, 512, 256, 512, 512, 0, 256, 0, 256, 512, 256, 256, 256, 256, 256, 512, 256, 0, 256, 256, 256, 0, 0, 256, 768, 256, 0, 256, 0, 0, 512, 256, 512, 256, 0, 256, 256, 256, 256, 0, 0, 256, 256, 256, 0, 256, 256, 256, 256, 0, 256, 0, 256, 256, 0, 256, 256, 256, 256, 0, 256, 256, 256, 512, 256, 256, 0, 256, 256, 512, 256, 256, 0, 256, 256, 768, 512, 512, 512, 512, 256, 512, 256, 256, 0, 256, 0, 0, 0, 512, 768, 512, 0, 256, 0, 0, 0, 256, 512, 0, 0, 256, 512, 256, 256, 0, 0, 256, 0, 0, 512, 0, 256, 256, 512, 0, 256, 0, 0, 512, 0, 512, 0, 256, 256, 512, 512, 0, 0, 0, 0, 0, 256, 0, 0, 256, 2304, 0, 512, 0, 1536, 0, 256, 512, 256, 768, 0, 0, 256, 256, 256, 256, 0, 512, 256, 0, 256, 512, 256, 256, 0, 0, 512, 512, 0, 512, 256, 256, 256, 0, 0, 512, 256, 0, 0, 0, 0, 512, 256, 256, 256, 256, 0, 256, 0, 256, 256, 256, 0, 256, 0, 0, 512, 512, 256, 0, 256, 512, 256, 512, 256, 0, 512, 512, 256, 256, 0, 256, 256, 0, 256, 512, 256, 0, 512, 256, 0, 512, 256, 0, 0, 256, 256, 256, 256, 256, 0, 0, 256, 256, 256, 256, 0, 0, 0, 0, 0, 0, 0, 512, 0, 256, 256, 256, 0, 256, 256, 768, 256, 256, 256, 256, 256, 512, 0, 256, 0, 256, 256, 256, 256, 256, 256, 256, 0, 256, 256, 512, 256, 0, 512, 512, 0, 0, 0, 0, 256, 0, 256, 256, 512, 256, 256, 0, 256, 256, 256, 0, 256, 0, 512, 0, 256, 0, 0, 0, 0, 0, 256, 0, 256, 256, 256, 0, 256, 0, 0, 256, 256, 256, 256, 256, 0, 0, 0, 768, 768, 512, 512, 0, 512, 0, 0, 768, 0, 512, 0, 0, 0, 256, 0, 0, 256, 256, 256, 0, 256, 512, 0, 512, 0, 256, 256, 0, 512, 256, 256, 256, 0, 256, 0, 0, 256, 512, 256, 0, 0, 512, 256, 256, 256, 0, 512, 512, 256, 0, 0, 256, 0, 256, 256, 512, 256, 256, 512, 256, 256, 256, 256, 0, 256, 0, 256, 512, 256, 512, 256, 0, 256, 512, 0, 512, 256, 256, 256, 256, 256, 256, 256, 256, 0, 0, 256, 256, 0, 0, 0, 256], "raw_dump": "AAEAAAACAAAAAQAAAAAAAAADAAAAAAAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAAAAAACAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAIAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAACAAAAAgAAAAAAAAABAAAAAAAAAAEAAAACAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAwAAAAIAAAABAAAAAQAAAAEAAAACAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAIAAAABAAAAAQAAAAIAAAACAAAAAQAAAAIAAAACAAAAAAAAAAEAAAAAAAAAAQAAAAIAAAABAAAAAQAAAAEAAAABAAAAAQAAAAIAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAMAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAIAAAABAAAAAgAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAABAAAAAAAAAAEAAAABAAAAAQAAAAIAAAABAAAAAQAAAAAAAAABAAAAAQAAAAIAAAABAAAAAQAAAAAAAAABAAAAAQAAAAMAAAACAAAAAgAAAAIAAAACAAAAAQAAAAIAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAgAAAAMAAAACAAAAAAAAAAEAAAAAAAAAAAAAAAAAAAABAAAAAgAAAAAAAAAAAAAAAQAAAAIAAAABAAAAAQAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAIAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAAAAAACAAAAAAAAAAEAAAABAAAAAgAAAAIAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAAAAEAAAAJAAAAAAAAAAIAAAAAAAAABgAAAAAAAAABAAAAAgAAAAEAAAADAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAAAAAAIAAAABAAAAAAAAAAEAAAACAAAAAQAAAAEAAAAAAAAAAAAAAAIAAAACAAAAAAAAAAIAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAIAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAIAAAABAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAAAAAAAAIAAAACAAAAAQAAAAAAAAABAAAAAgAAAAEAAAACAAAAAQAAAAAAAAACAAAAAgAAAAEAAAABAAAAAAAAAAEAAAABAAAAAAAAAAEAAAACAAAAAQAAAAAAAAACAAAAAQAAAAAAAAACAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAADAAAAAQAAAAEAAAABAAAAAQAAAAEAAAACAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAABAAAAAQAAAAIAAAABAAAAAAAAAAIAAAACAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAQAAAAEAAAACAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAAAAAAAgAAAAAAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAAAAAAAAAAAAAAAAAMAAAADAAAAAgAAAAIAAAAAAAAAAgAAAAAAAAAAAAAAAwAAAAAAAAACAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAACAAAAAAAAAAIAAAAAAAAAAQAAAAEAAAAAAAAAAgAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAgAAAAEAAAAAAAAAAAAAAAIAAAABAAAAAQAAAAEAAAAAAAAAAgAAAAIAAAABAAAAAAAAAAAAAAABAAAAAAAAAAEAAAABAAAAAgAAAAEAAAABAAAAAgAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAABAAAAAgAAAAEAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAACAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAQAA"}
1 change: 1 addition & 0 deletions uv-calibration/sessions/2024-08-05-09-20_uvi-1.65.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"recorded_at": "2024-08-05T09:20:00", "uvi": 1.65, "sw_gain": 0, "hw_gain": 11, "derived": {"min": 0, "max": 3328, "mean": 316.1212121212121, "mode": 256, "stdev": 423.0344585661993, "variance": 178958.1531343974}, "raw_readings": [512, 512, 0, 256, 256, 512, 256, 256, 256, 256, 512, 512, 256, 512, 256, 512, 0, 256, 256, 256, 256, 512, 256, 0, 512, 0, 256, 256, 256, 256, 256, 512, 256, 512, 256, 0, 256, 256, 256, 256, 512, 0, 256, 0, 512, 256, 256, 512, 256, 512, 512, 256, 256, 0, 256, 256, 256, 256, 256, 1280, 0, 0, 0, 0, 0, 256, 0, 256, 768, 512, 256, 256, 256, 0, 256, 0, 512, 256, 0, 256, 512, 0, 512, 0, 0, 256, 256, 256, 256, 256, 256, 0, 256, 256, 256, 0, 256, 1536, 1280, 256, 512, 512, 256, 3328, 0, 0, 0, 256, 0, 0, 0, 2560, 768, 512, 256, 512, 0, 0, 1024, 512, 768, 256, 0, 0, 0, 0, 0, 256, 0, 256, 0, 256], "raw_dump": "AAIAAAACAAAAAAAAAAEAAAABAAAAAgAAAAEAAAABAAAAAQAAAAEAAAACAAAAAgAAAAEAAAACAAAAAQAAAAIAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAIAAAABAAAAAAAAAAIAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAACAAAAAQAAAAIAAAABAAAAAAAAAAEAAAABAAAAAQAAAAEAAAACAAAAAAAAAAEAAAAAAAAAAgAAAAEAAAABAAAAAgAAAAEAAAACAAAAAgAAAAEAAAABAAAAAAAAAAEAAAABAAAAAQAAAAEAAAABAAAABQAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAABAAAAAwAAAAIAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAACAAAAAQAAAAAAAAABAAAAAgAAAAAAAAACAAAAAAAAAAAAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAEAAAABAAAAAAAAAAEAAAAGAAAABQAAAAEAAAACAAAAAgAAAAEAAAANAAAAAAAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAAAAAAoAAAADAAAAAgAAAAEAAAACAAAAAAAAAAAAAAAEAAAAAgAAAAMAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAABAAAAAAAAAAEAAAAAAAAAAQAA"}
1 change: 1 addition & 0 deletions uv-calibration/sessions/2024-08-05-11-30_uvi-4.87.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"recorded_at": "2024-08-05T11:30:00", "uvi": 4.87, "sw_gain": 0, "hw_gain": 11, "derived": {"min": 0, "max": 3840, "mean": 676.2264150943396, "mode": 512, "stdev": 615.2006762492238, "variance": 378471.8720575023}, "raw_readings": [256, 0, 0, 0, 0, 0, 2048, 1792, 0, 0, 0, 512, 1536, 768, 512, 1280, 768, 768, 512, 768, 256, 768, 512, 512, 2304, 1536, 0, 0, 1024, 1280, 1792, 1024, 1280, 768, 0, 1280, 768, 0, 0, 1024, 0, 0, 512, 768, 256, 512, 768, 768, 512, 512, 768, 512, 768, 256, 512, 1024, 512, 3840, 0, 0, 512, 512, 768, 768, 1024, 512, 512, 256, 512, 512, 512, 512, 512, 768, 768, 512, 512, 512, 512, 256, 512, 768, 512, 512, 256, 1024, 768, 768, 256, 0, 768, 256, 1536, 1792, 1536, 1280, 2560, 512, 768, 512, 1280, 256, 0, 0, 1024, 512], "raw_dump": "AAEAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAgAAAAHAAAAAAAAAAAAAAAAAAAAAgAAAAYAAAADAAAAAgAAAAUAAAADAAAAAwAAAAIAAAADAAAAAQAAAAMAAAACAAAAAgAAAAkAAAAGAAAAAAAAAAAAAAAEAAAABQAAAAcAAAAEAAAABQAAAAMAAAAAAAAABQAAAAMAAAAAAAAAAAAAAAQAAAAAAAAAAAAAAAIAAAADAAAAAQAAAAIAAAADAAAAAwAAAAIAAAACAAAAAwAAAAIAAAADAAAAAQAAAAIAAAAEAAAAAgAAAA8AAAAAAAAAAAAAAAIAAAACAAAAAwAAAAMAAAAEAAAAAgAAAAIAAAABAAAAAgAAAAIAAAACAAAAAgAAAAIAAAADAAAAAwAAAAIAAAACAAAAAgAAAAIAAAABAAAAAgAAAAMAAAACAAAAAgAAAAEAAAAEAAAAAwAAAAMAAAABAAAAAAAAAAMAAAABAAAABgAAAAcAAAAGAAAABQAAAAoAAAACAAAAAwAAAAIAAAAFAAAAAQAAAAAAAAAAAAAABAAAAAIAAA=="}
1 change: 1 addition & 0 deletions uv-calibration/sessions/2024-08-05-13-05_uvi-6.85.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"recorded_at": "2024-08-05T13:05:00", "uvi": 6.85, "sw_gain": 0, "hw_gain": 11, "derived": {"min": 0, "max": 12544, "mean": 685.3333333333334, "mode": 512, "stdev": 1311.378050344353, "variance": 1719712.3909249564}, "raw_readings": [768, 512, 0, 512, 256, 0, 1024, 768, 0, 512, 512, 512, 768, 512, 0, 256, 0, 768, 512, 512, 256, 512, 0, 512, 768, 512, 512, 256, 512, 768, 256, 512, 512, 256, 0, 0, 512, 2560, 1024, 512, 256, 1024, 512, 512, 1024, 512, 256, 512, 512, 512, 512, 256, 512, 512, 256, 512, 512, 512, 256, 512, 768, 512, 512, 512, 512, 768, 512, 768, 256, 768, 512, 512, 512, 256, 512, 768, 512, 512, 768, 256, 512, 256, 768, 1024, 512, 512, 512, 256, 0, 512, 512, 512, 256, 512, 512, 512, 512, 256, 512, 512, 768, 512, 768, 512, 512, 256, 512, 512, 256, 0, 512, 512, 512, 256, 512, 512, 2304, 0, 512, 0, 256, 512, 512, 512, 0, 256, 256, 256, 512, 256, 1280, 0, 512, 512, 512, 768, 512, 512, 768, 512, 0, 512, 2048, 1024, 256, 0, 768, 512, 512, 256, 256, 1280, 512, 512, 256, 0, 6912, 0, 10240, 0, 2304, 1024, 256, 3328, 512, 512, 2816, 0, 4352, 0, 0, 256, 0, 768, 256, 512, 512, 512, 512, 512, 512, 512, 512, 256, 768, 256, 512, 768, 256, 256, 12544, 256], "raw_dump": "AAMAAAACAAAAAAAAAAIAAAABAAAAAAAAAAQAAAADAAAAAAAAAAIAAAACAAAAAgAAAAMAAAACAAAAAAAAAAEAAAAAAAAAAwAAAAIAAAACAAAAAQAAAAIAAAAAAAAAAgAAAAMAAAACAAAAAgAAAAEAAAACAAAAAwAAAAEAAAACAAAAAgAAAAEAAAAAAAAAAAAAAAIAAAAKAAAABAAAAAIAAAABAAAABAAAAAIAAAACAAAABAAAAAIAAAABAAAAAgAAAAIAAAACAAAAAgAAAAEAAAACAAAAAgAAAAEAAAACAAAAAgAAAAIAAAABAAAAAgAAAAMAAAACAAAAAgAAAAIAAAACAAAAAwAAAAIAAAADAAAAAQAAAAMAAAACAAAAAgAAAAIAAAABAAAAAgAAAAMAAAACAAAAAgAAAAMAAAABAAAAAgAAAAEAAAADAAAABAAAAAIAAAACAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAACAAAAAQAAAAIAAAACAAAAAgAAAAIAAAABAAAAAgAAAAIAAAADAAAAAgAAAAMAAAACAAAAAgAAAAEAAAACAAAAAgAAAAEAAAAAAAAAAgAAAAIAAAACAAAAAQAAAAIAAAACAAAACQAAAAAAAAACAAAAAAAAAAEAAAACAAAAAgAAAAIAAAAAAAAAAQAAAAEAAAABAAAAAgAAAAEAAAAFAAAAAAAAAAIAAAACAAAAAgAAAAMAAAACAAAAAgAAAAMAAAACAAAAAAAAAAIAAAAIAAAABAAAAAEAAAAAAAAAAwAAAAIAAAACAAAAAQAAAAEAAAAFAAAAAgAAAAIAAAABAAAAAAAAABsAAAAAAAAAKAAAAAAAAAAJAAAABAAAAAEAAAANAAAAAgAAAAIAAAALAAAAAAAAABEAAAAAAAAAAAAAAAEAAAAAAAAAAwAAAAEAAAACAAAAAgAAAAIAAAACAAAAAgAAAAIAAAACAAAAAgAAAAEAAAADAAAAAQAAAAIAAAADAAAAAQAAAAEAAAAxAAAAAQAA"}
1 change: 1 addition & 0 deletions uv-calibration/sessions/2024-08-05-15-05_uvi-6.68.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"recorded_at": "2024-08-05T15:05:00", "uvi": 6.68, "sw_gain": 0, "hw_gain": 11, "derived": {"min": 0, "max": 512, "mean": 226.018018018018, "mode": 256, "stdev": 160.94437107737127, "variance": 25903.090581490582}, "raw_readings": [0, 256, 256, 0, 512, 0, 0, 256, 512, 256, 256, 0, 256, 256, 256, 256, 256, 0, 0, 0, 0, 256, 256, 256, 256, 0, 0, 0, 0, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 256, 512, 256, 512, 256, 256, 256, 256, 256, 512, 256, 256, 0, 256, 256, 256, 0, 256, 0, 0, 256, 0, 256, 256, 256, 0, 256, 256, 256, 0, 512, 512, 256, 512, 256, 0, 512, 256, 256, 256, 256, 512, 256, 512, 0, 0, 256, 512, 256, 256, 512, 0, 256, 256, 512, 256, 0, 256, 256, 0, 512, 512, 256, 256, 0, 256, 256, 256, 0, 0], "raw_dump": "AAAAAAABAAAAAQAAAAAAAAACAAAAAAAAAAAAAAABAAAAAgAAAAEAAAABAAAAAAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAAAAAAAAAAAAAAAAAAAAAAEAAAABAAAAAQAAAAEAAAAAAAAAAAAAAAAAAAAAAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAEAAAABAAAAAQAAAAIAAAABAAAAAgAAAAEAAAABAAAAAQAAAAEAAAABAAAAAgAAAAEAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAAAAAAAAAAABAAAAAAAAAAEAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAgAAAAIAAAABAAAAAgAAAAEAAAAAAAAAAgAAAAEAAAABAAAAAQAAAAEAAAACAAAAAQAAAAIAAAAAAAAAAAAAAAEAAAACAAAAAQAAAAEAAAACAAAAAAAAAAEAAAABAAAAAgAAAAEAAAAAAAAAAQAAAAEAAAAAAAAAAgAAAAIAAAABAAAAAQAAAAAAAAABAAAAAQAAAAEAAAAAAAAAAAAA"}
1 change: 1 addition & 0 deletions uv-calibration/sessions/2024-08-06-12-04_uvi-5.42.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"recorded_at": "2024-08-06T12:04:00", "uvi": 5.42, "sw_gain": 0, "hw_gain": 11, "derived": {"min": 0, "max": 2048, "mean": 476.6896551724138, "mode": 512, "stdev": 332.32285019483567, "variance": 110438.4767616192}, "raw_readings": [256, 256, 256, 256, 0, 256, 0, 0, 512, 512, 512, 256, 0, 0, 768, 256, 1536, 0, 512, 512, 512, 256, 256, 768, 256, 512, 512, 0, 0, 512, 768, 0, 768, 1024, 512, 768, 256, 256, 256, 1536, 512, 256, 1280, 256, 512, 512, 2048, 0, 512, 256, 768, 768, 512, 512, 768, 768, 1024, 0, 768, 256, 512, 256, 256, 512, 768, 0, 512, 256, 512, 512, 512, 512, 256, 768, 768, 256, 512, 256, 768, 256, 768, 256, 512, 0, 512, 512, 512, 512, 768, 256, 512, 256, 256, 768, 512, 512, 512, 256, 512, 0, 512, 512, 512, 512, 768, 768, 256, 512, 512, 768, 512, 512, 256, 512, 1024, 512], "raw_dump": "AAEAAAABAAAAAQAAAAEAAAAAAAAAAQAAAAAAAAAAAAAAAgAAAAIAAAACAAAAAQAAAAAAAAAAAAAAAwAAAAEAAAAGAAAAAAAAAAIAAAACAAAAAgAAAAEAAAABAAAAAwAAAAEAAAACAAAAAgAAAAAAAAAAAAAAAgAAAAMAAAAAAAAAAwAAAAQAAAACAAAAAwAAAAEAAAABAAAAAQAAAAYAAAACAAAAAQAAAAUAAAABAAAAAgAAAAIAAAAIAAAAAAAAAAIAAAABAAAAAwAAAAMAAAACAAAAAgAAAAMAAAADAAAABAAAAAAAAAADAAAAAQAAAAIAAAABAAAAAQAAAAIAAAADAAAAAAAAAAIAAAABAAAAAgAAAAIAAAACAAAAAgAAAAEAAAADAAAAAwAAAAEAAAACAAAAAQAAAAMAAAABAAAAAwAAAAEAAAACAAAAAAAAAAIAAAACAAAAAgAAAAIAAAADAAAAAQAAAAIAAAABAAAAAQAAAAMAAAACAAAAAgAAAAIAAAABAAAAAgAAAAAAAAACAAAAAgAAAAIAAAACAAAAAwAAAAMAAAABAAAAAgAAAAIAAAADAAAAAgAAAAIAAAABAAAAAgAAAAQAAAACAAA="}
1 change: 1 addition & 0 deletions uv-calibration/sessions/2024-08-06-15-00_uvi-6.57.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"recorded_at": "2024-08-06T15:00:00", "uvi": 6.57, "sw_gain": 0, "hw_gain": 11, "derived": {"min": 0, "max": 1024, "mean": 526.0917431192661, "mode": 512, "stdev": 222.6171577230159, "variance": 49558.39891267414}, "raw_readings": [512, 512, 256, 0, 768, 512, 256, 256, 0, 512, 512, 256, 256, 256, 512, 512, 256, 512, 0, 256, 1024, 512, 768, 768, 512, 1024, 768, 512, 768, 1024, 768, 0, 512, 512, 512, 0, 256, 256, 256, 256, 256, 768, 512, 768, 512, 0, 512, 512, 768, 768, 512, 768, 512, 768, 512, 512, 512, 512, 768, 512, 768, 256, 512, 768, 512, 512, 512, 768, 768, 512, 512, 768, 512, 512, 256, 512, 768, 768, 512, 512, 768, 256, 512, 768, 256, 512, 512, 768, 512, 512, 512, 768, 768, 512, 512, 512, 768, 768, 512, 512, 512, 512, 512, 768, 512, 512, 512, 512, 768], "raw_dump": "AAIAAAACAAAAAQAAAAAAAAADAAAAAgAAAAEAAAABAAAAAAAAAAIAAAACAAAAAQAAAAEAAAABAAAAAgAAAAIAAAABAAAAAgAAAAAAAAABAAAABAAAAAIAAAADAAAAAwAAAAIAAAAEAAAAAwAAAAIAAAADAAAABAAAAAMAAAAAAAAAAgAAAAIAAAACAAAAAAAAAAEAAAABAAAAAQAAAAEAAAABAAAAAwAAAAIAAAADAAAAAgAAAAAAAAACAAAAAgAAAAMAAAADAAAAAgAAAAMAAAACAAAAAwAAAAIAAAACAAAAAgAAAAIAAAADAAAAAgAAAAMAAAABAAAAAgAAAAMAAAACAAAAAgAAAAIAAAADAAAAAwAAAAIAAAACAAAAAwAAAAIAAAACAAAAAQAAAAIAAAADAAAAAwAAAAIAAAACAAAAAwAAAAEAAAACAAAAAwAAAAEAAAACAAAAAgAAAAMAAAACAAAAAgAAAAIAAAADAAAAAwAAAAIAAAACAAAAAgAAAAMAAAADAAAAAgAAAAIAAAACAAAAAgAAAAIAAAADAAAAAgAAAAIAAAACAAAAAgAAAAMAAA=="}
26 changes: 26 additions & 0 deletions uv-calibration/start_reading.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/bin/bash
set -e

# start JLink GBD server
echo "starting JLinkGDBServer in background"
nohup JLinkGDBServer -device ATSAML22J18A -if SWD &
sleep 5

arm-none-eabi-gdb <<EOF
set pagination off
target remote :2331
monitor halt
monitor reset 2
file ../movement/make/build/watch.elf
load
break save_history
command 1
p new_reading
append value raw/$(date +%Y-%m-%d-%H-%M).raw new_reading
continue
end
continue
EOF
Loading

0 comments on commit ed3f2ed

Please sign in to comment.