<commit_before>PySerial
========

Pyserial is an excellent way to grab data from your Arduino, and it is both robust and easy to implement.




The following examples shows a really simple approach for doing this, which will get you started.

**HOWEVER, be careful that the arduino is not constantly sending data to your program -- you will likely encounter errors from the buffer overfilling.**


### Naive Pyserial and Sketch

 #this code can be found in the `naive` folder

####naive.py

```python 

import serial

ser = serial.Serial('/dev/ttyACM0',115200)

f = open('dataFile.txt','a')

while 1 :
    f.write(ser.readline())
    ser.flushInput()
    ser.flushOutput()
    f.close()
    f = open('dataFile.txt','a')
```


####naive.ino
```c

void setup() {
  Serial.begin(115200);
}<commit_msg>markdown fixes on readme<commit_after>PySerial
========

Pyserial is an excellent way to grab data from your Arduino, and it is both robust and easy to implement.




The following examples shows a really simple approach for doing this, which will get you started.

**HOWEVER, be careful that the arduino is not constantly sending data to your program -- you will likely encounter errors from the buffer overfilling.**


### Naive Pyserial and Sketch

This code can be found in the `naive` folder

#### naive.py

```python 

import serial

ser = serial.Serial('/dev/ttyACM0',115200)

f = open('dataFile.txt','a')

while 1 :
    f.write(ser.readline())
    ser.flushInput()
    ser.flushOutput()
    f.close()
    f = open('dataFile.txt','a')
```


#### naive.ino
```c

void setup() {
  Serial.begin(115200);
}
{'fraction_non_alphanumeric': 0.12258867454884878, 'fraction_numerical': 0.017423771001866834, 'mean_word_length': 3.8580060422960725, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, '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': '7614512', 'n_tokens_mistral': 528, 'n_tokens_neox': 481, 'n_words': 191}