The interrupts would catch all edges, first thing and only thing you do in the interrupt service routine is save the micros() count into an appropriate global variable associated with the race lane. Because of this I don’t know how reading the entire port at once helps. While you are going through each bit, 1, 2, 3, 4, a previous lane may trigger but you don’t detect it because you were off looking at another bit. If a change is detected, you save the micros() counter associated to a Race Lane. Polling the port would also require you to mask off each bit and know when a bit changes. ![]() I still think interrupts would be faster. Running a Pack race is fun, but running a District wide race felt more like work. To avoid angry parents (“well it weighed in OK at our Pack!”) the test weight goes on the scale before every car that gets weighed to check the scale. And of course accurate scales and a test weight. I have run district wide races with the winners from many Packs and it is very competitive–amongst the parents that is! We also used fitting boxes made to the specs in the rule book so that the car had to fit completely in the box with nothing outside except in the vertical direction (+z). Not having this is a recipe for angry parents in my experience! The rule book should say how the race is timed so everyone knows what is going to happen. Hey Your Pack should have a rule book that says how the race is run it should be available in advance. +1 on using micros() and turning off interrupts. The Sharp proximity sensors are nice and would work great. The finish line sensor works the way Tim described with a slot in the track except instead of proximity sensors, it was beam-break with LEDs above. Bumping the center guide strip will slow you down so having the wheels aligned perfectly with just a little toe-in for stability helps a lot. This does not work as well for a variety of reasons. Many races are won in the flatter coasting phase.Īs I said earlier, we initially had the starting system where rotating the starting bar hit a microswitch to start the race. ![]() You would think that first car to break the beam always wins but that is definitely not the case since there are two phases to race, the steep downhill accelerating phase and the flatter coasting phase. The first car to start down the track and break the laser beam starts the timer. All of the dowels rotate out of the way at the time. The slot in the track in front of each car has a dowel that is attached to the starting bar. The photo transistor end is fixed rigidly but the laser end is held on by a magnet and you can slide it up/down/left/right to get the beam in the hole. The laser goes across the track at the starting line and is a beam-break system. After selecting the correct drive, click OK.OK, you guys got me going again–I do love Pinewood Derby! Workshop 4 will prompt you to select a drive to copy the image files to a uSD Card.This time, click on the “Comp’nLoad” button. Red Button indicates that the device is not connected, Blue Button indicates that the device is connected to the right port. Make sure that you are connected to the right port. You can also check and modify some part of the code according to your preferences. Each sections and functions has comments for your reference.You can modify the properties of each widgets and buttons.Open the Visi project using Workshop 4.Note: The graphics used in this project has 480x800px, but you can still costumize them into smaller displays. Connect the gen4-PA to gen4-uLCD-50DCT-CLB or any gen4-HMI Display module with 480x800 px resolution.Build the circuit as shown in the diagram.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |