In, out Statements

42 views
Skip to first unread message

Peter Becker

unread,
Dec 2, 2013, 10:35:01 AM12/2/13
to solde...@googlegroups.com
I received my solder core this week and i was surprised over this mighty  interpreter. But i searched for such simple statement like in or out. I found something like tis in the post:
"1.3.5. analog output bug" by Charles Witt. Are these statements only present if i had loaded a special driver?.I don't find such statements in the BASIC-Manual. Is there anything like ARDUINO analogwrite or analogread?
II want to use the Soldercore controller-Board without any accessories.

Tom Morrison

unread,
Dec 2, 2013, 11:00:04 AM12/2/13
to solde...@googlegroups.com
Hi Peter,

This is pretty simple on the SolderCore.  You first need to tell the SolderCore the mode of each pin (ex PIN 14 AS ANALOG INPUT).  You can then reference the pins quite simply (ex PRINT PIN 14).  I wrote the following to test one of my custom PCBs while the SolderCore is plugged in.  I believe this should be obvious, but please let me know if you have any questions.

Later,
Tom

   10 PRINT "SolderCore board test"

   20 FOR I = 4 TO 8

   30   PIN I AS DIGITAL INPUT

   40   PRINT "pin", I, PIN I

   50 NEXT I

   60 FOR I = 14 TO 17

   70   PIN I AS ANALOG INPUT

   80   PRINT "pin", I, PIN I

   90 NEXT I

  100 FOR I = 2 TO 3

  110   PIN I AS ANALOG INPUT

  120   PRINT "pin", I, PIN I

  130 NEXT I

  140 '

CoreBASIC Wizard

unread,
Dec 2, 2013, 7:58:25 PM12/2/13
to solde...@googlegroups.com
It's actually pretty easy even without using PIN statements.  :-)

You can just type in immediate mode (letter case does not matter):

PRINT CORE.A4

This prints the analog value read from pin 4 on the digital header.  The mnemonic is that "A" means "Analog".  This is the equivalent of analogRead().

If you wish to read it in digital mode, use:

PRINT CORE.D4

The SolderCore has more analog inputs than the Arduino so some of the digital headers (D0-D13) can be read correctly in analog mode.  If the pin does not support analog input mode, you'll get an error.

Note that you can read pins indexed this way too:

I = 5
PRINT CORE.A(I)

If you attach a SolderCore Breakout Shield to the SolderCore, you can test each output too:

CORE.D(0) = 1
CORE.D(0) = 0

Again, this is interactive.  You can put this in a program, but I quite like the interactivity,

Regards,

-- Paul.

Peter Becker

unread,
Dec 3, 2013, 1:42:40 PM12/3/13
to solde...@googlegroups.com
Hi,

thanks for quick response. I am pretty that it seems so simple. But still a question: I didn't find that in the Corebasic-Reference- Manual. Is there still another Manual ?

regards

Peter

Peter Becker

unread,
Dec 3, 2013, 1:52:09 PM12/3/13
to solde...@googlegroups.com
Hi,

thanks for the quick response. That was the answer i was looking for. My question is, why I couldn't find that in the reference manual ?

regards

Peter

CoreBASIC Wizard

unread,
Dec 5, 2013, 10:37:52 AM12/5/13
to solde...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages