prog skeleton
Up to Scripts
Hi
Here is a prog skeleton to interact with tux droid.
callbacks only contain a print and a say instruction.
The idea is to simplify dev beginers life.
Do you think it's a good idea?
every comments, improvments, advices are welcome!
a+
gaëlle
----------------------------------------
bonjour a tous,
j'ai codé un squelette de programme qui interagit avec tux, toutes les callback sont "creuse" (enfin il y a un print et un say).
l'idée est de simplifier la vie des dévellopeurs débutants.
Pensez vous que c'est une bonne idée?
tous les commentaire, améliorations, conseils sont les bienvenus!
a+
gaëlle
Hello skapin,
It's a good idea, thank you for this file. I think it will help many developers who want starts to program with Tux.
aaaaargh!!! i f I would have had this 2 weeks ago I would have saved about 10 hours and I wouldn't have learnt french...
wait before thank me,
I don't have my tuxdroid yet (he must arrive this week) so I don't try this prog, I will see if it works as soon as i get my tux, but be sure i will make a working version of this prog with even more explanations if i receive answers to the following questions:
an IHM (human machine interface) must be in 3 part
presentation part (the tux droid with sensors and actuators)=> the API
the controler part (the callbacks binding and the event waiting loop)
and the kernel part (where all the computational progs are)
all scripts i've seen on this site and others mix the control (the loop) and the kernel (functions) parts.
Tuxdroid hasn't a control loop already we can use in our applications?
Tuxdroid have default behaviors when it's button are pushed, can't we just replace this default behavior by our code?
for the thread stuffs, i'm not sure my programm is suitable, i will do some research about that...
I think it's enought questions for this evening,
a+
gaëlle
------------------------------
attendez avant de me remercier,
je n'ai pas encore reçu mon tuxdroid (il doit arriver cette semainek) donc je n'ai pas encore essayer ce code, je verrais si il marche dès que j'aurais installé mon ptit manchot.
je ferais très prochainement une version fiable de ce prog avec même plus d'explication si quelqu'un répond aux quelques questions que je me pose:
une IHM (Interface homme/machine) doit comporter normalement trois partie distinctes
la partie présentation part (les capteurs et actionneurs du tux droid)=>l' API
la partie controleur (le code ou se trouve le lien entre les boutons et les callbacks ainsi que la boucle d'attente des evenement )
et la partie noyau (ou se trouvent normalement tous les codes de calculs, ceux qui n'utilisent pas l'API)
Tous les scripts que j'ai vu sur ce site et sur d'autre mixent les partie controleur et noyau.
le Tuxdroid n'as-t-il pas déjà une boucle d'attente d'evenement?
le Tuxdroid as un comportement par défaut cela veut dire que des actions sont déjà relié à des événement, ne peut-on pas juste remplacer ce code par defaut par notre code a nous?
en ce qui concerne les thread, je ne suis pas du tout sûre que mon programme soit correct, je vais faire des recherches là dessus...
Je pense que ça va faire assez de question pour ce soir
a+
Well, I can't understand the difference between 2nd and 3rd phase, since a callback could require computational operation (what time is it? parse rss etc..)
anyway tux droid is NOT tux robot. so you always need a pc to make it works. so I can't understand where would you like to put a loop, if not in the scripts...
The default operations he do are: a sound when plug ac, a sound when unplug ac, and flash leds when a kery is pressed (wings, head or remote)
I didn't check your skeleton, anyway diff it with my script that is similar and works. (alarm tux)
Thanks for translation in english.
Previously skapin gaelle wrote:
wait before thank me,
I don't have my tuxdroid yet (he must arrive this week) so I don't try this prog, I will see if it works as soon as i get my tux, but be sure i will make a working version of this prog with even more explanations if i receive answers to the following questions:
an IHM (human machine interface) must be in 3 part
presentation part (the tux droid with sensors and actuators)=> the API
the controler part (the callbacks binding and the event waiting loop)
and the kernel part (where all the computational progs are)
all scripts i've seen on this site and others mix the control (the loop) and the kernel (functions) parts.
Tuxdroid hasn't a control loop already we can use in our applications?
Tuxdroid have default behaviors when it's button are pushed, can't we just replace this default behavior by our code?
for the thread stuffs, i'm not sure my programm is suitable, i will do some research about that...
I think it's enought questions for this evening,
a+
gaëlle