raspberrypi & arduino

Table of Contents

raspberrypi

It’s capable of doing everything you’d expect a desktop computer to do.

raspberrypi-model-b-plus.jpg

install operation system

  1. noobs

    raspberrypi-noobs.png

  2. linux distribution( debian, fedora, arch)
  3. RASPBMC(An XBMC Media Centre)
  4. any RISC OS

extra interface

  1. 40 pins GPIO(power and digital IO)

    raspiberry-gpio.jpg

  2. camera
  3. display(touch screen display)

arduino

arduino-uno.jpg

processor: microcontroller ATmega328

hardware interface

  1. 14 digital input/output pins
  2. 6 analog inputs
  3. light pin 13
  4. light pin 0,1
  5. 6 PWM outputs (Pulse-width modulation) PWM is used to control servomechanisms
  6. 16 MHz ceramic resonator(clock source)
  7. USB connection
  8. power jack
  9. ICSP header In-circuit serial programming 16KBytes Flash
  10. reset button

software interface

for ruby:

  1. SerialPort an implementation of RS232 serial ports with several low level functionalities to control signals on the line.
  2. rad a framework for programming the Arduino physcial computing platform using Ruby. it converts Ruby scripts written using a set of Rails-like conventions and helpers into C source code which can be compiled and run on the Arduino microcontroller.
  3. arduino_firmata
  4. dino examples with dino
  5. arduino
  6. artoo

demo

led control

arduino

prepare software

brew install gort
gem install firmata
gem install artoo-arduino

install gort for linux

plugin in aruidno via usb connector

gort scan serial
gort arduino upload firmata /dev/tty.usbmodem1411
require 'artoo'
connection :firmata, adaptor: :firmata, port: '/dev/cu.usbmodem1411'
device :led, driver: :led, pin: 13
device :button, driver: :button, pin: 2, interval: 0.01
work do
  puts "Press the button connected on pin #{ button.pin }..."
  on button, :push    => proc { puts 'on';  led.on }
  on button, :release => proc { puts 'off'; led.off }
end

raspiberry-pi

sudo gem install artoo-raspi artoo-gpio

connect to GPIO need root permission

require 'artoo'
connection :raspi, :adaptor => :raspi
device :led, :driver => :led, :pin => 11
work do
  every 1.second do
    led.toggle
  end
end

analog sensor

temperature

dc motor

servo

stepper

wiichuck

integrate with web app

wolfram language

knowledge based programming language examples for kids

wolfram alpha

computational knowledge service

Siri

wolfram language on pi

free and only free on every raspberry pi