The "hello world" of basic programming

Post here to discuss programming with swordfish basic

Moderators: Chuckt, Garth, bitfogav

User avatar
bitfogav
Moderator
Moderator
Posts: 908
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Mon Jul 26, 2010 7:19 am

Now the reason that it worked for you when you took out that extra and statement about the button_delay is because of my previous error.

What is supposed to happen is that you press the button, it loads up a variable with the number 50. then it wont let you press a button again untill that variable has gone all the way back to 0 again. but because I was using the incorrect variable name, I was never actually decrementing this variable which therefor meant it would never get to 0 and you could never inc or dec the speed.

so if you ow use the above fixed code, it should work much better
Now that you have explained to me how it works I can see the mistake hehe!, I was checking my breadboard and switches thinking I must have something wired wrong and then sat there and could'nt work it out haha.. so i just deleted the bit of code in the end!! :D but its a cool bit of code to learn and mess around with :)

I like the bit of code toggle(LED) thats a great command :D

Brad is there a tutorial about swordfish basic apart from looking on digital.diy? like all the commands you can use and what they do or mean?.

User avatar
brad
Site Admin
Site Admin
Posts: 2576
Joined: Fri Mar 26, 2010 10:30 pm

Post by brad » Mon Jul 26, 2010 12:35 pm

Great! I am glad we got that sorted :)

See how much better it is to use basic rather than ASM?

It is much more fun to use.

You can have a look at the swordfish forum over at http://www.sfcompiler.co.uk

But I have learned so much from http://www.digital-diy.com especially from the example code and in the forum.

Now when I get a bit of time (maybe tonight?) I will look into that 24 x 24 code.

The drawing part of the display should be quite a compact piece of code which will consist of a few 'for next' statements which will allow it to loop through drawing one column at a time.

stay tuned for some fun!

User avatar
bitfogav
Moderator
Moderator
Posts: 908
Joined: Sun Mar 28, 2010 9:03 pm
Location: United Kingdom
Contact:

Post by bitfogav » Mon Jul 26, 2010 7:28 pm

I cant wait :D better get my circuit made up later..

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest