YAPC2011-Perlでちょいモテ電子工作
Upcoming SlideShare
Loading in...5
×
 

YAPC2011-Perlでちょいモテ電子工作

on

  • 2,497 views

Slides for YAPC::Asia2011 by mandy_44

Slides for YAPC::Asia2011 by mandy_44

Statistics

Views

Total Views
2,497
Views on SlideShare
2,252
Embed Views
245

Actions

Likes
0
Downloads
2
Comments
0

4 Embeds 245

http://yapcasia.org 195
http://paper.li 37
http://us-w1.rockmelt.com 8
http://a0.twimg.com 5

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    YAPC2011-Perlでちょいモテ電子工作 YAPC2011-Perlでちょいモテ電子工作 Presentation Transcript

    • YAPC::ASIA Tokyo ● 2011
      Pretty Electronic Engineering in Perl
      Yuki Manno (@mandy_44)
      2011/10/14
    • ※ モテるかモテないかは自己責任でお願いします
    • Myself
    • Yuki Manno(@mandy_44)
      1986/06/10
      Aeronautics & Astronautics
      DeNA Co., Ltd.
    • Arduino
    • DIY (Do It Yourself)
      Open Source Hardware
      Micro Computer
      +
      IO Port
    • Arduino MEGA ADK
      Arduino Bluetooth
      ArduinoLilyPad
    • Digital In/Out
      USB Port
      AC In
      Analog In
      Power
    • Tools
    • Breadboard
      Jump Wire
      LED, LCD etc
    • Input
      Output
      • USB
      • Bluetooth
      • Ethernet
      • Various Sensors
      etc.
      • LED
      • LCD
      • Servo
      etc.
    • Hello World!!
    • Arduino IDE
      C based language
      Upload sketch to Arduino
      http://www.arduino.cc/
    • Blink LED
      voidsetup() {
      pinMode(13, OUTPUT);
      }
      void loop() {
      digitalWrite(13, HIGH); // set the LED on
      delay(1000); // wait for a second
      digitalWrite(13, LOW); // set the LED off
      delay(1000); // wait for a second
      }
      • PinMode
      • OUTPUT
      • INPUT
      • Functions
      • digitalWrite(pin_num, [HIGH|LOW])
      • digitalRead(pin_num)
      • analogWrite(pin_num, [0-255])
      • analogRead(pin_num)
      http://arduino.cc/en/Reference/HomePage
    • Firmata
    • Firmata a generic protocol for communicating with microcontrollers like the Arduino from software on a host computer.
      Host – Client Model
      http://www.arduino.cc/playground/Interfacing/Firmata
    • Normal Arduino
      Arduino
      LED
      LCD
      Sensor
      Sketch
      Servo
      Sensor
      Anything
      LED
      Arduino
      Host
      Firmata
      LCD
      Firmata
      Servo
    • Processing
      JAVA based language
      Arduino Libraries
    • Perl
    • Device::Firmata
      • Module to use Firmata
      • https://github.com/amimoto/perl-firmata
      use Device::Firmata;
      use Device::Firmata::Constants qw( :all );
      my $led_pin=13;
      my $arduino= Device::Firmata->open(‘/dev/ttyusb’);
      $arduino->pin_mode($led_pin=> PIN_OUTPUT);
      while (1) {
      $arduino->digital_write($led_pin => HIGH);
      sleep(1);
      $arduino->digital_write($led_pin => LOW);
      sleep(1);
      }
    • Demo
    • Alalarm
      • Beep on mail arrival
      • Hard to stop
      • Get me up in midnight
      • Using Amon2
    • Please mail to…
      mandy.alert@gmail.com
    • Checker
      • Check unread mail
      • Check flag
      • Turn on beep
      WEB App
      • Make question
      • Change flag
      +
      • Not simple
      • Made Amon2 Plugin for Arduino-> Can’t make persistent connection.
      • Need improvement of Firmata
    • Thank you so much for your attention.
    • Any Question?