Differences

This shows you the differences between two versions of the page.

Link to this comparison view

iothings:laboratoare:2025:lab6 [2025/10/28 19:45]
dan.tudose [What AI/ML + IoT actually is]
iothings:laboratoare:2025:lab6 [2025/10/28 19:55] (current)
dan.tudose [3. Logging training data]
Line 89: Line 89:
 Run script that logs with label stationary: Run script that logs with label stationary:
  
-''​python ​collect_data.py -stationary --port /​dev/​ttyUSB0 --baud 115200''​+<code> python3 ​collect_data.py -stationary --port /​dev/​ttyUSB0 --baud 115200 ​</​code>​
  
-Get ~10 seconds of data then hit Ctrl+C. The script will automatically save the collected data into ''​raw_data_label_0.csv''​+Get ~10 seconds of data then hit Ctrl+C. The script will automatically save the collected data into ''​raw_data_label0.csv''​
  
 === Run B: "​shake"​ capture (label = 1) === === Run B: "​shake"​ capture (label = 1) ===
Line 98: Line 98:
 Run script #2 that logs with label shaking: Run script #2 that logs with label shaking:
  
-''​python ​collect_data.py -shaking --port /​dev/​ttyUSB0 --baud 115200''​+<code> python3 ​collect_data.py -shaking --port /​dev/​ttyUSB0 --baud 115200 ​</​code>​
  
-Get ~10 seconds of data then hit Ctrl+C. The script will automatically save the collected data into ''​raw_data_label_1.csv''​+Get ~10 seconds of data then hit Ctrl+C. The script will automatically save the collected data into ''​raw_data_label1.csv''​
  
  
-Then we’ll merge the two CSVs in the next step.+Thenwe’ll merge the two CSVs in the next step.
  
 ==== 4. Training the model ==== ==== 4. Training the model ====
Line 122: Line 122:
  
 Download the main.cpp code from [[iothings:​laboratoare:​2025_code:​lab6_4|here]]. Download the main.cpp code from [[iothings:​laboratoare:​2025_code:​lab6_4|here]].
 +
 +Your final project structure should look like this:
 +
 +<​code>​
 +include/
 +  |-LSM6DSL.h
 +  |-model.h
 +src/
 +  |-LSM6DSL.cpp
 +  |-main.cpp
 +platformio.ini
 +</​code>​
  
 When it’s running: When it’s running:
   * Keep the board still → LED should be off (prob_shake < 0.5).   * Keep the board still → LED should be off (prob_shake < 0.5).
   * Shake the board → LED should go green (prob_shake > 0.5).   * Shake the board → LED should go green (prob_shake > 0.5).
iothings/laboratoare/2025/lab6.1761673519.txt.gz · Last modified: 2025/10/28 19:45 by dan.tudose
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0