Hi,
an experiment to move a Little Crane arm (used some Lego parts) up and down via IR Remote Control (Key1=UP,Key2=DOWN). When the arm moves, the Red LED lights else the Green LED is on.
The IR Remote Control key codes are depended on the Remote Control device. Initially test those via Log output in Sub Looper1. Lookup this thread. From the IRremote.zip file copy the files IRremote.cpp, IRremote.h, IRremoteInt.h to rCore folder in the B4R internal libraries folder.
The Servo Motor used is a Modelcraft Mini-Servo MC1811. The motor moves the arm between 10 and 90 degrees angle. Depending on the servo motor used, pressing multiple times the IR Remote Control button might be required to move the crane arm .
If the servo motor is not moving, its starts to jitter. To avoid jittering, the servo motor is detached and attached again when pressing a IR Remote Control Key. (there are various threads in the Arduino forums about this problem; tried several solutions where as detach and attach works best).
This experiment is just a starter and open for any creative enhancements esp using Lego Technic. More to come. Enjoy
Components
Arduino MEGA, Mini-Servo MC1811, SunFounder IR Receiver, LED red & green with resitors 220Ohm.
Libraries
rServo 0.9
Circuit
Code
The B4J documented code is attached. The wiring connections are listed in the B4R project file.
Prototype
v20160616
an experiment to move a Little Crane arm (used some Lego parts) up and down via IR Remote Control (Key1=UP,Key2=DOWN). When the arm moves, the Red LED lights else the Green LED is on.
The IR Remote Control key codes are depended on the Remote Control device. Initially test those via Log output in Sub Looper1. Lookup this thread. From the IRremote.zip file copy the files IRremote.cpp, IRremote.h, IRremoteInt.h to rCore folder in the B4R internal libraries folder.
The Servo Motor used is a Modelcraft Mini-Servo MC1811. The motor moves the arm between 10 and 90 degrees angle. Depending on the servo motor used, pressing multiple times the IR Remote Control button might be required to move the crane arm .
If the servo motor is not moving, its starts to jitter. To avoid jittering, the servo motor is detached and attached again when pressing a IR Remote Control Key. (there are various threads in the Arduino forums about this problem; tried several solutions where as detach and attach works best).
This experiment is just a starter and open for any creative enhancements esp using Lego Technic. More to come. Enjoy
Components
Arduino MEGA, Mini-Servo MC1811, SunFounder IR Receiver, LED red & green with resitors 220Ohm.
Libraries
rServo 0.9
Circuit
Code
The B4J documented code is attached. The wiring connections are listed in the B4R project file.
Prototype
v20160616
Attachments
Last edited: