This means you have to design your own solution, which doesn’t always work. It must be an easier way. This is a Lego track, switch the designs been around for 25 years now, but even new versions work on the same principle, which is this annoying little yellow lever. However, with a few bricks and gears from the LEGO Technic range, you can build yourself one of these. This is a motorized gearbox, driven by an old 9 volt, the LEGO Technic motor the motor plugs directly into a battery box which can drive it in both directions and since it works off electricity, it can be controlled by an Arduino good news. Stop messing around these. Are the parts you need to build your gearbox start by making a base plate with a central cross? This place will fit around the current points mechanism from there build up the sides and then place your Technic rack muesli. On top of the points mechanism, then fit your Technic Briggs and build up your driver axle to turn the rack fit a clutch to help the motor turn. When the racks lock, then add your second gear axle that will mesh with the motor head locking plates but leave a gap for the base of your motor fit the final driver gear and test that everything turns freely and here’s the points in action driven by the Arduino it’s wired up to our motor controller and is switching left and right using the simple code we wrote in the first tutorial.
This is some improved code to use the motor in a station scenario. We’Ve taken the code that we used in the previous tutorial and added on a block to control the switch plus another light sensor, so that we know when the trains ahead of the switch. That means the number of motor control, pins and variables has doubled, but there’s. Nothing special here just two of everything. This time there is one extra variable that we’ve added for the track: switch and that’s a counter we’re going to store how many times the Train has gone past a light counter and if it’s an even number of times the track will switch left and if it’s, An odd number of times it will switch right right in the void setup again, everything’s, simple, all that motor control, outputs are defined and the trains moving forward and I’ll switch motor is going to run at full speed down in the void loop, I’ve cleaned things up. A bit everything that we did in the previous tutorial has been wrapped into a new void called station sensor. That way, we can completely forget about it. The new stuff is in another void, called track switcher and in the loop we just say, run one void than the other over and over that keeps things nice and tidy. So we’ll skip station sensor and go straight to track. Switcher let’s run through the code. In plain English read the light sensor: if the light sensor has been triggered safe, that as a one which means on otherwise save it is a 0 which means off now.
If the current state of the sensor is different from the previous state, meaning it’s just switched and the switch used to be off then add one to our counter. If the counter can be divided by two. So if the counters even drive the points left for 200 milliseconds, otherwise, if the counter is odd switch, the point right, then save the current state of the light sensor for next time. The idea of saving the state of the sensor is what we call edge detection. It doesn’t matter if this is a light sensor or a reed switch or a button, we don’t want to know that the button is on. We want to know it was switched on. We want that point that the change happens. Otherwise, the points will just switch left and right over and over all the time using this code. We only switch the points once even if the sensor is blocked for five seconds and we only switch when the train arrives at the sensor, but not when it leaves the sensor, because the switch has to go from off to on. But not the other way around. Got it so here’s the code in action we’ve got our arduino connected to the motor controller, which is powering both the track and the points motor we’ve got two light: sensors, the green one is our station detector and the red one is our point switcher counting how Many times the train is passed when you watch the train, go around you’ll, see it alternating between the mainline and the station.
arduino 9v Video
arduino 9v news
China The Most Complete Ultimate UNO Starter Kit for children stem education on Global Sources – Global Sources
Posted on Monday August 19, 2019China The Most Complete Ultimate UNO Starter Kit for children stem education on Global Sources Global SourcesChina UNO Starter kit AE086 is supplied by ☆ UNO Starter kit manufacturers, producers, suppliers on Global Sources. … Continue Reading »
Partnerships These Monthly Arduino Project Kits Are an Awesome Way to Learn Coding and Electronics – Futurism
Posted on Friday May 24, 2019Partnerships These Monthly Arduino Project Kits Are an Awesome Way to Learn Coding and Electronics FuturismCreation crate is a subscription box that sends a new arduino project kit to your door every month. It’s the perfect hobby kit for tech enthusiasts. … Continue Reading »
Posted on Wednesday July 31, 2019Engineering grad’s clever electronic cap decoration almost caused a bomb scare KFOR Oklahoma CityA computer engineering graduate got his diploma and one heck of a story because the DIY electronic decoration on his graduation cap looked a bit like a bomb. … Continue Reading »
arduino 9v Social
Originally posted 2015-11-15 12:03:33.