0
YAPC::ASIA  Tokyo ● 2011<br />Pretty Electronic Engineering in Perl <br />Yuki Manno (@mandy_44)<br />2011/10/14<br />
※ モテるかモテないかは自己責任でお願いします<br />
Myself<br />
Yuki Manno(@mandy_44)<br />1986/06/10<br />Aeronautics & Astronautics<br />DeNA Co., Ltd.<br />
Arduino<br />
DIY (Do It Yourself)<br />Open Source Hardware<br />Micro Computer<br />+<br />IO Port<br />
Arduino MEGA ADK<br />Arduino Bluetooth<br />ArduinoLilyPad<br />
Digital In/Out<br />USB Port<br />AC In<br />Analog In<br />Power<br />
Tools<br />
Breadboard<br />Jump Wire<br />LED, LCD etc<br />
Input<br />Output<br /><ul><li>USB
Bluetooth
Ethernet
Various Sensors</li></ul>etc.<br /><ul><li>LED
LCD
Servo</li></ul>etc.<br />
Hello World!!<br />
Arduino IDE<br />C based language<br />Upload  sketch to Arduino<br />http://www.arduino.cc/<br />
Blink LED<br />voidsetup() {                <br />pinMode(13, OUTPUT);     <br />}<br />void loop() {<br />digitalWrite(13...
<ul><li>PinMode
OUTPUT
INPUT
Functions
digitalWrite(pin_num, [HIGH|LOW])
digitalRead(pin_num)
analogWrite(pin_num, [0-255])
analogRead(pin_num)</li></ul>http://arduino.cc/en/Reference/HomePage<br />
Upcoming SlideShare
Loading in...5
×

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

2,200

Published on

Slides for YAPC::Asia2011 by mandy_44

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
2,200
On Slideshare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

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

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

    Clipping is a handy way to collect important slides you want to go back to later.

×