mirror of
https://github.com/arduino/Arduino.git
synced 2024-11-30 11:24:12 +01:00
40 lines
743 B
C++
40 lines
743 B
C++
#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(); |