diff --git a/Inc/comms.h b/Inc/comms.h new file mode 100644 index 00000000..e28aba7b --- /dev/null +++ b/Inc/comms.h @@ -0,0 +1,29 @@ +/* +* This file is part of the hoverboard-firmware-hack project. +* +* Copyright (C) 2017-2018 Rene Hopf +* Copyright (C) 2017-2018 Nico Stute +* Copyright (C) 2017-2018 Niklas Fauth +* Copyright (C) 2018 Jan Kossowski +* +* This program is free software: you can redistribute it and/or modify +* it under the terms of the GNU General Public License as published by +* the Free Software Foundation, either version 3 of the License, or +* (at your option) any later version. +* +* This program is distributed in the hope that it will be useful, +* but WITHOUT ANY WARRANTY; without even the implied warranty of +* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +* GNU General Public License for more details. +* +* You should have received a copy of the GNU General Public License +* along with this program. If not, see . +*/ + +#pragma once + +void setScopeChannel(uint8_t ch, int16_t val); +void consoleScope(); +void consoleLog(char *message); + + diff --git a/Inc/config.h b/Inc/config.h index f7e035fc..cb361b2b 100644 --- a/Inc/config.h +++ b/Inc/config.h @@ -45,7 +45,7 @@ // ############################### SERIAL DEBUG ############################### -#define DEBUG_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuck or lcd) is used! +//#define DEBUG_SERIAL_USART3 // right sensor board cable, disable if I2C (nunchuck or lcd) is used! #define DEBUG_BAUD 115200 // UART baud rate //#define DEBUG_SERIAL_SERVOTERM #define DEBUG_SERIAL_ASCII // "1:345 2:1337 3:0 4:0 5:0 6:0 7:0 8:0\r\n" @@ -54,7 +54,7 @@ // ###### CONTROL VIA UART (serial) ###### //#define CONTROL_SERIAL_USART2 // left sensor board cable, disable if ADC or PPM is used! -#define CONTROL_BAUD 19200 // control via usart from eg an Arduino or raspberry +//#define CONTROL_BAUD 19200 // control via usart from eg an Arduino or raspberry // for Arduino, use void loop(void){ Serial.write((uint8_t *) &steer, sizeof(steer)); Serial.write((uint8_t *) &speed, sizeof(speed));delay(20); } // ###### CONTROL VIA RC REMOTE ###### @@ -64,7 +64,7 @@ // ###### CONTROL VIA TWO POTENTIOMETERS ###### // ADC-calibration to cover the full poti-range: connect potis to left sensor board cable (0 to 3.3V) (do NOT use the red 15V wire in the cable!). see . turn the potis to minimum position, write value 1 to ADC1_MIN and value 2 to ADC2_MIN. turn to maximum position and repeat it for ADC?_MAX. make, flash and test it. -#define CONTROL_ADC // use ADC as input. disable DEBUG_SERIAL_USART2! +//#define CONTROL_ADC // use ADC as input. disable DEBUG_SERIAL_USART2! #define ADC1_MIN 0 // min ADC1-value while poti at minimum-position (0 - 4095) #define ADC1_MAX 4095 // max ADC1-value while poti at maximum-position (0 - 4095) #define ADC2_MIN 0 // min ADC2-value while poti at minimum-position (0 - 4095) @@ -72,7 +72,7 @@ // ###### CONTROL VIA NINTENDO NUNCHUCK ###### // left sensor board cable. keep cable short, use shielded cable, use ferrits, stabalize voltage in nunchuck, use the right one of the 2 types of nunchucks, add i2c pullups. use original nunchuck. most clones does not work very well. -//#define CONTROL_NUNCHUCK // use nunchuck as input. disable DEBUG_SERIAL_USART3! +#define CONTROL_NUNCHUCK // use nunchuck as input. disable DEBUG_SERIAL_USART3! // ############################### DRIVING BEHAVIOR ############################### diff --git a/Src/main.c b/Src/main.c index b737a77c..7f72a5d6 100644 --- a/Src/main.c +++ b/Src/main.c @@ -23,8 +23,11 @@ #include "defines.h" #include "setup.h" #include "config.h" +#include "comms.h" //#include "hd44780.h" +#include //for abs() + void SystemClock_Config(void); extern TIM_HandleTypeDef htim_left; diff --git a/pinout.png b/pinout.png index 76372c53..4e980fb7 100644 Binary files a/pinout.png and b/pinout.png differ