Skip to content
Snippets Groups Projects
Commit a88d5f91 authored by Werner Sembach's avatar Werner Sembach
Browse files

Update README.md

parent c89897b1
No related branches found
No related tags found
No related merge requests found
......@@ -3,22 +3,24 @@
## Contents
1. [ADC](#1-adc) for reading potentiometer values
2. [DCMotor](#2-dcmotor) for running a motordriver
2. [DCMotor](#2-dcmotor) for running the IBT_2 motordriver
- http://www.hessmer.org/blog/wp-content/uploads/2013/12/IBT-2Module.jpg
- https://www.ebay.de/sch/i.html?_from=R40&_trksid=p2380057.m570.l1313.TR0.TRC0.H0.XBTS7960+Motordriver.TRS0&_nkw=BTS7960+Motordriver&_sacat=0
3. [ExternButton](#3-externbutton) for reading the value of a button connecting a GPIO pin with GND
4. [ServoMotor](#4-servomotor) for running a servomotor
## 1. ADC
# How to Use
### How to Use
1. Connect outermost pins of the potentiometer to 3V und GND on the board.
2. Connect middle pin of potentiometer to GPIO pin PC1,
3. Add ADC.c to your CMake target: ECOS_ADD_EXECUTABLE(app main.c src/ADC.c <other sources>)
3. Add ADC.cpp to your CMake target: ECOS_ADD_EXECUTABLE(app main.c src/ADC.c <other sources>)
4. Include ADC.h where you want to use the ADC.
5. Run adc_init() once before first usage.
6. Every call to adc_get(11) will now return an unsiged integer between 0 and 4096 telling you the current position of the potetiometer.
# Possible edits
In total 16 of the GPIO pins are connected to the ADC. If PC1 is already in use in your design or you have two potentiometers, you can use different pins as ADC. For this, uncomment the respective line in the init function and call adc_get() with the respective channel ID.
### Possible edits
In total 16 of the GPIO pins are connected to the ADC. If PC1 is already in use in your design or you have two potentiometers, you can use different pins as ADC. For this, uncomment the respective lines in ADC.cpp file in the init function and call adc_get() with the respective channel ID.
Connections are as follows:
- ADC Channel 0 <> GPIO PA0
......@@ -39,6 +41,14 @@ Connections are as follows:
- ADC Channel 15 <> GPIO PC5
## 2. DCMotor
### How to Use
1. Connect VCC and GND pin of the motordriver to 5V and GND on the board respectifly.
2. Connect R_EN and L_EN to PC4 and PC5.
3. Connect RPWM to PB0 and LPWM to PB1.
3. Add DCMotor.cpp to your CMake target: ECOS_ADD_EXECUTABLE(app main.c src/DCMotor.c <other sources>)
4. Include DCMotor.h where you want to control the motor.
5. Run dc_init() once before first usage.
6. Controll the motor by calling dc_set(<DC_RIGHT|DC_LEFT>, <0...255>)
## 3. ExternButton
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment