Controlling world your pc download
Click PictureBox1. EventArgs Handles Button2. Power up the picaxe if it isn't powered up. Run the vb. The program can be compiled if you like but for debugging let's leave it running within VB. The timer is sending out bytes every 5 seconds so it takes 5 seconds for the display to come up. The label1 is displaying a dump of the 14 picaxe registers.
These are sent to the picaxe and then send back again. It almost certainly isn't necessary to send all 14 and your code can be changed to suit. The second byte with a value of is the value of the pot which changes from 0 to If button1 is clicked it sends a value of in the first byte and if button2 is clicked it sends and the picaxe program decodes these and moves the servo.
This code shows how to send data and get data back from a microcontroller. The microcontroller can turn on all sorts of devices - I have about 30 round my house running sprinklers, lights, security, detecting cars in driveways, turning on a number of 3. Picaxes can be daisychained on a common bus and can even communicate with each other via radio links. In addition to these cirucits, there are a few that I use over and over again.
Temperature - the LM35 temperature sensor produces a voltage which can go straight into a picaxe and can be read with a readadc or readadc10 command. Light - a light dependent resistor has a resistance that varies from a few hundred ohms in bright sunlight to over 5 megohms in pitch black. Measure the resistance at the light level you want to switch at and put the LDR in series with a resistor of about the same value. Eg I wanted to detect the lights of a car pulling into the carport to turn on some lights.
Switch - some switches switch between 5V and 0V a single pole double throw switch but some just turn on and off. If a switch turns on it can send 5V to a picaxe chip but if it is off the picaxe pin would be 'floating' and could be any value. This circuit shows how to pull the input down to ground when the switch is off.
This is the circuit to use for most pushbutton switches. Potentiomter - a good old fashioned knob. Twiddle the knob and read the voltage into the chip. There are all sorts of other electronic devices that create a voltage from V or can be easily configured to do so.
Examples are magnetic sensors, humidity, speed, touch, infrared light, pressure, colour and sound. Sensors in general cost only a few dollars each. The picaxe help file contains a great explanation of how to control motors and lights. In addition I find there are a few circuits I use over and over. The first is a simple transistor circuit. A picaxe chip can turn on a maximum of 20mA per pin which is good for turning on a LED but not much else. A transistor increases the current to mA which is good for small light bulbs.
The second circuit shows a mosfet. Mosfets need virtually no current to drive them - only volts so they can be directly controlled by a picaxe. This means it doesn't get hot when driving quite high loads which saves power and also saves on heatsink costs. The third circuit shows a relay. There are several parameters for all relays - the coil voltage, coil resistance and the load voltage and current.
For instance a relay might have a 12V coil with a coil current of 30mA, coil resistance of ohms and might be able to drive up to V at 1 amp. The coil current is more volts and amps than a picaxe can supply, so we use the transistor circuit to switch the coil. There is a diode included as well - this supresses the back EMF when the relay turns off.
Back EMF is what creates the spark for a sparkplug so you don't want these high voltages anywhere in a circuit. The contacts will have a maximum current and volts - the current might be a few amps and the volts are often V so switching 12V or 24V will be well within range.
If you are inexperienced with electronics don't play with mains voltages. There are also small relays that have coil voltages of 5V or 6V. For these relays you may not need a seperate 12V supply but just watch the coil resistance as many of these have current draws of over mA.
If so and you are using a 78L05 mA 5V regulator you might want to change this to a regulator which can supply up to 1 amp. Relays are particularly useful for switching AC - eg 24VAC garden sprinkler solenoids, 12VAC garden lights and in electrically noisy environments such as a car. If you want to control power like that then get an electrician to wire up a control box and give you two wires coming out coil wires for a 12V relay that you can control.
This way the electrician can sign off on the power box and you can do all the electronics without having to worry about being electrocuted. Another use for relays is a reverse control for a motor.
Using pulse width modulation into a mosfet you can control the speed of a DC motor, and with a DPDT power relay you can change the direction. This is a simple way of controlling big motors like the ones used in 'robot wars'.
Please post a comment if you need help building something. Reply 11 years ago on Step 3. Great info here! I wonder if you know the answer to my question; How do you avoid a common source when using multiple mosfet's on a picaxe? Any help is welcome :. I'm looking at the mosfet control circuit at the end of the article - am I correct in assuming that you need NO other components to drive a mosfet?
I'm working on a picaxe-based home-brew heater and need to switch a 2A resistive heater at 12V. I'm not doing anything fancy like PWM control, just a simple thermostat. Thanks for your help! Reply 11 years ago on Step Yes, no extra components required for a mosfet, but you do need to pick the right mosfet. You need one with a gate drive of 5V. Some need 10V and will partially turn on at 5V but get very hot. The picaxe manual has some more "up to date" ones than the BUK I do kind of like the BUK though - it can switch a car headlamp 60W and only get slightly warm.
Wow, thanks for the really quick reply! I'm guessing that's the "gate threshold voltage" in the datasheets? The picaxe manual suggests an IRF but none of the big. Thanks, Nick. Hi this looks really useful stuff. I'm trying to control a cdrom stepper motor using a L d driver and picaxe. Can you tell me how to use the serout command to do this please. Thanks loads. Where is the code going from and to? If it is from the PC to the picaxe then to the stepper motor, then it will be Serin on the picaxe.
The syntax will be very similar to that posted here, but I just want to check first where the data is going from and where to. Thanks for early reply James. All the code will sit in a picaxe 28 and outputs will be sent to the LD. Take a look at step 5 - for serin the bracket goes round the "data" and then the variables are outside the bracked. But for serout the bracket goes round the whole set of variables.
Just one of those programming quirks I guess. Sounds a pretty standard picaxe circuit. The picaxe forum has got rather prickly lately. You don't need a flameproof suit but you might need a flame retardant one.
Serin and serout need the commas and the quotes in the right place. Reply 11 years ago on Introduction. Looking at the picaxe circuits, they use the IRF and picaxe is from the UK so see if that one is available? Threshold voltage for the gate of about 3V. Is there any way of separating out the pot readings from the line and put it in a seprate label by itself? Thanks p. Great project!!!!!!! The best thing about Subway Surfers is its constant updates. Not only will be able to play with new characters, choosing between Jake, Tricky or Fresh, but in each new version, we'll discover a new city in the world to play around on its subway network , and also make use of different hoverboards flying skateboards to be able to escape at full throttle.
Before you hit the Download button, you should know that there's no such thing as an official version of Subway Surfers for Windows but that doesn't mean that you're not going to be able to play on your PC. There's a trick for that. This download offers you an Android emulator of the likes of BlueStacks and the APK of the Android version of the game so that you can make it run immediately on your computer.
Windows Games Platform Subway Surfers 2. Requirements and additional information:. Offers in-app purchases. Antony Peel. Software languages. Author Kiloo Games.
0コメント