<commit_before># examples

This repository contains simple example code to help users get started with Rhoeby Dynamics products.<commit_msg>Add screenshot of program output<commit_after># examples

This repository contains simple example code to help users get started with Rhoeby Dynamics products.

## r2d_radar_plot.c

This program does the following:
  
  - connects to the R2D Scanner
  - starts the scanner
  - recieves and plots the scan data

Screenshot of program output:

![R2D radar screenshot](https://github.com/jordanjohnp/images/blob/master/r2d_radar_plot_screenshot.png)

The program updates the console each time the scan completes.

## How to build and run

Build the example program in Linux (eg. Ubuntu on a PC):

    sudo gcc r2d_radar_plot.c -o r2d_radar_plot -lm

Connect scanner via USB

    - plug in scanner
    - type 'lsusb', you should see something like: "Bus 002 Device 074: ID 0483:5740 STMicroelectronics"
    - confirm sensor blue LED is flashing
    - you could verify *binary* data flow from the scanner, type: 'cat /dev/ttyACM0' (use Ctrl-C to exit)

To run (after plugging in the Rhoeby R2D Scanner to the USB port on your Linux PC):

    sudo chmod 777 /dev/ttyACM0
    
{'fraction_non_alphanumeric': 0.058726220016542596, 'fraction_numerical': 0.021505376344086023, 'mean_word_length': 3.84, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 1, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6085408', 'n_tokens_mistral': 400, 'n_tokens_neox': 357, 'n_words': 160}