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

Like this? Share it with your network

Share

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

on

  • 2,595 views

Slides for YAPC::Asia2011 by mandy_44

Slides for YAPC::Asia2011 by mandy_44

Statistics

Views

Total Views
2,595
Views on SlideShare
2,348
Embed Views
247

Actions

Likes
0
Downloads
2
Comments
0

4 Embeds 247

http://yapcasia.org 197
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でちょいモテ電子工作 Presentation Transcript

  • 1. YAPC::ASIA Tokyo ● 2011
    Pretty Electronic Engineering in Perl
    Yuki Manno (@mandy_44)
    2011/10/14
  • 2. ※ モテるかモテないかは自己責任でお願いします
  • 3. Myself
  • 4. Yuki Manno(@mandy_44)
    1986/06/10
    Aeronautics & Astronautics
    DeNA Co., Ltd.
  • 5. Arduino
  • 6. DIY (Do It Yourself)
    Open Source Hardware
    Micro Computer
    +
    IO Port
  • 7. Arduino MEGA ADK
    Arduino Bluetooth
    ArduinoLilyPad
  • 8. Digital In/Out
    USB Port
    AC In
    Analog In
    Power
  • 9. Tools
  • 10. Breadboard
    Jump Wire
    LED, LCD etc
  • 11. Input
    Output
    • USB
    • 12. Bluetooth
    • 13. Ethernet
    • 14. Various Sensors
    etc.
    • LED
    • 15. LCD
    • 16. Servo
    etc.
  • 17. Hello World!!
  • 18. Arduino IDE
    C based language
    Upload sketch to Arduino
    http://www.arduino.cc/
  • 19. 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
    }
  • 20.
    • PinMode
    • 21. OUTPUT
    • 22. INPUT
    • 23. Functions
    • 24. digitalWrite(pin_num, [HIGH|LOW])
    • 25. digitalRead(pin_num)
    • 26. analogWrite(pin_num, [0-255])
    • 27. analogRead(pin_num)
    http://arduino.cc/en/Reference/HomePage
  • 28. Firmata
  • 29. 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
  • 30. Normal Arduino
    Arduino
    LED
    LCD
    Sensor
    Sketch
    Servo
    Sensor
    Anything
    LED
    Arduino
    Host
    Firmata
    LCD
    Firmata
    Servo
  • 31. Processing
    JAVA based language
    Arduino Libraries
  • 32. Perl
  • 33. Device::Firmata
    • Module to use Firmata
    • 34. 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);
    }
  • 35. Demo
  • 36. Alalarm
    • Beep on mail arrival
    • 37. Hard to stop
    • 38. Get me up in midnight
    • 39. Using Amon2
  • Please mail to…
    mandy.alert@gmail.com
  • 40. Checker
    • Check unread mail
    • 41. Check flag
    • 42. Turn on beep
    WEB App
    • Make question
    • 43. Change flag
    +
    • Not simple
    • 44. Made Amon2 Plugin for Arduino-> Can’t make persistent connection.
    • 45. Need improvement of Firmata
  • Thank you so much for your attention.
  • 46. Any Question?