srcp-scripting-fr
no way to compare when less than two revisions
Differences
This shows you the differences between two versions of the page.
| — | srcp-scripting-fr [2018/11/12 08:56] (current) – created - external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Les scripts SRCP ====== | ||
| + | [[: | ||
| + | [[france | Sommaire ]] -> [[france# | ||
| + | * [[: | ||
| + | \\ | ||
| + | |||
| + | |||
| + | ===== pyControl ===== | ||
| + | * http:// | ||
| + | |||
| + | Pour utiliser pyControl télécharger les sources des développeurs de l' | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | et les exemples: | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | * [[http:// | ||
| + | \\ | ||
| + | Note: srcp.py doit être au moins la version 0.9.2 et Rocrail 2.0 Rev 3506.\\ | ||
| + | Si vous voulez utiliser Keyboard.py ou Keyboardflex.py et non tous les commutateurs définis dans Rocrail vous pouvez insérer la ligne suivante après la réussite de l' | ||
| + | srcp.srcpcommand.setignore_412_416(1) | ||
| + | cela ignorera certaines erreurs/ | ||
| + | \\ | ||
| + | \\ | ||
| + | Voici un petit exemple (sans aucune vérification d' | ||
| + | # | ||
| + | | ||
| + | import srcp | ||
| + | import time | ||
| + | | ||
| + | SRCP_BUS=1 | ||
| + | | ||
| + | # use switch/ | ||
| + | mySwitch = srcp.GA(SRCP_BUS, | ||
| + | myLoco = srcp.GL(SRCP_BUS, | ||
| + | | ||
| + | # send some switch commands | ||
| + | mySwitch.actuate(0, | ||
| + | time.sleep(1) | ||
| + | mySwitch.actuate(1, | ||
| + | time.sleep(1) | ||
| + | mySwitch.actuate(0, | ||
| + | time.sleep(1) | ||
| + | mySwitch.actuate(1, | ||
| + | time.sleep(1) | ||
| + | | ||
| + | myLoco.setF(1, | ||
| + | myLoco.send() | ||
| + | time.sleep(1) | ||
| + | myLoco.setF(2, | ||
| + | myLoco.send() | ||
| + | time.sleep(1) | ||
| + | myLoco.setF(1, | ||
| + | myLoco.setF(2, | ||
| + | myLoco.send() | ||
srcp-scripting-fr.txt · Last modified: 2018/11/12 08:56 by 127.0.0.1