Ligne 10 : |
Ligne 10 : |
| | | |
| == Pullup et broche en sortie == | | == Pullup et broche en sortie == |
− | The old-style way of turning on a pin as an input with a pullup is to use
| + | L'ancienne façon d'activer la résistance pull-up (qui ramène le potentiel à +3.3v) sur une broche entrée était codé comme suit: |
| | | |
| <nowiki>pinMode(pin, INPUT) | | <nowiki>pinMode(pin, INPUT) |
| digitalWrite(pin, HIGH)</nowiki> | | digitalWrite(pin, HIGH)</nowiki> |
| | | |
− | This is because the pullup-selection register is the same as the output-selection register.
| + | Il en était ainsi parce que le registre de sélection pull-up était le même que le registre de sélection des sorties. |
| | | |
− | For the M0, you can't do this anymore! Instead, use
| + | Vous ne pouvez plus faire cela sur un M0! A la place, vous devez utiliser |
| | | |
| <nowiki>pinMode(pin, INPUT_PULLUP)</nowiki> | | <nowiki>pinMode(pin, INPUT_PULLUP)</nowiki> |
| | | |
− | which has the benefit of being backwards compatible with AVR.
| + | Option qui à l'avantage d'être rétro-compatible avec AVR. |
| | | |
− | Serial vs SerialUSB
| + | == Sérial vs SerialUSB == |
| | | |
− | 99.9% of your existing Arduino sketches use '''Serial.print''' to debug and give output. For the Official Arduino SAMD/M0 core, this goes to the Serial5 port, which isn't exposed on the Feather. The USB port for the Official Arduino M0 core, is called '''SerialUSB''' instead. | + | 99.9% de nos croquis Arduino utilisent '''Serial.print''' pour faire du débogage et produire des sorties d'information. Sur l'Arduino SAMD/M0 officiel, les instructions sont dirigés vers le port série Serial5 qui n'est pas "''exposé''"/accessible sur le Feather. {{fname|Le port USB sur l'Arduino M0 officiel est appelé '''SerialUSB'''}}. |
| | | |
− | In the Adafruit M0 Core, we fixed it so that Serial goes to USB when you use a Feather M0 so it will automatically work just fine.
| + | Sur les plateformes Adafruit M0, le port série à été redirigé le port USB. Par conséquent tout fonctionne parfaitement sur un Feather M0 (et de façon totalement automatique). |
| | | |
− | However, on the off chance you are using the official Arduino SAMD core & you want your Serial prints and reads to use the USB port, use '''SerialUSB''' instead of Serial in your sketch
| + | Cependant, si vous comptez aussi utiliser un Arduino Arduino SAMD officiel et si vous désirez afficher des messages via le port série ALORS utilisez '''SerialUSB''' à la place de Serial |
| | | |
− | If you have existing sketches and code and you want them to work with the M0 without a huge find-replace, put
| + | Si vous avez des croquis existant et que vous désirez utiliser ces derniers sur un M0 sans devoir faire une volée de rechercher-remplacer alors optez pour: |
| | | |
| <nowiki>#if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL) | | <nowiki>#if defined(ARDUINO_SAMD_ZERO) && defined(SERIAL_PORT_USBVIRTUAL) |
Ligne 38 : |
Ligne 38 : |
| #endif</nowiki> | | #endif</nowiki> |
| | | |
− | '''right above the first''' function definition in your code. For example: | + | '''juste avant la première''' définition de fonction de votre code. Par exemple: |
| | | |
| {{ADFImage|FEATHER-M0-Adapter-Croquis-00.png}} | | {{ADFImage|FEATHER-M0-Adapter-Croquis-00.png}} |