GithubHelp home page GithubHelp logo

anmolagrwl / arduino_ir_remote Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shokai/arduino_ir_remote

0.0 2.0 0.0 339 KB

IR Learning Remote with Arduino and Ruby

License: MIT License

Ruby 73.77% Arduino 26.23%

arduino_ir_remote's Introduction

Arduino IR::Remote

This Rubygem provides a wrapper for IR-Learning-Remote that has been built using the Arduino.

Installation

Install Rubygem

% gem install arduino_ir_remote

Dependencies

Hardware Setup

  • Arduino Firmware
  • IR LED
    • Digital PIN 12
  • IR Receiver
    • Digital PIN 3
  • Temperature Sensor (optional)
    • Analog PIN 0
  • Additional Sensors (optional)
    • Analog PIN 1~5

IR Receiver + LED (Minimum setup)

IR Receiver + LED + Temperature Sensor + CdS

Usage

arduino_ir_remote command

% arduino_ir_remote --help
% arduino_ir_remote --list

Read IR Data

% arduino_ir_remote --read tv_on

Write IR Data

% arduino_ir_remote --write tv_on

Rubygem

Connect

require 'arduino_ir_remote'

ir = ArduinoIrRemote.connect   # use default device
ir = ArduinoIrRemote.connect "/dev/tty.usb-devicename"

Read IR DATA

ir.read do |data|
  p data
  ArduinoIrRemote::DATA["tv_on"] = data
  ArduinoIrRemote::DATA.save
end
ir.wait

Write IR DATA

ir.write ArduinoIrRemote::DATA["tv_on"]
ir.wait

Read Sensors

ir.temp_pin = 0  # set temperature sensor pin

loop do
  0.upto(5).each{ |i|
    puts "[analog#{i}] #{ir.analog_read i}"  # read analog input pin 0~5
  }
  puts "temp #{ir.temp_sensor}"  # read temperature sensor
  sleep 1
end

Test

% gem install bundler
% bundle install
% export ARDUINO=/dev/tty.usb-devicename
% bundle exec rake test

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

arduino_ir_remote's People

Contributors

shokai avatar

Watchers

James Cloos avatar Anmol Agrawal avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.