Internet Of Things Sensors
  • Cover
  • Summary
  • About This Training
    • Objectives
    • Skills
    • Prerequisites
    • Requirements
  • Once Upon a Time ...
  • Introduction
    • Topologies
    • Data Compression
  • Communication Protocols
    • I2C
      • Linux
      • Arduino
    • Serial Peripheral Interface
    • Serial Communication
      • Laboratory
        • Arduino and Linux
    • Infrared
    • Pulse Width Modulation
  • Microsystems Technologies
    • Actuators
    • Sensors
    • Transducers
  • Layers of Abstraction
    • IntelĀ® IoT Developer Kit Libraries
      • MRAA
      • UPM
      • Laboratory
      • Contributions
    • Linux I2C Device Interface
      • LCD RGB Color Display
      • LCD RGB Text
      • LCD RGB Display Off
      • Temperature
    • Linux I2C Subsystem
  • Data Engines
    • Sparkfun
  • Wrap-Up
    • Online Training
    • Challenge
  • References
  • Sandbox
Powered by GitBook
On this page
  • Linux Based Development Board
  • Arduino Based Board
  1. Communication Protocols
  2. Serial Communication
  3. Laboratory

Arduino and Linux

Linux Based Development Board

root@edison:~# stty -F /dev/ttyMFD1 9600
root@edison:~# nano helloserial.py
import mraa
import serial
import time

x=mraa.Uart(0)

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

while True:
     print ser.readline()
     time.sleep(.1)
root@edison:~# python helloserial.py

Arduino Based Board

#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());
}
PreviousLaboratoryNextInfrared

Last updated 7 years ago