-
Notifications
You must be signed in to change notification settings - Fork 20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
how to modify firmware for a tiny robotic arm and mirror the blocks in s4a? #4
Comments
Hi Davis, Thank you for reaching out. I find that a good place to start with creating these firmata libraries for S4A is to first get the device working on a plain old Arduino with C code - have you done that yet, or have you only played with the Arduino through S4A? I'd me more than happy to help you out and get S4A working with the uArm. It sounds like a really great application for S4A. I haven't had time yet to take a good look through the link that you supplied with more information about the uArm, but if you could specify what types of S4A blocks would go along well with the uArm that would be a huge help! For example you said that a 'move' block would be handy, what other blocks would you like to have at your disposal? Also, where will the uArm's be used? Is it a personal project or a classroom environment. I'll do my best to take a look into this request within a week or so. Is there a specific deadline by which it would be ideal to have the uArm working completely with S4A? All the best, Matt |
Hi Mdcanham, Firstly, thank you for you reply. Actually, what I would like to achieve is just utilizing the c++ library provided by uArm office, in that case I would not need to write any code for controlling the machine. Adding these functions to the firmware, and mirror them in S4A, so that I could control the uArm in real time. I don't really need to consider what kind of new blocks would be included in S4A, cause uArm office has already done this in their C++ library. The 'move' command I referred before contains three parameters, which stands for x, y, z. To successfully use this command in S4A, I need to add its function in StandardFirmata.ino file, which will include uarm_library.h of course, and next I should make a new block in S4A for this function, which can be achieved in the form of JavaScript funtion I think (I am not sure, cause sometimes it works, but sometimes not). Now I am a student in university, my idea is to excite teenagers to learn about coding by adding some fun during the process, and I believe that use real-time coding to control the real world things would excite them more easily. Actually S4A has already achieved this, what I am doing now is just make it support a kind of new device. So this work is just for making more fun for teenagers. Currently, I am doing this all by myself, which is a little hard actually. But it's very funny, I never feel tired and hope to make it come true, the earlier the better. Looking forward to seeing your reply, thanks a lot. Davis |
Hi Dave, Awesome to hear that you are aiming to get teenagers excited to code, this is the exact reason that I set up this collection of firmata libraries. I am also at University and realise how rewarding it can be to do something like this on the side. I don't actually own a uArm, which makes developing and testing a uArm Firmata library somewhat difficult. I have created a new branch called uArm-library where I have placed a new version of Firmata and a new blocks file (afd1205) that will allow you to use the moveTo function from within S4A (at least I hope it will). It would be awesome if you could test out this new library with your uArm and see if it works. If it does work then I will continue to work on other blocks in the uArm library so that you have full control from S4A. If it does not work then we need to get this working before moving onto more blocks so feel free to submit a pull request with a fix or describe the problem to me and I can have a go at fixing it. Good luck, Matt |
Hi Matt, I am really happy to know that you are trying to build the s4a-library for uArm, so nice of you. Unfortunately, it seems not work after trying using them, there is no any response when the moveTo block being clicked. Can you please reconsider about modifying the firmware or JavaScript function, I don't really know which part has problems. To make this thing go more quickly, I think I can join you. Can you please show me some details about modifying StandardFirmata to make it suit for some specific devices? What should be considered, which part should be changed and so on ... Thank you so much. All the best. Davis |
Here are the basics of how to modify Firmata and how to create custom blocks: http://blog.s4a.cat/2015/03/13/Extending-Firmata-for-Snap4Arduino.html. You can also look at the custom libraries that I have built for more examples. Can you please confirm for me that you are uploading the new version of Firmata to your Arduino before testing? Starting at line 520 in the uArmFirmata.ino file you will find a case statement which is where Firmata handles what the Arduino does. At the moment it just makes a call to the uarm.moveTo method. The code that makes S4A actually call this method can be found by importing the custom 'moveTo' block that I have created and then right clicking and selecting edit. I might work on a document detailing how to create custom blocks for S4A that is more detailed than the one provided by the creators of S4A if that would be useful to you. |
Yes, I am pretty sure that uArmFirmata.ino being uploaded to the board, and I also compared it with other versions of StandardFirmata-based firmware. It is just slightly changed. Actually I have been very family with the tutorial you offered to me, which is a little simple. If more arguments could be included in the new block, the example would be more clearly I think. But it has helped me a lot, cause before we connected with each other, I had successfully added some simple blocks, such as pumpOn, pumpOff, and both of them can work. However, when the new-built blocks with some inputs (the basic moveTo contains three inputs: x, y, z), uArm would not work perfectly, which means it can move randomly, but not as I supposed, so strange. When I use the uArmFirmata you offered, there is no any response. This situation is quite similar with some cases happened during my previous tests, I can't find out the reason. And I don't really understand why the following case being added in your uArmFirmata.ino file, which seems not being used in any place, can you please explain it somehow? If you could work on a more-detailed document of extending custom blocks, that would be absolutely awesome!!!!! All the best. |
@Davis4Create Can you please submit a pull request with the partly working code that you use to get the pump working and other components? This might help us both to work on this Firmata library. The case that you mention was left over from a previous library it can be ignored/deleted. I will be working on some sort of document in the future, but right now I don't have enough time to work through it. |
@mdcanham I will submit a pull request after I successfully use moveTo command in S4A, cause I just find uArm board is not exactly the same with Arduino UNO, which is just a board based on Arduino. So I think my previous work which got pump work was just happening by chance, rather than making it really work. My next plan is to get the specifications of uArm board and reconfigure pins' definitions in board.h file (the file included in firmata.h). Do you think it is in the right way? Hope my explanation is clear to you. |
@mdcanham And if you are available, can you please try to make effort in that way and upload the file. Of course, all of this are in the premise that you agree with my conjecture. |
@Davis4Create I have been looking into this over the last half hour and have found that uArm have their own version of Firmata (https://github.com/uArm-Developer/FirmataEEPROM). I am not sure if this is because the standard Firmata is not compatible with the uArm board... I have added an issue to the uArm FirmataEEPROM project that should give us an answer. As to your previous comment - I don't think that modifying the pins definition in board.h would be the right way to go. What would this achieve? |
@mdcanham cause uArm board is not compatible with any Arduino board (I don't really be much sure), here is a paragraph talking about board.h: But if uArm board can be compatible with any Arduino board, there would be no necessary to modify board.h file. I can't really find more information about uArm board, its official website says it is compatible with Arduino board, but I think the compatibility might be imperfect. Hope this won't make you confused. |
@Davis4Create Thank you for that quote. That clears things up a bit. I see what you mean now about modifying the boards.h file in Firmata. I am still waiting to hear back from someone about the uArm version of Firmata. Maybe it is the case that a completely modified version of Firmata must be used with the uArm and that is why uArm have supplied a completely seperate version on their GitHub profile. (https://github.com/uArm-Developer/FirmataEEPROM/issues/1) |
@mdcanham Excellent. Looking forward to hearing some progression from you. |
Hi Matthew,
Here is a link of uArm (a kind of tiny robotic arm):
http://developer.ufactory.cc/
I would like to use s4a to control this little kit. Currently, I have achieved to do something simple based on the arduino blocks that offered by s4a. But doing something more complex, such as move action, is still NOT achieved. I do know that the standard firmware should be fixed and new blocks should be mirrored in s4a, which are both difficult for me, especially the firmata part. Could you please give me some help to make it come true?
Thank you. All the best.
Davis
The text was updated successfully, but these errors were encountered: