taweili / ardublock

ArduBlock is a Block Programming Language for Arduino.
GNU General Public License v3.0
413 stars 292 forks source link

Generic hardware block for Ken Shirrif's IR Lib? #116

Open sraney opened 9 years ago

sraney commented 9 years ago

Would it be possible to add 2 generic hardware blocks for Ken Shirrif's Multi-Protocol Infrared Remote Library for the Arduino? I've noticed the two listed in the hardware side's are odd. The MakeBlock one is for custom hardware, and the DFRobot's Digital IR Receiver Module just pulls the status of the pin# and does not tie into Ken Shirrif's IR Lib. The examples on their page requires it. http://www.dfrobot.com/wiki/index.php?title=Digital_IR_Receiver_Module_%28SKU:DFR0094%29

I would love to dive into creating this, but I have no idea where to start on it.

I was thinking along the lines of:

irLEDRec:

include

int RECV_PIN = ## // Set via block, must be PWM? IRrecv irrecv(RECV_PIN); // initialize the lib.

setup:

irrecv.enableIRIn() // Start the receiver

actions:

if (irrecv.decode(&results)) { Serial.println(results.value, HEX) // example of use of the lib irrecv.resume() // Receive the next value