Browse Source

diverses

master
Yves Ehrlich 4 years ago
parent
commit
968dc11fdd
  1. 1
      .~lock.ideen_mechanik_und_elektronik.odt#
  2. 2
      Code/miniRobotRC/JoystickSteuerung.ino
  3. 26
      Code/miniRobotRC/_main.ino
  4. 3
      Code/miniRobotRC/fahrsteuerung_old.ino
  5. 4
      Code/miniRobotRC/interruptRoutinen.ino
  6. 3
      Code/miniRobotRC/miniRobotRC.ino
  7. 10
      Code/miniRobotRC/temp.ino

1
.~lock.ideen_mechanik_und_elektronik.odt#

@ -1 +0,0 @@
,yves,yves-UB,05.02.2020 13:51,file:///home/yves/.config/libreoffice/4;

2
Code/miniRobotRC/JoystickSteuerung.ino

@ -60,7 +60,7 @@ void joystickInit() {
lcd.print("RightPWM: ");
lcd.print(right -> PWMValue);*/
lcdLines[0] = "Links: " + String(left -> PWMValue, DEC);
lcdLines[1] = "Links: " + String(right -> PWMValue, DEC);
lcdLines[1] = "Rechts: " + String(right -> PWMValue, DEC);
}
void send(){

26
Code/miniRobotRC/_main.ino

@ -15,7 +15,7 @@ void setup() {
driveTimeout = 10;
joystickInit(); //TODO
clearCommands();
renderTime = millis();
}
void loop() {
@ -23,17 +23,22 @@ void loop() {
while(!tasten.getButtonCycle(buttonStart)) {
manualDigitalDrive();
updateTemp();
//updateTemp();
String temp_str = "T: " + String(temperature) + " Grad C";
lcdLines[5] = temp_str;
refreshLCD();
}
tasten.clearButton(buttonStart);
while(!tasten.getButtonCycle(buttonStart)){
motorMapping();
updateTemp();
//updateTemp();
refreshLCD();
}
tasten.clearButton(buttonStart);
while(!tasten.getButtonCycle(buttonStart)){
joystickSteuerung(); //TODO ()
updateTemp();
//updateTemp();
refreshLCD();
}
tasten.clearButton(buttonStart);
}
@ -43,3 +48,16 @@ void lcdMenu() {
}
void refreshLCD() {
if((millis() - renderTime) >= renderTimeout) {
lcd.clear();
for(uint8_t i = 0; i < sizeof(lcdLines); i++) {
lcd.gotoXY(0, i);
lcd.print(lcdLines[i]);
}
lcd.renderAll();
renderTime = millis();
}
}

3
Code/miniRobotRC/fahrsteuerung_old.ino

@ -1,12 +1,11 @@
void manualDigitalDrive() {
bool goOn = false;
String temp_str = "T: " + String(temperature) + " Grad C";
lcdLines[5] = temp_str;
// while(!tasten.getButtonCycle(buttonL1)) {
clearCommands();
if(!tasten.getAnyPressed()) {
lcdLines[0] = "Warte...";
lcdLines[1] = "";
}
if(tasten.checkButton(buttonB) || tasten.checkButton(buttonUp)) {

4
Code/miniRobotRC/interruptRoutinen.ino

@ -1,7 +1,7 @@
//HIER KOMMT ALLES REIN WAS 1 MAL PRO ms AUFGERUFEN WERDEN SOLL!!!
ISR(TIMER2_COMPA_vect) {
tasten.checkButtons();
renderTime++;
/*renderTime++;
if(renderTime >= renderTimeout) {
lcd.clear();
for(uint8_t i = 0; i < sizeof(lcdLines); i++) {
@ -10,6 +10,6 @@ ISR(TIMER2_COMPA_vect) {
}
lcd.renderAll();
renderTime = 0;
}
} */
}
//ALLE anderen ISR kommen HIER drunter!!!

3
Code/miniRobotRC/miniRobotRC.ino

@ -16,7 +16,7 @@ volatile myInterrupts Timer2;
volatile myInterrupts pwmBL;
volatile shiftRegButton tasten;
//LCD
uint8_t renderTime = 0;
/*uint8_t */long renderTime = 0;
#define renderTimeout 100 //es wird alle 100ms gerendert
String lcdLines[6]; //Strings welche alle 100ms ausgegeben werden
@ -42,6 +42,7 @@ uint16_t driveTimeout = 0;
uint8_t distance;
uint8_t temperature = 0;
unsigned long temp_time = millis();
//Funk

10
Code/miniRobotRC/temp.ino

@ -7,7 +7,7 @@
clearCommands();
commands[0] = getTemp;
radio.write(&commands, sizeof(commands) && !err);
radio.write(&commands, sizeof(commands) /* && !err */);
unsigned long start = micros();
radio.startListening();
while(!radio.available()){
@ -16,13 +16,17 @@
if((unsigned long)(currentMicros - start) >= 1){
err = true;
}
}
/*
int16_t readData;
radio.read(&readData, sizeof(int16_t));
temperature = readData; */
}
if(!err){
int16_t readData;
radio.read(&readData, sizeof(int16_t));
temperature = readData;
}
}
radio.stopListening();
clearCommands();
}

Loading…
Cancel
Save