Page 1 of 1

First Thing to Do In Swordfish

Posted: Wed May 03, 2017 10:58 pm
by swordfishuser
I've heard 'look at the samples and you'll figure it out.'

Well. I have done that with a couple languages/compilers and

haven't figured much out.

That might be for someone who already know another language.

What's one thing I can do in Swordfish that will 'move me along'?

Write the device line?

Thanks!

Re: First Thing to Do In Swordfish

Posted: Thu May 04, 2017 5:06 pm
by bitfogav
Have you checked out the Swordfish Language Guide?

http://www.sfcompiler.co.uk/downloads/SFManual.pdf

Re: First Thing to Do In Swordfish

Posted: Thu May 04, 2017 6:08 pm
by swordfishuser
That new post button could be in a better spot.

I wrote a nice reply for nothing.

Do I open a new source file or start a project to get started please?

Re: First Thing to Do In Swordfish

Posted: Thu May 04, 2017 6:19 pm
by bitfogav
swordfishuser wrote:Do I open a new source file or start a project to get started please?
Neither, You just click on the "New" tab or press CTRL+N to get started. That will start you with a clean fresh page to write you're code.

Re: First Thing to Do In Swordfish

Posted: Thu May 04, 2017 6:39 pm
by swordfishuser
Thank you.

Goal is simplest program that will compile.

In Basic Stamp it is 'End'.

That command only.

What next to do that please?

Re: First Thing to Do In Swordfish

Posted: Thu May 04, 2017 6:50 pm
by Jerry Messina
Try the IDE Help menu and under topics select 'Creating and Using Programs' in the 'Language Reference' section.
After that it's up to you!
Goal is simplest program that will compile.
In Basic Stamp it is 'End'.
That command only.
And here's the simplest program that will compile in Swordfish:

Code: Select all





Re: First Thing to Do In Swordfish

Posted: Thu May 04, 2017 6:56 pm
by swordfishuser
Great!

Thank you!

Have to go.

Will be back in a couple hours.

Re: First Thing to Do In Swordfish

Posted: Thu May 04, 2017 11:52 pm
by swordfishuser
bitfogav and Jerry

How do you 'Debug' to terminal.

Example: Debug "Hello World".

"Killing two bird with one stone"

See if there ins terminal program in Swordfish and

coding and compiling first lines of code.

Bob

Re: First Thing to Do In Swordfish

Posted: Fri May 05, 2017 9:56 am
by Jerry Messina
There's no 'debug' terminal. You can use the pic uart to send stuff to a pc.
Here's a simple example based on the echo.bas program from the Samples folder

Code: Select all

// if device and clock are omitted, then the compiler defaults to 
// 18F4520 @ 20MHz - they are just used here for clarity...
device = 18F4520
clock = 20

// import usart module...
include "usart.bas"

usart.SetBaudrate(br19200)
usart.Write("Hello World")

// read in characters and echo to screen...
while true
   WriteByte(ReadByte)
wend
There's a simple serial terminal in the IDE... main menu 'Plugin | IDE Serial Communicator'

Re: First Thing to Do In Swordfish

Posted: Fri May 05, 2017 6:52 pm
by swordfishuser
Jerry

Thank you. That's a five star anwer. *****.

Looks like 'Learn By Doing' works.:)

Get back to you in a couple of hours.

Bob

Re: First Thing to Do In Swordfish

Posted: Tue May 09, 2017 7:06 pm
by swordfishuser
Will be ready to go with development board and 18F25K22 in a couple of days.

Looking forward to seeing what Swordfish is like.

Need to add communication interface to board. I think.