File: ArduinoRobot.cpp

package info (click to toggle)
arduino 2%3A1.0.5%2Bdfsg2-4.1
  • links: PTS, VCS
  • area: main
  • in suites: buster, stretch
  • size: 40,336 kB
  • sloc: java: 57,238; cpp: 23,031; ansic: 13,695; makefile: 2,315; xml: 502; perl: 201; sh: 156; python: 62
file content (40 lines) | stat: -rw-r--r-- 743 bytes parent folder | download | duplicates (2)
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();