Skip to content

Commit

Permalink
Changed the sampling rate to 1kHz
Browse files Browse the repository at this point in the history
  • Loading branch information
oyama committed Jun 19, 2024
1 parent 90005c8 commit abca5a9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion EXAMPLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
|-----------------|-------------------------------------------------------------------------|
| [hello](examples/hello) | Hello filesystem world. |
| [fs\_inits](examples/fs_inits) | Examples of file system layout combinations. |
| [multicore\_logger](examples/multicore_logger) | Multi-core 500 Hz sampling rate sensor data stored on SD card |
| [multicore\_logger](examples/multicore_logger) | Multi-core 1kHz sampling rate sensor data stored on SD card |
| [elastic\_mqtt\_client](examples/elastic_mqtt_client) |Implements an MQTT client with a local queue to handle network disconnections seamlessly. |
| [usb\_logger](examples/usb_logger) | Data logger that mounts littlefs and FAT on flash memory and shares it with a PC via USB mass storage class.|
| [benchmark](examples/benchmark)| Data transfer tests with different block devices and different file system combinations.|
Expand Down
1 change: 1 addition & 0 deletions examples/multicore_logger/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
add_executable(multicore_logger main.c fs_init.c)
target_compile_options(multicore_logger PRIVATE -O2)
target_link_libraries(multicore_logger PRIVATE
pico_stdlib
pico_util
Expand Down
6 changes: 5 additions & 1 deletion examples/multicore_logger/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
#include "filesystem/vfs.h"

#if !defined(SAMPLING_RATE_HZ)
#define SAMPLING_RATE_HZ 500
#define SAMPLING_RATE_HZ 1000
#endif

typedef struct {
Expand All @@ -32,6 +32,8 @@ typedef struct {
} sensor_data_t;

queue_t sensor_queue;
static char write_buffer[1024 * 64];


static float normal_random(float mean, float stddev) {
static bool has_spare = false;
Expand Down Expand Up @@ -89,6 +91,8 @@ int main(void) {
if (fp == NULL) {
printf("fopen failed: %s\n", strerror(errno));
}
setvbuf(fp, write_buffer, _IOFBF, sizeof(write_buffer));

fprintf(fp, "Time,AccelX,AccelY,AccelZ,GyroX,GyroY,GyroZ,MagX,MagY,Magz\n");

multicore_reset_core1();
Expand Down

0 comments on commit abca5a9

Please sign in to comment.