This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#126 2010-07-01 21:14:03

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Ai Not Vi

What do you program this in, because I've always wanted to program microchips...


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#127 2010-07-02 04:25:24

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Ai Not Vi

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

Last edited by sparks (2010-07-02 04:27:47)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#128 2010-07-02 04:27:38

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Ai Not Vi

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?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#129 2010-07-02 04:41:05

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Ai Not Vi

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)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#130 2010-07-02 04:44:18

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Ai Not Vi

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?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#131 2010-07-02 05:02:04

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Ai Not Vi

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)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#132 2010-07-02 05:11:38

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Ai Not Vi

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?


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#133 2010-07-02 08:49:02

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Ai Not Vi

fix? I haven't built them yet :p they're still in design stages and I'm  not certain what communication they are going to use, though I think it likely to be infra red.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#134 2010-07-02 08:52:33

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Ai Not Vi

oh.... is this the simplest and cheapest way though?


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#135 2010-07-02 09:28:33

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Ai Not Vi

I think so yes. defo cheapest.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#136 2010-07-02 09:47:08

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Ai Not Vi

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)


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#137 2010-07-02 10:00:59

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Ai Not Vi

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)


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#138 2010-07-02 10:10:57

ScratchReallyROCKS
Scratcher
Registered: 2009-04-22
Posts: 1000+

Re: Ai Not Vi

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.


http://imageshack.us/a/img694/3806/sigmad.png

Offline

 

#139 2010-07-02 10:25:33

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Ai Not Vi

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


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

#140 2010-07-02 10:48:03

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Ai Not Vi

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


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#141 2010-07-02 17:08:02

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Ai Not Vi

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.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#142 2010-07-02 17:30:17

sparks
Community Moderator
Registered: 2008-11-05
Posts: 1000+

Re: Ai Not Vi

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.


http://img541.imageshack.us/img541/7563/scratchbetabanner.png

Offline

 

#143 2010-07-02 17:33:33

markyparky56
Scratcher
Registered: 2008-03-20
Posts: 1000+

Re: Ai Not Vi

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.


http://j.mp/jgVnTq
Check out my game engine development site: NewDawn I'm a Level 171 Scratcher.I am http://bit.ly/nkvLNT

Offline

 

#144 2010-07-04 11:38:07

Subh
Scratcher
Registered: 2010-05-25
Posts: 100+

Re: Ai Not Vi

bump


http://wiki.scratch.mit.edu/skins/scratch/logo.png     I'M IN Scratch Wiki .... ARE YOU ????

Offline

 

Board footer