Step 13Run the program
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 152 is the value of the pot which changes from 0 to 255.
If button1 is clicked it sends a value of 120 in the first byte and if button2 is clicked it sends 160 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.6Kw pumps and sensing the level of water in tanks. Picaxes can be daisychained on a common bus and can even communicate with each other via radio links.
It is also possible to upload and download data from websites and hence use the internet to connect devices anywhere in the world http://www.instructables.com/id/Worldwide-microcontroller-link-for-under-20/
The next two pages also contain some examples of how to use different sensors and how to control different devices.
Dr James Moxham
Adelaide, South Australia
| « Previous Step | Download PDFView All Steps | Next Step » |
![]() |
Add Comment
|



















































