Re: [Amforth] Thankyou and turnkey

2016-06-20 Thread Matthias Trute
Am Montag, den 20.06.2016, 00:27 +0100 schrieb Tristan Williams:
> Hello Matthias,
> 
> > 
> > The good news: your code works for me. The bad news: I
> > cannot reproduce
> > what you wrote.
> My apologies. I did not explain myself well. My code worked for me
> also. It was the Cookbook example I could not get to work. 

Ok, it's not a bug in the code but in the docs. Thanks and fixed.

> Every other Cookbook example I have tried has worked first time so I
> wondered what I was doing wrong. Being new to AmForth I have much to
> learn as Erich's substantially more direct solution shows.

As usual, there are many ways to solve a problem.

> Returning to my code, my objective is to access the interpreter over
> RF. The 1 second delay in turnkey was there to allow the RF module to
> start up prior to my asking it to take over the serial
> connection. Unfortunately and confusingly I left the delay in when I
> pruned the example for the list.

:) You're welcome

Matthias
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Thankyou and turnkey

2016-06-19 Thread Tristan Williams
Hello Matthias,

> The good news: your code works for me. The bad news: I
> cannot reproduce
> what you wrote.

My apologies. I did not explain myself well. My code worked for me
also. It was the Cookbook example I could not get to work. 

>From http://amforth.sourceforge.net/TG/recipes/Turnkey.html

variable oldturnkey
' turnkey defer@ oldturnkey !
: myturnkey
   oldturnkey @ execute
   my_own_turnkey_actions
;
' myturnkey is turnkey

Every other Cookbook example I have tried has worked first time so I
wondered what I was doing wrong. Being new to AmForth I have much to
learn as Erich's substantially more direct solution shows.  

: tk.custom
  applturnkey

  \ your code goes here

;

' tk.custom is turnkey

> I was slightly confused by the 1 second delay, but even
> that works as specified.

Returning to my code, my objective is to access the interpreter over
RF. The 1 second delay in turnkey was there to allow the RF module to
start up prior to my asking it to take over the serial
connection. Unfortunately and confusingly I left the delay in when I
pruned the example for the list.

Kind regards and thanks,
Tristan


--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Thankyou and turnkey

2016-06-19 Thread Matthias Trute
Hi Tristan,

It took some time (and I had to fix a problem with the
current trunk code tree), sorry.

The good news: your code works for me. The bad news: I
cannot reproduce
what you wrote. 

Everything works as expected, no hangs no problems at all.
I was slightly confused by the 1 second delay, but even
that works as specified.


Do you have some more information that may be helpful? Version
numbers etc. When exactly hangs your code? When uploading
the file or at restarts? The hang during upload (probably
while defining "is" after the "if" statement, was a bug indeed,
but that should not occur in released versions, only in the
trunk before rev 2115.

Matthias

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://sdm.link/zohomanageengine
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Thankyou and turnkey

2016-06-15 Thread Matthias Trute
Hi Tristan,

> but I could not get it to work. Uploading the code onto a freshly
> flashed uno would result in a hanging interpreter, requiring
> re-flashing. I would be very grateful for any pointers as to what I
> am
> doing wrong.

hmm. At the first glance, everything looks fine. You save the 
default turnkey action in a place that survives the reboot, calls
it later in your own turnkey action that itself finishes so that the
interpreter loop can start.

Please give me some time to think about it.

Matthias
--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


Re: [Amforth] Thankyou and turnkey

2016-06-15 Thread Erich Wälde
Hello Tristan,

welcome to the club :-)

Tristan Williams writes:

> Hello, 
>
> I have only recently found AmForth, and have, over the last month or
> so, been making led flash, getting the time from rtc, displaying
> things on an lcd etc. It really has been a most enjoyable and
> educational couple of months for me. I thank Matthias and the AmForth
> developers for making AmForth available. I wish I had found it
> earlier.
>
> I want to put my Arduino uno to some practical use and so wish to
> implement a turnkey solution. To some extent I have done this as the
> code I've written below runs on powering up the uno, turns on the led
> and then I can connect via a serial connection to the interpreter.
>
> Is this the/a correct way to set up a turnkey solution? Is there a
> better way?
>
> Initially I tried the Cookbook code example
>
> http://amforth.sourceforge.net/TG/recipes/Turnkey.html 
>
> but I could not get it to work. Uploading the code onto a freshly
> flashed uno would result in a hanging interpreter, requiring
> re-flashing. I would be very grateful for any pointers as to what I am
> doing wrong.
>
> Many thanks,
> Tristan
> 
> \ turnkey example
>
> #include avr-values.frt
> #include is.frt
> #include ms.frt
> #include defers.frt
>
> $24 constant DDRB
> $25 constant PORTB
>
> 1 5 lshift constant uno.led 
>
> ' turnkey defer@ Evalue tk.amforth
>
> : tk.custom
>   
> tk.amforth execute
>
> 1000 ms
>
> \ init and set high uno led on pin 13   
>
> uno.led DDRB c@ or DDRB c!
> uno.led PORTB c@ or PORTB c!
> ;
>
> ' tk.custom is turnkey

You need to call the original content of turnkey, too. Something
like

: tk.custom
  applturnkey

  \ your code goes here

;

' tk.custom is turnkey

The code of "applturnkey" resides in .../words/applturnkey.asm
in the template application directory.

Cheers,
Erich


>  
> \ end turnkey example
>
> --
> What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
> patterns at an interface-level. Reveals which users, apps, and protocols are 
> consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
> J-Flow, sFlow and other flows. Make informed decisions using capacity planning
> reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
> ___
> Amforth-devel mailing list for http://amforth.sf.net/
> Amforth-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/amforth-devel


-- 
The purpose of computing is insight --- not numbers
R. Hamming

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel


[Amforth] Thankyou and turnkey

2016-06-15 Thread Tristan Williams
Hello, 

I have only recently found AmForth, and have, over the last month or
so, been making led flash, getting the time from rtc, displaying
things on an lcd etc. It really has been a most enjoyable and
educational couple of months for me. I thank Matthias and the AmForth
developers for making AmForth available. I wish I had found it
earlier.

I want to put my Arduino uno to some practical use and so wish to
implement a turnkey solution. To some extent I have done this as the
code I've written below runs on powering up the uno, turns on the led
and then I can connect via a serial connection to the interpreter.

Is this the/a correct way to set up a turnkey solution? Is there a
better way?

Initially I tried the Cookbook code example

http://amforth.sourceforge.net/TG/recipes/Turnkey.html 

but I could not get it to work. Uploading the code onto a freshly
flashed uno would result in a hanging interpreter, requiring
re-flashing. I would be very grateful for any pointers as to what I am
doing wrong.

Many thanks,
Tristan

\ turnkey example

#include avr-values.frt
#include is.frt
#include ms.frt
#include defers.frt

$24 constant DDRB
$25 constant PORTB

1 5 lshift constant uno.led 

' turnkey defer@ Evalue tk.amforth

: tk.custom

tk.amforth execute

1000 ms

\ init and set high uno led on pin 13   
   
uno.led DDRB c@ or DDRB c!
uno.led PORTB c@ or PORTB c!
;

' tk.custom is turnkey
 
\ end turnkey example

--
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are 
consuming the most bandwidth. Provides multi-vendor support for NetFlow, 
J-Flow, sFlow and other flows. Make informed decisions using capacity planning
reports. http://pubads.g.doubleclick.net/gampad/clk?id=1444514421&iu=/41014381
___
Amforth-devel mailing list for http://amforth.sf.net/
Amforth-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/amforth-devel