UselessBox
ASKME
Posts: 172
I'm attempting to build a useless box. It will have two standard servos, several LEDs, one vibrating device, and an Emic board for vocals.
I've seen a lot of these on the internet and I'm trying to make mine very unique.
Most importantly I'm using BS2 BOE/USB BOARD.
Those who have helped me in the past will know that I have been attempting to learn SPIN, but I have been driving myself crazy with that so I decided to play around with PBasic for a while so I can have some fun at least..
My only concern is that I'm going to write a couple of dozen routines, but I want to be able to randomly choose one of the routines whenever the switch is pushed, is it possible to do this with Basic, if so could you tell me what command I need to use or series of commands. I will not have any problem writing the routines.
I have all the parts for this project and I will be posting pictures and also my code as I'm proceeding for any newbies out there like me that are learning to code this will be a great project to follow along on.
Thank you in advance for any help.
I've seen a lot of these on the internet and I'm trying to make mine very unique.
Most importantly I'm using BS2 BOE/USB BOARD.
Those who have helped me in the past will know that I have been attempting to learn SPIN, but I have been driving myself crazy with that so I decided to play around with PBasic for a while so I can have some fun at least..
My only concern is that I'm going to write a couple of dozen routines, but I want to be able to randomly choose one of the routines whenever the switch is pushed, is it possible to do this with Basic, if so could you tell me what command I need to use or series of commands. I will not have any problem writing the routines.
I have all the parts for this project and I will be posting pictures and also my code as I'm proceeding for any newbies out there like me that are learning to code this will be a great project to follow along on.
Thank you in advance for any help.
Comments
When you press the button, run RANDOM to get a value - which you then check in the BRANCH statement to pick a CASE (randomly!)
Thank you very much that solves my biggest hurdle I think. I did read up on RANDOM but I wasn't sure how I was going to be able to implement it into my program to get the output I was looking for so it looks like this will solve that problem. Always a curve when learning something new.
Could you try that?
There's a few free apps or online services to "resize images" if you search those words.
Does that help solve?
Whats the benefit of one over the other?
If your box is dark you could use a Photo-resistor or Photo-transistor to detect light.
You could also use an IR LED and IR detector to sense when the lid is removed.
Or you could use the Erco old school method and have a micro-switch be closed when the lid is on.
I just thought you might want to save the Ping for a Robot or something more suited for it.
Also, since those boxes tend to be flimsy you can reinforce the sides by lining them with cardboard or card stock.
The ending product is for my 6 year old grandson hence the Angry Bird, which happens to be straight out of his toybox.
I'm going to take advantage of the Ping sensor's ability to track distance into my program, if I didn't already have a Ping sensor I would have used a PIR sensor, but thanks for the education and the advice I'm never too proud to accept both.
Once I get everything mounted I will upload more pictures and if all goes well with the prototype I upload videos on YouTube of the completed prototype working and I will upload on this forum the code I write for this project.
Thank you in advance for any and all help...
Once you know all the hardware is working then any problem will be with the software.
Oh and I like to use CONstants in my programs especially for I/O pins or other values that might change. Makes modifying or tweaking the program a breeze.
Does it have any blinking lights?
Kids love that! :P
I am using blinking lights, I have several RGB's that I will be using in one way or another. Since ultimately this project is for my grandson the use of lights was a given. I'm also using an Emic2 in my project and a https://www.parallax.com/product/28822 .
I absolutely planed on testing each component independently to verify that everything is working properly before I start to code. When I do start coding I planned on writing a couple dozen case statements and using the BRANCH command.
When I press the button, I will run RANDOM to get a value - which I will then check in the BRANCH statement to pick a CASE (randomly!)
This project has turned out to be a lot of fun and I do appreciate all the help and advice. I will keep posting updated picture as things progress.
The Emic is a nice touch.
Take a look at the StampWorks manual because I know you will need tweak the RANDOM value to get it in the range of your cases.
The Propeller is especially suited for something like this because it's a lot faster and you can offload repetitive tasks to each of the Cogs.
Funny that you mention Propeller because I was thinking how better suited it was to the task at hand but the only drawback is my inability to program in SPIN otherwise I would be using the Propeller.
I still need to manufacture some way to hold my arm and guide it to the switch, like a tuning fork type of device. Not completely sure how I'm going to accomplish this.
Happy New Year to All !!!!!
I will Post more as I progress through this project.
Admittedly I should have done just a little investigation, like go to YouTube and (which I ended up doing) see if anyone out there opened one of these up to see how it works.
Now I will disassemble the arm portion of my box and rework it.
If not for my failures my successes would not seem so Great...
Basically a triangle with rounded corners. With the lobes at 120 degrees you would only need to rotate your servo by 60 degrees to lift and then another 60 degrees to lower it.
Happy to draw you a picture if needed.
http://odditymall.com/includes/content/upload/the-useless-box-turns-itself-off-4226.jpg
A lot of boxes don't use linkages for the finger either.
Thank you for the advice but I do not have access to a CnC machine, linkage, lobe lifter, cam shaft, these are I dare say not in my wheelhouse.
I'm limited not so much by budget as I am by lack of knowledge in this area. In the end I have to have a solid executable idea for my final box, right now I have a little flexibility because it's a prototype.
The example I saw on YouTube was different then this one you posted. The one I saw the arm was just a square with the top cut off, it looked pretty straightforward and it's something I will be able to reproduce I'm hoping.
I will either make this of plastic or metal. Hopefully I can put this issue to bed once and for all...
That looks really good. Can't wait to see it in action.
Don't forget Erco's favorite material, plywood. I would suggest Birch aircraft-grade plywood since it looks nicer than standard plywood.
I've seen it at both Home Depot and Michaels.
Now that's funny.... but, all joking aside plywood just might be the perfect material because of these ease of being able to make different shape fairly easily with standard hand tools. The thing is that in the end I will be covering it with some sort of fabric (It needs to look like angry Birds arm and hand, foot?) or similar material so thanks for the advice (I guess I owe Erco a thumbs up also) now I know how I'm going to proceed.
I will take a trip to Home Depot or similar this weekend and have this project back together and ready to code.
I'm excited once again.
By the way any guesses as to what this is???? Okay I will spill the beans, it's an aluminum Ping Sensor stand chopped up.
Not too shabby.
Are you going to anodize those Aluminum parts?
By the way I just finished and this works perfectly.....