Robosapien/WowWee IR arduino library
January 15, 2014 17 Comments
I got another robosapien in the trash, but this time is a robosapien V1. I didnt feel like tearing this one apart to have to run a cable to it to inject it into it’s brain, so I started messing with the library used here:
http://daverobertson63.wordpress.com/2013/05/05/updated-robosapien-ir-control-arduino/
The issue was, when using his code, it only worked from the arduino only, and only worked with the original robosapien V1 robot, so I tore apart his code and modified it to add in support for other WowWee products like V2 and roboraptor.
The issue was, his code was locked so that it could only handle sending 8 bit codes(one byte), but the V2 and other wowwee products use 12 bit codes, so a little bit of it had to be changed to handle the 12 bit codes. The IR codes use the same type of data being sent, same 8 bit codes, but uses a 4 bit identifier code that makes that specific remote only work on that robot.
Just download the standard IRremote library here:
http://www.righto.com/2009/08/multi-protocol-infrared-remote-library.html
and replace the normal files with the ones in this archive:
http://www18.zippyshare.com/v/95213422/file.html
mirror here:
https://drive.google.com/file/d/0BwYG1PFb3ZByaTAxMlJZS2pIM1E/edit?usp=sharing
Here’s a bit of an example for transmitting the codes out from the serial connection/usb.
/* Based on IRSend demo from ken Shirriffs library - this sends simple commands to a RoboSapien V1 using and IR Transmitter with Arduino */ #include <IRremote.h> IRsend irsend; // pin 3 as IR LED output int data; void setup() { Serial.begin(9600); } void loop() { while (Serial.available()> 0) { data = Serial.parseFloat(); // Serial.println(data); irsend.sendRSV1(data); irsend.sendRSV1(data); } }
The send irsend.sendRSV1 command can be changed to irsend.sendRSV2 to send the alternative codes for V2, robo raptor, or almost any of the wowwee robots. You’ll have to convert the hex addresses to decimal to input them, but you can easily do that with a python script or whatever. To just mess around with it, I was using the calculator on windows/linux and setting it in advanced/programming mode and clicked the hexadecimal circle, typed in the command on the site, then clicked decimal and it would show the decimal number.
Here’s a list of all commands for a bunch of the wowwee robots:
Robosapien V1 codes:
http://www.aibohack.com/robosap/ir_codes.htm
Robosapien V2 and other wowwee robots:
http://www.aibohack.com/robosap/ir_codes_v2.htm
on the V2 page, the 3xx is the 0011, aka the robot identifier code, to change to another robot, just change the 3 to whatever robot you are trying to control.
I hope that everything works good for everyone, It’s experimental still, but it works for me at least.