Différences entre versions de « Pololu-Zumo-Shield-Arduino-bibliotheque-Zumo »

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche
Ligne 19 : Ligne 19 :
  
 
== ZumoBuzzer ==
 
== ZumoBuzzer ==
The ZumoBuzzer library provides functions that allow various sounds to be played on the buzzer of the Zumo Shield, from simple beeps to complex tunes. (See Section 3 for more details about the buzzer and Section 3.c for an explanation of the buzzer control jumper settings.)
+
The ZumoBuzzer library provides functions that allow various sounds to be played on the buzzer of the Zumo Shield, from simple beeps to complex tunes. (See Section 3 for more details about the buzzer and [[Pololu-Zumo-Shield-Arduino-configuration-cavalier|Section 3.c]] for an explanation of the buzzer control jumper settings.)
  
 
The ZumoBuzzer library is fully compatible with the [https://www.pololu.com/docs/0J18/3 OrangutanBuzzer] functions in the [https://www.pololu.com/docs/0J20 Pololu AVR C/C++ Library], so any melodies written for OrangutanBuzzer functions will also work with ZumoBuzzer functions.
 
The ZumoBuzzer library is fully compatible with the [https://www.pololu.com/docs/0J18/3 OrangutanBuzzer] functions in the [https://www.pololu.com/docs/0J20 Pololu AVR C/C++ Library], so any melodies written for OrangutanBuzzer functions will also work with ZumoBuzzer functions.
  
 +
== PushButton ==
 +
The Pushbutton library provides a set of functions that are useful for detecting and debouncing pushbutton presses. While the most obvious application of this library is to work with the Zumo Shield’s user pushbutton on digital pin 12, this library can be used as a general-purpose library for interfacing many types of buttons and switches to an Arduino, even without a Zumo Shield.
 +
 +
== ZumoReflectanceSensorArray ==
 +
This library provides a set of functions for reading reflectance values from a Zumo reflectance sensor array {{polpl|1419}}. See [[Section 2.c]] for more information on the Zumo reflectance sensor array.
 +
 +
This library depends on the QTRSensors library. The ZumoReflectanceSensorArray class is a subclass of QTRSensorsRC. The functions provided by QTRSensorsRC can also be used on the ZumoReflectanceSensorArray class, and are documented in the Arduino Library for the Pololu QTR Reflectance Sensors document.
  
 
{{Pololu-Zumo-Shield-Arduino-TRAILER}}
 
{{Pololu-Zumo-Shield-Arduino-TRAILER}}

Version du 11 avril 2017 à 20:17

Introduction

Our Zumo Shield Libraries make it easy to get started writing Arduino sketches to control your Zumo. A link to download the library and installation instructions can be found on the libraries’ github page.

Once installed, we recommend you try out the example sketches for each library, which can be found under File > Examples > (name of the library), to get a better understanding of how to use the library functions. You can also find some more complex examples, not specific to any particular library, under File > Examples > ZumoExamples; Section 7 describes these examples in detail.

The Zumo Shield Libraries include the following:

  • ZumoMotors
  • ZumoBuzzer
  • PushButton
  • ZumoReflectanceSensorArray
  • QTRSensors

ZumoMotors

The ZumoMotors library provides functions for PWM-based speed (and direction) control of the two motors on the Zumo with the onboard DRV8835 dual motor driver. On Arduinos with ATmega328P, ATmega168, and ATmega32U4 microcontrollers (which include the A-Star 32U4 Prime, Arduino Leonardo, Arduino Uno, and most older Arduinos), the motor control functions use hardware PWM outputs from Timer1 to generate pulse width modulation at a 20 kHz frequency. (See Section 3 "Le Shield Zumo en détails" for more details about the motor driver and its connections.)

If you accidentally soldered a motor to the Zumo Shield backwards (opposite the orientation indicated in the assembly instructions), you can simply call flipLeftMotor(true) and/or flipRightMotor(true) to make the motors behave consistently with the directions in your code.

ZumoBuzzer

The ZumoBuzzer library provides functions that allow various sounds to be played on the buzzer of the Zumo Shield, from simple beeps to complex tunes. (See Section 3 for more details about the buzzer and Section 3.c for an explanation of the buzzer control jumper settings.)

The ZumoBuzzer library is fully compatible with the OrangutanBuzzer functions in the Pololu AVR C/C++ Library, so any melodies written for OrangutanBuzzer functions will also work with ZumoBuzzer functions.

PushButton

The Pushbutton library provides a set of functions that are useful for detecting and debouncing pushbutton presses. While the most obvious application of this library is to work with the Zumo Shield’s user pushbutton on digital pin 12, this library can be used as a general-purpose library for interfacing many types of buttons and switches to an Arduino, even without a Zumo Shield.

ZumoReflectanceSensorArray

This library provides a set of functions for reading reflectance values from a Zumo reflectance sensor array lien pololu. See Section 2.c for more information on the Zumo reflectance sensor array.

This library depends on the QTRSensors library. The ZumoReflectanceSensorArray class is a subclass of QTRSensorsRC. The functions provided by QTRSensorsRC can also be used on the ZumoReflectanceSensorArray class, and are documented in the Arduino Library for the Pololu QTR Reflectance Sensors document.


Basé sur "Zumo Shield for Arduino" de Pololu (www.pololu.com/docs/0J57) - Traduit en Français par shop.mchobby.be CC-BY-SA pour la traduction
Toute copie doit contenir ce crédit, lien vers cette page et la section "crédit de traduction". Traduit avec l'autorisation expresse de Pololu (www.pololu.com)

Based on "Zumo Shield for Arduino" from Pololu (www.pololu.com/docs/0J57) - Translated to French by shop.mchobby.be CC-BY-SA for the translation
Copies must includes this credit, link to this page and the section "crédit de traduction" (translation credit). Translated with the Pololu's authorization (www.pololu.com)