[Oberon] a module a page (keeps the mind sane)?

Jörg Straube joerg.straube at iaeth.ch
Mon Nov 5 23:22:53 CET 2018


F.P.

Installing tasks in the Oberon loop is THE way to enable multi tasking in Oberon.

T := Oberon.NewTask(myHandler, 1000);
Oberon.Install(T);

Every 1000 ms the procedure „myHandler“ will be called.

Another way to have cooperative multitasking is to implement module „Coroutines“.

br
Jörg

> Am 05.11.2018 um 22:02 schrieb Frans-Pieter Vonck <fp at vonck.nl>:
> 
> Eventloop the arduino way.
> (a little offtopic
> Here is a nice  example on Adafruit how multitasking can be achieved with a timer.
> https://learn.adafruit.com/multi-tasking-the-arduino-part-1/overview
> 
> As the tutorial progresses the event loop is cleaned up by using classes.
> 
> a snippet from the code:
> 
>  Flasher led1(12, 100, 400);
>  Flasher led2(13, 350, 350);
> 
> void loop()
> {
>    led1.Update();
>    led2.Update();
> }
> 
> 
> A scheduler is not necessary and the code is still readable.
> Could be nice also as an example for oberon07 (astrobe)
> 
> Greets,
> F.P.
> --
> Oberon at lists.inf.ethz.ch mailing list for ETH Oberon and related systems
> https://lists.inf.ethz.ch/mailman/listinfo/oberon



More information about the Oberon mailing list