Skip to main content
Topic: Bus Pirate Basic Script question (Read 1415 times) previous topic - next topic

Bus Pirate Basic Script question

Hello, I want to know if there's a way to enter many lines of basic scipt in one file or 1 copy and paste. I'm using BP in I2C scripting mode and I have written a quite long program in basic. The only way I found so far is to write the program in a notepad txt file and after copy n paste each line one after the other every time I want to use my program.

Is there an easier way to do that? I'm using Tera Term but I can use another terminal if there is a better one for that purpose. Thank you.

Re: Bus Pirate Basic Script question

Reply #1
Hi,

You can paste more lines at once. The bad thing is the buspirate hasn't got flowcontrol, so it is more or less trial and error how many lines can be pasted at once.  Back when I wrote the basic engine I had succes approx 5-10 lines a time (didn't try more). Parsing the lines is done quick so the chances are slim that something went wrong.

BTW i used hyperterminal, but terraterm should be the same.

 

Re: Bus Pirate Basic Script question

Reply #2
I have copy and pasted many lines at once from a text editor into the Bus Pirate terminal with no problems.  I don't remember how many lines but definitely more than a dozen.  Are you saying this is not working for you or have you just not tried multiple lines?  If your listing is too long try pasting them in groups of 10 to 20 lines.

I believe I was using Notepad and HyperTerminal on Windows machine and it worked fine.

-Eric

Re: Bus Pirate Basic Script question

Reply #3
Thanks for the quick answers guys, I think I found a very effective way. In Tera Term there is an option for setting the delay between transmission of lines. I put it to 100ms (maybe 200) and I can paste all my big prog in 1 shot. Thank you for your time and great tool!

Re: Bus Pirate Basic Script question

Reply #4
Hello again, I have another quick question. Instead of starting a new thread I will ask it here. Can I use > or < in an if then statement? The following statement did not seems to work

600 IF V > 5000 THEN PRINT "ERROR"

Thank you.

Re: Bus Pirate Basic Script question

Reply #5
Copying from notepad will help a lot (there was someone who copied/pasted from word but that gave some problems) MsWord puts extra information on the clipboard that interferes with the terminal program.

Copy/paste during normal operations can lead to lost characters and thus unpredictable results.

Re: Bus Pirate Basic Script question

Reply #6
[quote author="Toley"]
Hello again, I have another quick question. Instead of starting a new thread I will ask it here. Can I use > or < in an if then statement? The following statement did not seems to work

600 IF V > 5000 THEN PRINT "ERROR"

Thank you.
[/quote]

It should work. How does the listing looks like?

Re: Bus Pirate Basic Script question

Reply #7
It's ok I wrote my routine differently and it works fine now. Thank you very much Sjaak the Basic script is a very usefull and powerfull utility.

Re: Bus Pirate Basic Script question

Reply #8
Glad you managed it. BUt it still should work.

Can you still PM the code (if you don't want to share it here) so I could debug it?