November 22, 2024, 08:10:05 PM

News:

Got VSA?  Want to use your Prop-SX?  Now you can!  See the VSA section of the Library forum for Prop-SX code that works with VSA.


Can a RC-4 be controlled with an Arduino

Started by robomaster-1, November 03, 2015, 12:30:08 AM

Previous topic - Next topic

robomaster-1

I would like to if the RC-4 Boards can be controlled by an Arduino? I have a project that I need to dim up and down AC Lights. I like the functions that the RC-4  has and would like to use it in my project.
Tim J. Lewis
Magic and Technology

livinlowe

I don't believe the RC-4 will "dim" lights in the way you want. The FC-4+ will however
Shawn
Scaring someone with a prop you built -- priceless!

JonnyMac

November 03, 2015, 08:54:54 AM #2 Last Edit: November 03, 2015, 09:04:03 AM by JonnyMac
As Shawn points out, the RC-4 is a switcher, however our new FC-4+ is a dimmer. And here's the deal: We have provided base source code so that you can build your project on the FC-4+. Yes, we encourage customers to "hack" (i.e., re-purpose) our boards. Once you've experienced the joys of multi-core programming, you may want to switch to the Propeller! And don't worry, if you can program the Arduino, you can pick up Spin (the native language of the Propeller) very quickly. I proved this at DEF CON 22 with the Propeller-powered badge: I showed hundreds of Arduino users how easy Spin is -- most responded with they couldn't believe how powerful it is while being so easy to program. Okay, enough proselytizing.

If you would rather use the Arduino you should select a soft serial driver. While I haven't tried it myself (I just found it for this response), you may want to give this driver a try:

-- https://github.com/nickstedman/SoftwareSerialWithHalfDuplex

Why? Because it does half-duplex coms over a single pin and allows daisy-chaining of devices which is the way our accessory boards operate.

If you want to stick with hardware serial some have suggested these connections on the Arduino side:


----+    4.7k
TX  |----VVVV---|
RX  |-----------+-----> 1-wire UART bus
----+


Just remember that every command you send to the FC-4+ will end up in the Arduino RX buffer and you must filter it before RXing the response (there's a built-in turn-around delay in the FC-4+ so you have plenty of time to flush your RX buffer after sending a command).
Jon McPhalen
EFX-TEK Hollywood Office