arpschuino32 inputs

Questions sur les codes officiels du core arpschuino
Questions about official codes from arpschuino core
Répondre
Jacques
Messages : 265
Enregistré le : dim. 31 oct. 2021 19:37

arpschuino32 inputs

Message par Jacques »

Konrad from Germany asks us the following question:
Hi Jacques,

I'm excited. I was able to put 4 stepper motors into operation.

How can I query the input port of the arpschuino32?

Thanks and Greetings,

 

Konrad
Hi Konrad,
thank you for your enthusiasm, I'm glad that the implementation of your stepper motors is going well.
I guess you want to put endstop swiches or something like that?
For now, the digital and analog inputs are not ported in the V1 firmware... It's in the todo list but I'm currently working on the I2C port and I have to finish that first.
That said, in the meantime, if you code a bit, you can use the custom mode of ports A and B.
To do this, you must first download the source code of the firmare arpschuino32 from the download page of the arpschuino site.
You will then need VScode and the platformIO plugin to compile it.
Then you can edit the Custom_port.cpp file. I advise you not to edit the other files otherwise the code will no longer work correctly.
In this file, you will find 3 functions for each port.
You can code in it a bit like with a classic arduino, while keeping the functionality of the firmware.
void setupA(): it's like the void setup() of the arduino, you just have to specify the number of DMX channels used (if you use any) with: portA.setNbDmxChannels(4);
void at_each_loop_A() , this loop is executed continuously like void loop() of arduino.
void action_A(const std::vector<uint8_t> & DMXslice) this loop is executed at each signal reception dmx or Artnet. It's a bit like an interuption.

So ! I also have in the todo list a real tutorial on custom mode but I haven't started yet...
Do not hesitate to ask questions, we are here to help you on this forum.

Edit / RitoonL, je me permet de traduire pour les non anglophones :

L'utilisateur Konrad d'Allemagne nous a posé cette question par Mail :
Bonjour Jacques,
Je suis enthousiastes, j'ai réussi à faire fonctionner 4 moteurs Pas à pas avec l'arpschuino32
comment puis-je faire fonctionner l'input port de la carte ?
Merci beaucoup

Konrad
Bonjour Konrad,

Merci pour ton enthousiasme, je suis heureux que l'implantation des tes moteurs pas à pas avance bien.
Je suppose que tu souhaite utiliser des interrupteurs de fin de course ou quelque chose d'équivalent ?
Actuellement, les entrées analogiques et digitales ne sont pas encore portées dans le firmware ... c'est dans la todo liste, mais je travaille actuellement sur le port I2C et doit terminer cela avant.
Toutefois, si tu es rompu au code, tu peux utiliser le custom mode des ports A et B.
Pour ce faire, il faut télécharger la source du firmware de l'arpschuino32 depuis la page de téléchargement du site arpschuino.
Tu auras aussi besoin de VScode et du plugin platformIO pour pouvoir le compiler.
Ensuite, tu peux éditer le fichier Custom_port.cpp. Je recommande de ne toucher qu'à ce fichier, sinon le code ne fonctionnera plus correctement.
Dans ce fichier, tu trouvera 3 fonctions pour chaque port.
Tu peux entrer ton code dans ces fonctions un peu comme pour un arduino classique, tout en conservant les fonctionnalités du firmware.

void setupA(): c'est comme le void setup() de l'arduino, il suffit d'y préciser le nombre d'adresses DMX (si tu en utilise) avec : portA.setNbDmxChannels(4);
void at_each_loop_A() , cette boucles est executée continuellement comme le void loop() d'arduino.
void action_A(const std::vector<uint8_t> & DMXslice) cette boucle est executée à chaque réception du signal DMX ou Artnet, c'est un peu comme une interruption.

Un Tuto pour le custom mode est aussi dans la TODO list, mais ije n'ai pas encore commencé à l'écrire.
N'hésites pas à poser tes questions sur ce forum, nous sommes là pour t'accompagner.
Avatar du membre
RitoonL
Administrateur du site
Messages : 112
Enregistré le : dim. 31 oct. 2021 10:21

Re: arpschuino32 inputs

Message par RitoonL »

Hi Konrad,

Some useful informations about inputs and endstops are provided here :

https://www.forum.arpschuino.fr/viewtopic.php?t=52
https://www.forum.arpschuino.fr/viewtopic.php?t=56
https://www.forum.arpschuino.fr/viewtopic.php?t=57

Please note that for next 1.1 update of the firmware, the example provided in custom mode will be for steppers with homing, so you can use inputs for homing or Endstops.

Steppers will be revamped soon and is planned for 1.2 version of the firmware, this will include inputs management to be used as endstops. it will be a major update, as we are on a "delivered when ready" timeline, we're unable to provide any date. But we'll be pleased if you wish to beta test, this will help and you will be updated with hotfixes during the process.
Administrateur - Forum arpschuino
Répondre