Arduino Robot-Librairie

De MCHobby - Wiki
Sauter à la navigation Sauter à la recherche


MCHobby investit du temps et de l'argent dans la réalisation de traduction et/ou documentation. C'est un travail long et fastidieux réalisé dans l'esprit Open-Source... donc gratuit et librement accessible.
SI vous aimez nos traductions et documentations ALORS aidez nous à en produire plus en achetant vos produits chez MCHobby.

La librairie Robot

The Robot library is included with Arduino IDE 1.0.5 and later.

The Robot has a number of built in sensors and actuators. The library is designed to easily access the robot's functionality.

The robot has two boards, a motor board and control board. Each borad has a separate programmable processor.

The library allows you to interface with the various sensors and peripherals on the control board :

  • potentiometer
  • 5 momentary switches
  • 160x120 pixel color screen
  • 512Kbit EEPROM
  • speaker
  • compass
  • 3 I2C connectors
  • 8 TinkerKit input connectors

The library also enables you to do a number of things with the motor board :

  • control motor speed and direction
  • sense the current used by each motor
  • read the state of the 5 floor sensors (also known as line detection sensors)
  • access I/O pins on the board
  • control an I2C port
  • read the state of 4 TinkerKit inputs

For more information about the Robot, visit the Guide Démarrage et la présentation matérielle.

== Library structure

This library enables easy access to the functionality of the Arduino Robot. It relies on a number of 3rd party libraries including Fat16, EasyTransfer, Squawk, and IRRemote. It also relies on a number of Arduino libraries like TFT, SPI et Wire. Their functionality has been replicated inside the robot's library to optimize the code's size.

It is possible to program both the Control and the Motor boards. However, it is recommended that novice programmers begin with programming the control board, leaving the motor board for later. The library exposes the sensors on both boards through a single object.

There are two main classes that command the robot:

  • RobotControl: commands the Control Board as well as the I/Os and motors on the Motor Board, when running the default firmware.
  • RobotMotor: commands the Motor Board. Use it to make your own custom version of the Motor Board firmware

Exemples

Voici quelques exemples pour illustrer les possibilités du robot et vous aider à démarrer rapidement avec les fonctionnalités de base.

  • Logo arduino.cc - Indiquez à votre robot où se rendre à l'aide du clavier.
  • Line Following arduino.cc - Dessinez un circuit que votre robot parcourra
  • Disco Bot arduino.cc - transformez votre robot en jukebox 8-bit et le faire dancer sur le rythme (beat)
  • Compass arduino.cc - planifier une chasse au trésor à l'aide de la boussole digital
  • Inputs arduino.cc - apprenez à contrôler le potentiomètre et le clavier
  • Wheel Calibration arduino.cc - synchronisez les roues pour obtenir une meilleur performance
  • Runaway Robot arduino.cc - jouez à chat avec votre robot en utilisant le senseur de distance
  • Remote control arduino.cc - Réutiliser une vieille télécommande de télévision pour commander votre robot à distance
  • Picture browser arduino.cc - Envie d'utiliser vos propres images? Voici comment faire
  • Rescue arduino.cc - Apprenez à votre robot à trouver les perles cachées dans un labyrinthe
  • Hello User arduino.cc - Hackez la démo de bienvenue du robot et réalisez votre propre démo

Autre

Les liens vers les noms de fonction doivent commencer par "RB-ARD-ROBOT-Func-" avec comme exemple RB-ARD-ROBOT-Func-digitalRead pour Robot.digitalRead()

Robot.digitalRead()

Robot.digitalWrite()

Robot.analogRead()

Robot.motorsWrite()



Source: Arduino Robot, getting started with the Arduino Robot, the Robot's library pages. Crédit: Arduino.cc, licence Creative Common Attribution ShareAlike.

Toute référence, mention ou extrait de cette traduction doit être explicitement accompagné du texte suivant : «  Traduction par MCHobby (www.MCHobby.be) - Vente de kit et composants » avec un lien vers la source (donc cette page) et ce quelque soit le média utilisé.

L'utilisation commercial de la traduction (texte) et/ou réalisation, même partielle, pourrait être soumis à redevance. Dans tous les cas de figures, vous devez également obtenir l'accord du(des) détenteur initial des droits. Celui de MC Hobby s'arrêtant au travail de traduction proprement dit.