Dear JB, greetings!

> So I started creating a little program to act as a digital counter
> with the blue led flashing at each change of logic state, it came to

Perfect way to begin!

> my attention very quickly that there is some hidden format that the
> code has to be in and some rules that I can’t find written. It seems

Actually, nothing is hidden or implicit at all. :) So, let's fix your
problem for you.

> to me that you can’t set a pin direction unless you are going to use
> it in the immediate program and I personally can’t seem to get
> smaller functions of “sethigh” and “setlow” to ever work.

You can set the direction of a pin in any context in PicoLisp. The
code you have in autorun.l must set its direction. Here's how it
works. Think of it as the default state of the pin. Some pins can be
high by default; some can be low. This is MCU specific - This
particular device works this way. The same code on an LM3S8962 Texas
Instruments Cortex clone behaves the other way.

# Will set the dir of PB_29 and turn the blue LED "on"
# automatically.
(pio-pin-setdir *pio-output* 'PB_29)

# Will turn the blue LED "off".
(pio-pin-sethigh 'PB_29)

So, your function should be:

(de high (pin)
   (pio-pin-setlow pin) )

> Is there like a comprehensive list of the way I need to be writing
> these programs?

It's regular PicoLisp. No different. Just that it runs on the MCU. :)

> I experiment a lot and I do not have the vga board so I have no
> console on screen, I’m kinda running blind and need all the heads up
> I can.

Oh! This is quite easy. Can you please use a serial terminal emulator?
I use minicom. It's a nice tool. In case you don't have it, please get
it (or another of your choice) and configure it for 115200 baud, 8N1
and no hardware flow control. So, assuming an Ubuntu GNU/Linux and
minicom:

$ sudo apt-get install minicom
$ minicom -D /dev/ttyACM0

The above should get you the Hempl shell. Invoke PicoLisp directly
from the shell. You can then type away interactively - like you would
with regular PicoLisp. You can also edit PicoLisp files on your SD
card using iv, the vi clone.

Hempl# iv /mmc/autorun.l
Hempl# picolisp /mmc/autorun.l

Please let me know if this helps you. Good luck!

R

On 1 December 2015 at 23:08, J B <k1llfre...@hotmail.co.uk> wrote:

> So I started creating a little program to act as a digital counter with
> the blue led flashing at each change of logic state, it came to my
> attention very quickly that there is some hidden format that the code has
> to be in and some rules that I can’t find written. It seems to me that you
> can’t set a pin direction unless you are going to use it in the immediate
> program and I personally can’t seem to get smaller functions of “sethigh”
> and “setlow” to ever work. Is there like a comprehensive list of the way I
> need to be writing these programs? I experiment a lot and I do not have the
> vga board so I have no console on screen, I’m kinda running blind and need
> all the heads up I can. Thanks.
>

Reply via email to