aboutsummaryrefslogtreecommitdiff
path: root/libraries/Robot_Control/ArduinoRobot.cpp
blob: 3adac73ba8a0e7e67fe3f2f535d90f0ee95dd52d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include "ArduinoRobot.h"
#include "Multiplexer.h"
#include "Wire.h"
#include "EasyTransfer2.h"

//RobotControl::RobotControl(){}

RobotControl::RobotControl():Arduino_LCD(LCD_CS,DC_LCD,RST_LCD){

}

void RobotControl::begin(){
	Wire.begin();
	//Compass
	//nothing here
		
	//TK sensors
	uint8_t MuxPins[]={MUXA,MUXB,MUXC,MUXD};
	Multiplexer::begin(MuxPins,MUX_IN,4);
	
	//piezo
	pinMode(BUZZ,OUTPUT);
	
	//communication
	Serial1.begin(9600);
	messageOut.begin(&Serial1);
	messageIn.begin(&Serial1);
	
	//TFT initialization
	//Arduino_LCD::initR(INITR_GREENTAB);
}

void RobotControl::setMode(uint8_t mode){
	messageOut.writeByte(COMMAND_SWITCH_MODE);
	messageOut.writeByte(mode);
	messageOut.sendData();
}


RobotControl Robot=RobotControl();