LOCODUINO

Aide
Forum de discussion
Dépôt GIT Locoduino
Flux RSS

vendredi 29 mars 2024

Visiteurs connectés : 37

Bibliothèque Accessories (2)

Que mettre dans son croquis ?

. Par : Thierry

Cas d’école Prenons un cas simple, la gestion d’une simple DEL via un bouton poussoir et comparons diverses possibilités de codage. D’abord la version classique sans bibliothèques : // Programme 1 const int buttonPin = 2; // broche du poussoir void setup() // initialise la DEL interne de l'Arduino comme sortie (...)

Retourner à l'article

Vous répondez à :

Bibliothèque Accessories (2) 18 février 2017 10:51, par Thierry

Oui c’est possible. Commanders a un exemple tout prêt pour ça, c’est SerialCommander. La syntaxe à envoyer sur la ligne série, que ce soit par l’IDE ou un programme, est simple et décrite dans le code source de TextInterpreter.hpp :

// The accepted syntax is
// id separator event separator data
// where id can be a number from 0 to 4 000 000 000,
// where separator can be ’,’ , ’ ;’ , ’/’ or ’ ’
// where event can be any string of 9 characters long maximum, but must begin with
// ’t’ to toggle
// ’m’ to make a move, data is necessary a COMMANDERS_MOVE_TYPE enum value in this case
// ’p’ to make a move to a given position, data is necessary in this case
// ’c’ to change configuration, data is necessary in this case : high byte is the address, low byte the value.
// and where the data can be a COMMANDERS_MOVE_TYPE enum value if this is a MOVE event,
// or any number between -32767 and 32768 for a move position event.
//
// id can be dccid:dccacc for Dcc id, where dccid is the dcc address and dccacc 0 or 1.
//
// ex : 123 means ID 123 toggled
// ex : 456 | T means ID 456 toggled
// ex : 789 , p , 100 means ID 789 make an absolute movement to 100 .
// ex : 20:0 T means Dcc id 20/0 toggled

Si Accessories est ’branché’ derrière pour recevoir les événements, alors elle exécutera les ordres !

Qui êtes-vous ?
Votre message

Pour créer des paragraphes, laissez simplement des lignes vides.

Lien hypertexte

(Si votre message se réfère à un article publié sur le Web, ou à une page fournissant plus d’informations, vous pouvez indiquer ci-après le titre de la page et son adresse.)

36 Messages

Rubrique Bibliothèques

Bibliothèque Accessories (1)

Bibliothèque Accessories (2)

Un décodeur d’accessoires universel (1)

Un décodeur d’accessoires universel (2)

Un décodeur d’accessoires universel (3)

Bibliothèque LcdUi (1)

Bibliothèque LcdUi (2)

La bibliothèque Servo

Bibliothèque SoftWare Serial

Bibliothèque Serial

Bibliothèque EEPROM

Bibliothèque Wire : I2C

Bibliothèque LCD

La bibliothèque ScheduleTable

Bibliothèque MemoryUsage

Bibliothèque EEPROMextent

La bibliothèque SlowMotionServo

Bibliothèque Commanders

Bibliothèque DCCpp

Bibliothèque DcDccNanoController

La bibliothèque ACAN (1)

La bibliothèque ACAN (2)

Bibliothèque LightEffect

Les derniers articles

Bibliothèque LightEffect


Christian

La bibliothèque ACAN (2)


Jean-Luc

La bibliothèque ACAN (1)


Jean-Luc

La bibliothèque SlowMotionServo


Jean-Luc

Bibliothèque DCCpp


Thierry

Bibliothèque DcDccNanoController


Thierry

Bibliothèque LcdUi (2)


Thierry

Bibliothèque LcdUi (1)


Thierry

Bibliothèque Accessories (2)


Thierry

Bibliothèque Accessories (1)


Thierry

Les articles les plus lus

Bibliothèque Wire : I2C

Bibliothèque SoftWare Serial

La bibliothèque Servo

La bibliothèque SlowMotionServo

Bibliothèque DcDccNanoController

Bibliothèque EEPROM

Bibliothèque DCCpp

Bibliothèque MemoryUsage

Bibliothèque LCD

Bibliothèque Accessories (1)