Here is what I need to do.
Constantly send input from my PC (such as if a key is pressed or not). Send it to the ARC32 by USB. ARC32 runs its code and moves the servos ( if x=1 for example, 1 meaning the keyboard key is pressed )
I have had no luck what so ever figuring this out. I’m very new to USB communication.
Is there a easy straight forward solution that wouldn’t involve me spending hours learning new firmware terms?
It seems to me like you need to write two pieces of software.
First, on your PC, you will need a program that checks for pressed keys and send messages to the ARC32. This should be easy to do with any language that recognizes the keyboard and supports a COM port object. You should be able to open the virtual COM port by using the number that Windows assigned, and using a baud rate of your choice: 9600 or 115,200 kbps are two standard values. You can then send a byte, such as 1, when the desired key is pressed.
Second, on the ARC32, you will want to open its serial port using the same baud rate, and then steps through the sequence of movements for the servos each time a ‘1’ is received. Depending on the complexity of the movement, this can be quite easy or much harder. Are you simply moving a servo from one position to another and back, or do you have more complex movements such as moving the servos of an arm so that the arm moves between different positions with raised and lowered positions?
Ok I think I understand what you are saying. I’m looking to do very complex movements however if you just give me the basics I’m sure I can slowly get the hang of it, but for now I will start out with very simple one motor movements.
Assuming I find a way for the computer to send bits to the COM port, how do I make the ARC32 interpret them?
Perhaps you might also be able to send a message to the user Acidtech asking them to help with this thread since they work for Basic Micro, the makers of the ARC32.
If that case, we would recommend the BotBoarduino as an alternative. Although it can only control 12 servos, it is Arduino-based so there is a much larger support community.
Personally I am not sure the issue is what type of board you use. The issue is with developing the software to do what it is you wish to do. On both types of boards you can do something like:
Initialize the comm port
Initialize the servo system
Loop:
See if there is any data available on the comm port.
If So, read in the command.
decode the command
execute the command
go to loop…
With Arc32, you can do this, using the HSERIAL system and the HSERVO system. With Arduino you can use the Serial object and the Servo library. In either case in your program there is nothing special about it being a USB port, but instead the more interesting thing is that it is a hardware serial port (USART).
There is some Arc32 code sprinkled around the forums. For example with the Basic Atom Pro version of the Phoenix hexapod code base, this code also works with the Arc32 and uses some of the features of the Arc32, including the fact that the USB is a hardware serial port. As such there is a serial monitor that I implemented that allows me to enter commands over the Serial port and have the Phoenix do things, including for example go into Servo offset mode, where then different characters it receives causes different servos to move… This code has been posted in many places on this forum. Also may be somewhere up on the Lynxmotion github, but not sure. So awhile ago I put a version of it up on my github account: github.com/KurtE/Phoenix-Code/t … 02_1%20Ps2 The firle Phoenix_arc32_extras.bas has this code in it… I should note, that I have similar code in the Arduino and Linux code bases as well.
Well for starters there is very little support or documentation other than the manual which is of very little use to me at this point. I have found Polulu has an awesome servo controller that provides you with a software development kit to program it and create apps for your pc that could communicate with it. I personally find working with ARC32 the same as reinventing the wheel software wise.
Again not sure what your purpose for this thread. If you have issues with Basic Micro, then I suggest that post stuff there. Note many of us who are active on this forum are also active up on their forums as well as for many years most of the products that Lynxmotion sold used Processors built by Basic Micro…
If you are simply wanting a servo controller that simply moves servos from one point to another, where the PC is in control, by all means go with a servo controller. I have never used the Polulu controller, but if it works for you go for it. Also Lynxmotion has been selling the SSC-32 which is one of the defacto standards for servo controllers for several years now. Works great, several programs outer there for the PC to simply send out test commands to the controller. I do not believe the USB version is out yet, but even if it is not, you can easily use an FTDI to serial converter to hook one of these up.
The Arc32 is a different animal. It is not a specific purpose board, but is instead a very capable general purpose Micro controller. Personally I like the underlying processor, which does 32 bit math and the like… However at one point I know that Nathan had a program you could download to make the Arc32 act like an SSC-32. He did not implement the complete instruction set, but only the basics.
There is details about this up on their forum: forums.basicmicro.com/atompro-f4 … a47b21d5ec
Note: I don’t think very many people have played with this in awhile as there are a couple of lines of code that no longer compile, but I was able to resolve that in a couple of minutes…
Again just trying to help. If you wish to go with something else, that you think will work better for you, I would be the last person to tell you not to, as I keep experimenting with many different boards. So have some fun
Kurt
I’m not blaming anyone. I just hope people in the future will read this post and not spend so much money on something that may not have this USB capability, if that’s what they need it for. It’s a great product nevertheless.