# Arduino and Linux

## Linux Based Development Board

```bash
root@edison:~# stty -F /dev/ttyMFD1 9600
```

```bash
root@edison:~# nano helloserial.py
```

```python
import mraa
import serial
import time

x=mraa.Uart(0)

ser = serial.Serial('/dev/ttyMFD1', 9600)

while True:
     print ser.readline()
     time.sleep(.1)
```

```bash
root@edison:~# python helloserial.py
```

## Arduino Based Board

```c
#include <SoftwareSerial.h>

SoftwareSerial mySerial(0, 1);

void setup()
{
  mySerial.begin(9600);
}

void loop()
{
  mySerial.println("Hello Serial!");
  if (mySerial.available())
    Serial.write(mySerial.read());
}
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://theiotlearninginitiative.gitbook.io/internetofthingssensors/communication-protocols/serial-communication/laboratory/arduino-and-linux.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
