element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Personal Blogs
  • Community Hub
  • More
Personal Blogs
Legacy Personal Blogs My First Try Using The MagiQuest Wand With An Arduino
  • Blog
  • Documents
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
  • Share
  • More
  • Cancel
Group Actions
  • Group RSS
  • More
  • Cancel
Engagement
  • Author Author: Former Member
  • Date Created: 7 Feb 2015 3:49 AM Date Created
  • Views 3554 views
  • Likes 0 likes
  • Comments 3 comments
  • magiquest
  • arduino
  • wand
  • relay
Related
Recommended

My First Try Using The MagiQuest Wand With An Arduino

Former Member
Former Member
7 Feb 2015

So I have been looking around online for ways to use the MagiQuest wand at home, but have found very few solutions. I decided to make my own. Using the Arduino IR library I got some raw values from the wand using a old IR sensor from a VCR and then took those values and converted them from decimal to hex value using an online calculator. I just googled it and found one. Then made up some code that detected when a certain IR code was detected to activate my relay board and turn some lights off and on. My hook up is the IR sensor is on a breadboard connected to the Arduino, then I have jumper cabled hooked into a IDE cable because I only have male to male jumpers, then the IDE cable hooks into the relay board activating the relays. Right now I have 3 wands that the Arduino can interact with I can add more though.

image

#include <IRremote.h>

int RECV_PIN = 3; //

int led1 = 5;

int led2 = 6;

int led3 = 9;

int itsONled[] = {0,0,0,0};

#define code1  //Place your IR codes here

#define code2

#define code3

 

IRrecv irrecv(RECV_PIN);

 

decode_results results;

 

void setup()

{

  Serial.begin(9600);

  irrecv.enableIRIn();

  pinMode(led1, OUTPUT);

  pinMode(led3, OUTPUT); 

}

 

void loop() {

  if (irrecv.decode(&results)) {

    unsigned int value = results.value;

    switch(value) {

       case code1:

         if(itsONled[1] == 1) {     

            digitalWrite(led1, LOW); 

            itsONled[1] = 0;         

         } else {                    

             digitalWrite(led1, HIGH);

             itsONled[1] = 1;       

         }

          break;

       case code2:

         if(itsONled[2] == 1) {

            digitalWrite(led2, LOW);

            itsONled[2] = 0;

         } else {

             digitalWrite(led2, HIGH);

             itsONled[2] = 1;

         }

          break;

       case code3:

         if(itsONled[3] == 1) {

            digitalWrite(led3, LOW);

            itsONled[3] = 0;

         } else {

             digitalWrite(led3, HIGH);

             itsONled[3] = 1;

         }

          break;        

    }

    Serial.println(value);

    irrecv.resume();

  }

}

  • Sign in to reply
Parents
  • Former Member
    Former Member over 10 years ago

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

    I had to cut some parts where the Arduino wouldn't respond. A lot of signals get sent. Sometimes it receives and decodes the wrong one.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Comment
  • Former Member
    Former Member over 10 years ago

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

    You don't have permission to edit metadata of this video.
    Edit media
    x
    image
    Upload Preview
    image

    I had to cut some parts where the Arduino wouldn't respond. A lot of signals get sent. Sometimes it receives and decodes the wrong one.

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • More
    • Cancel
Children
No Data
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube