I use Picaxe basic (NO,that's NOT visual basic.) the chips are produced in England quite near me and I went and did work experience there. they ship all over the world though.
picaxe site
The language is fluent and you can do a lot with it, but it's also very easy to grasp.
example script: turns a light on when the button is pressed and keeps it on for 5 seconds.
start: 'header defines part that can be jumped to. text after a ' is ignored
if pin1 = 1 then goto light ' if button 1 is pressed, then jump to header "Light"
goto start 'jump to start
'empty lines not needed, but make it easier to read.
light: 'header defined by a :
high 1 'put power through output1
wait 5 'you guessed it. this can also be written as pause 500
low 1 'stop power flowing through output 1
goto start 'jump to startLast edited by sparks (2010-07-02 04:27:47)
Offline
sparks wrote:
I use Picaxe basic (NO,that's NOT visual basic.) the chips are produced in England quite near me and I went and did work experience there. they ship all over the world though.
picaxe site
The language is fluent and you can do a lot with it, but it's also very easy to grasp.
example script: turns a light on when the button is pressed and keeps it on for 5 seconds.Code:
start: 'header defines part that can be jumped to. text after a ' is ignored if pin1 = 1 then goto light ' if button 1 is pressed, then jump to header "Light" goto start 'jump to start 'empty lines not needed, but make it easier to read. light: 'header defined by a : high 1 'put power through output1 wait 5 'you guessed it. this can also be written as pause 500 low 1 'stop power flowing through output 1 goto start 'jump to start
Now thats pretty cool... how do you program the chip, through a USB port?
Offline
it's serial USB. so it has two pins on the chip dedicated to data loading (serin and serout) and these go to a 3.5mm jack socket that can connect to USB or serial port.
What I love about picaxe is that it's so cheap! you can put it on a circuit board with only about three resistors and maybe a capacitor to make it work, and it can be programmed on the board, rather than having to be taken off the board for programming. The programming software and help pdf's are all free and the programming editor has a syntax checker that's very good for debugging.
the chips themeselves range from £2-8 which really isn't bad at all. you can get different sizes (more inputs and outputs) with different amounts of memory on them to suit all needs and this makes them great for hobbyists and cheap, yet effective project building.
oh yes, variables exist too, though I think they can only be numbers.
they do not have to be declared, but you have a max of 25 varaibles ( I think)
let b0 = 1
let b0 = b0 + b1
Last edited by sparks (2010-07-02 04:42:18)
Offline
sparks wrote:
it's serial USB. so it has two pins on the chip dedicated to data loading (serin and serout) and these go to a 3.5mm jack socket that can connect to USB or serial port.
What I love about picaxe is that it's so cheap! you can put it on a circuit board with only about three resistors and maybe a capacitor to make it work, and it can be programmed on the board, rather than having to be taken off the board for programming. The programming software and help pdf's are all free and the programming editor has a syntax checker that's very good for debugging.
the chips themeselves range from £2-8 which really isn't bad at all. you can get different sizes (more inputs and outputs) with different amounts of memory on them to suit all needs and this makes them great for hobbyists and cheap, yet effective project building.
oh yes, variables exist too, though I think they can only be numbers.
they do not have to be declared, but you have a max of 25 varaibles ( I think)
let b0 = 1
let b0 = b0 + b1
Your not a hobbiyist though, you're using it for school work, but really £2 for a reporgrammable chip? Thats really good value. So you're going to use it for your swarm?
Offline
It is good value, and I use them for out-of-school projects too. I'm probably going to use the 18X as I'm very familiar with it (the programming commands change slightly according to the chip) it has infra red capabilities, 18 pins, 2800 lines of memory, 5 inputs and 8 outputs.this is vaguely how they go (in order of size)
08
08M
14
14X
18 (discontinued)
18X
18M
28X
28M
40 (I think)
Offline
sparks wrote:
It is good value, and I use them for out-of-school projects too. I'm probably going to use the 18X as I'm very familiar with it (the programming commands change slightly according to the chip) it has infra red capabilities, 18 pins, 2800 lines of memory, 5 inputs and 8 outputs.this is vaguely how they go (in order of size)
08
08M
14
14X
18 (discontinued)
18X
18M
28X
28M
40 (I think)
40?! *whistles* Anyway, have you worked out how to fix the comunication between swarm?
Offline
oh.... is this the simplest and cheapest way though?
Offline
sparks wrote:
I use Picaxe basic (NO,that's NOT visual basic.) the chips are produced in England quite near me and I went and did work experience there. they ship all over the world though.
picaxe site
The language is fluent and you can do a lot with it, but it's also very easy to grasp.
example script: turns a light on when the button is pressed and keeps it on for 5 seconds.Code:
start: 'header defines part that can be jumped to. text after a ' is ignored if pin1 = 1 then goto light ' if button 1 is pressed, then jump to header "Light" goto start 'jump to start 'empty lines not needed, but make it easier to read. light: 'header defined by a : high 1 'put power through output1 wait 5 'you guessed it. this can also be written as pause 500 low 1 'stop power flowing through output 1 goto start 'jump to start
Wow. That's cool! Even better: I already know BASIC! I'm thinking about getting one of these.....
EDIT: and I just used my handy unit converter and found out that (if they sell them in the US) They would cost $3-12. That's a good price.
Last edited by ScratchReallyROCKS (2010-07-02 09:50:01)
Offline
I gave a link to the site above ^ if you're interested. (I think there are shipping costs, so maybe buy an introductory premade board and a USB serial cable with like an 08M and a 18X to get you started so as to save shipping costs in the long run)
( I don't know how proficient your knowledge of elecronics is, but remember they are delicate. here's a few tips:
•always tie LED's down to ground with a resistor
•use a smoothing capacitor in the circuit if you use a motor to stop voltage spikes damaging the chip.
•put a diode across motors, relays and solonoids to stop electricity being generated and flowing back to the chip.
• anything that draws more current than a couple of LED's should be triggered by transistor rather than be directly powered by the pic's output
• inputs should always be tied up or down with a resistor, otherwise the chip will read it as "floating" and won't be able to tell if it's pressed or not)
Offline
sparks wrote:
I gave a link to the site above ^ if you're interested. (I think there are shipping costs, so maybe buy an introductory premade board and a USB serial cable with like an 08M and a 18X to get you started so as to save shipping costs in the long run)
( I don't know how proficient your knowledge of elecronics is, but remember they are delicate. here's a few tips:
•always tie LED's down to ground with a resistor
•use a smoothing capacitor in the circuit if you use a motor to stop voltage spikes damaging the chip.
•put a diode across motors, relays and solonoids to stop electricity being generated and flowing back to the chip.
• anything that draws more current than a couple of LED's should be triggered by transistor rather than be directly powered by the pic's output
• inputs should always be tied up or down with a resistor, otherwise the chip will read it as "floating" and won't be able to tell if it's pressed or not)
Thanks, I knew most of those, but the other ones will help.
Offline
Can anyone explain how a smoothing capacitor smoothes a circuit?
Also, can a Dc Hobby motor act as a way to generate ON-OFF switches ?
Can a coil (powerd by ac current) transfer magnestism to another coil such that the other coil can use this changing magnestism to give power to a circut?
What is a filarial coil and how can it help in "wireless transmission of electricity through magnetic flux change between 2 coils " Better than a normal coil
THANKS
Offline
Can anyone explain how a smoothing capacitor smoothes a circuit?
Capacitors store electricity and let it out again (like a small battery) this means that a sudden surge of power travelling through a full capacitor won't greatly increase the voltage on the other side of it (exactly WHY I know not).
Also, can a Dc Hobby motor act as a way to generate ON-OFF switches ?
Well yes, I suppose you could, though you're better off buying a relay or a proper switch.
Can a coil (powerd by ac current) transfer magnestism to another coil such that the other coil can use this changing magnestism to give power to a circut?
What you're talking about is called induction and is what the new power mats use. it's actually not that hard to do, but be careful of high voltages! try this page
What is a filarial coil and how can it help in "wireless transmission of electricity through magnetic flux change between 2 coils " Better than a normal coil
No idea. google it.
THANKS
Offline
sparks wrote:
Can anyone explain how a smoothing capacitor smoothes a circuit?
Capacitors store electricity and let it out again (like a small battery) this means that a sudden surge of power travelling through a full capacitor won't greatly increase the voltage on the other side of it (exactly WHY I know not).
Couldn't that cause the capacitor to be damaged or explode (If thats possible?)
I've only done a little work with capacitors, and most of the stuff was faulty.
Offline
not unless you put more electricity through the capacitor than it specifes it can take. It's not a solution for high voltage power spikes, but it does smooth out electrical noise generated by motors and other moving components in a lower voltage circuit.
Offline
sparks wrote:
not unless you put more electricity through the capacitor than it specifes it can take. It's not a solution for high voltage power spikes, but it does smooth out electrical noise generated by motors and other moving components in a lower voltage circuit.
Makes sense, you don't want to damage the circuit by mistake. Though they are a very strange component.
Offline
Offline