Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

analog control fix #79

Open
wants to merge 8 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Update Src/main.c
Co-Authored-By: kozinalexey <kozin@mail.ru>
  • Loading branch information
p-h-a-i-l and kozinalexey authored Feb 13, 2019
commit 54658c52447575c84fc21998ba16080a7c34b2b9
1 change: 0 additions & 1 deletion Src/main.c
Original file line number Diff line number Diff line change
@@ -204,7 +204,6 @@ int main(void) {
cmd1 = CLAMP(adc_buffer.l_tx2 - ADC1_MIN, 0, ADC1_MAX) / (ADC1_MAX / 1000.0f); // ADC1
kozinalexey marked this conversation as resolved.
Show resolved Hide resolved
cmd1 = (cmd1 - 500) * 2; // steer stick zero in middle position for allow left/right rotation
kozinalexey marked this conversation as resolved.
Show resolved Hide resolved
cmd2 = CLAMP(adc_buffer.l_rx2 - ADC2_MIN, 0, ADC2_MAX) / (ADC2_MAX / 1000.0f); // ADC2
kozinalexey marked this conversation as resolved.
Show resolved Hide resolved
cmd2 = (cmd2 - 500) * 2; // trottle stick zero in middle position for forward/reverse control
#endif
kozinalexey marked this conversation as resolved.
Show resolved Hide resolved
// use ADCs as button inputs:
button1 = (uint8_t)(adc_buffer.l_tx2 > 2000); // ADC1