Reference   Language | Libraries | Comparison | Changes

Robot

drawCompass()

Description

A helper function for displaying the compass on the TFT. Relies on Robot.beginTFT(). drawCompass() uses debugPrint(), which can't be used in the same sketch.

Mind where you draw text and other graphic elements when using drawCompass() so that you don;t overlap elements.

Syntax

Robot.drawCompass(degrees);

Parameters

degrees: int between 0 and 359. Typically it's determined by Robot.compassRead().

Returns

none

Examples

#include <ArduinoRobot.h>

int compassValue;

void setup(){
  Robot.begin();
  Robot.beginTFT();//Initialize the TFT module
}

void loop(){
  compassValue=Robot.compassRead();
  Robot.drawCompass(compassValue);//draw the compass
}

See also

Reference Home

Corrections, suggestions, and new documentation should be posted to the Forum.

The text of the Arduino reference is licensed under a Creative Commons Attribution-ShareAlike 3.0 License. Code samples in the reference are released into the public domain.

Share