Arduino Function: RobotControl.drawCompass

Description

This method helps displaying the compass on the TFT. It relies on Robot.beginTFT(). drawCompass() uses debugPrint(), which can't be used in the same sketch. Use drawCompass() properly to avoid elements overlapping.

Syntax

Robot.drawCompass(degrees);

Parameters

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

Examples

#include 

int compassValue;

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

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


Based on the reference originally written by Arduino Community,  wiring.org.co and  arduino.cc