Search found 1086 matches

by basicchip
Thu Jun 01, 2023 6:34 pm
Forum: Software issues
Topic: Building an include .bas file
Replies: 3
Views: 2190

Re: Building an include .bas file

You can not DIM the same variable multiple times. So your code would take the form of

Code: Select all

DIM global1
DIM global2     '...

#include one.bas
#include two.bas    '...

main:
by basicchip
Wed May 31, 2023 8:09 pm
Forum: Software issues
Topic: Building an include .bas file
Replies: 3
Views: 2190

Re: Building an include .bas file

If they are all SUB of FUNCTION, any variables passed to the function are in their definition. Any variables DIM'd inside the function are local to that function. So there should not be any variables defined outside the SUB or FUNCTION. Though there is no rule against it, it is just good practice no...
by basicchip
Tue May 23, 2023 12:30 pm
Forum: SPI and I2C
Topic: Simple example of I2c code " My World" request
Replies: 48
Views: 15949

Re: Simple example of I2c code " My World" request

You might want to look at this in the forum https://www.coridium.us/forum/viewtopic.php?f=9&t=266&p=710 I am also thinking of breaking some of this string stuff into a separate topic. The issue comes about when your code has mismatched types. When the compiler sees string_type = number_type ' the co...
by basicchip
Mon May 22, 2023 11:10 pm
Forum: SPI and I2C
Topic: Simple example of I2c code " My World" request
Replies: 48
Views: 15949

Re: Simple example of I2c code " My World" request

It looks like you are mixing strings and characters which will not do what you want it to do. But I really need more context. Or better yet, try simple examples to see what is going on. keypadval = LCD_DATA ... or ... keypadval(0) = LCD_DATA(0) Is probably what you meant to do. keypadval is a string...
by basicchip
Mon May 22, 2023 11:05 pm
Forum: Software issues
Topic: Runaway BASIC program
Replies: 12
Views: 15466

Re: Runaway BASIC program

It has worked for me in all situations I have tried.

Disconnect the USB wait 10 seconds

Reconnect, then select the serial port quickly.

If you can send me the program, I can try here.
by basicchip
Sun May 21, 2023 6:51 pm
Forum: Software issues
Topic: Runaway BASIC program
Replies: 12
Views: 15466

Re: Runway Program needs to be stopped.

From help files and also here in the forum (search runaway program) But what if the program does not STOP. We call these runaway programs. These programs typically are flooding the serial communication channel, and this can cause issues with the driver or BASICtools Tcl program, having a hard time k...
by basicchip
Sat May 20, 2023 9:18 pm
Forum: SPI and I2C
Topic: Simple example of I2c code " My World" request
Replies: 48
Views: 15949

Re: Simple example of I2c code " My World" request

I think the help files talk about single character strings (they are a special case)

But you could just try it ---

Code: Select all

dim lcdData(10)
lcdData(0)=69
if lcdData(0) = "E" then print "they are the same"
run

...

compile done
Programming Flash *+*+
done
Executing...

they are the same
by basicchip
Sat May 20, 2023 12:04 am
Forum: SPI and I2C
Topic: Simple example of I2c code " My World" request
Replies: 48
Views: 15949

Re: Simple example of I2c code " My World" request

My last example had some unnecessary copy of strings, you can send both constant and variable strings BYREF CONST ProcStep1 as BYTE = "Pre-Wash" CONST ProcStep2 as BYTE = "1st Developer" CONST ProcStep3 as BYTE = "Wash" sub dumpstr (byref pt2string as string) print pt2string end sub main: dumpstr (P...
by basicchip
Fri May 19, 2023 11:03 pm
Forum: SPI and I2C
Topic: Simple example of I2c code " My World" request
Replies: 48
Views: 15949

Re: Simple example of I2c code " My World" request

It looks like your strings are all constants. If that is the case you can build each constant string with a CONST definition Then you can pass an address of the constant to the routine using BYREF CONST ProcStep1 as BYTE = "Pre-Wash" CONST ProcStep2 as BYTE = "1st Developer" CONST ProcStep3 as BYTE ...
by basicchip
Fri May 19, 2023 8:52 pm
Forum: Other Hardware interfaces
Topic: 6522 and 6821
Replies: 1
Views: 1706

Re: 6522 and 6821

Hard for me to answer this as I have no data to go on. Maybe there was a reason for drive capabilities of those now 40 year old parts. I was around then and using 6502 in Apple, never saw 6522.

You would have to look at the spec sheets for those parts and how they are used in the circuit.