Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Changing pin of servo
12-17-2018, 01:43 AM
Post: #1
Changing pin of servo
Hello,

I want to modify the servo code of the B-Robot EVO2 to work from the 32u4's Analog Pin 2 instead of Digital Pin 10: https://github.com/jjrobots/B-ROBOT_EVO2...os.ino#L72

There seems to be a lot of complicated bit register logic, which I don't understand well.

According to https://www.arduino.cc/en/Hacking/PinMapping32u4, analog pin 2 is (ADC5/TMS) PF5, and digital pin 10 is (PCINT6/OC1B/OC4B/ADC13) PB6.

I tried changing OC4B (pin 10) to ADC5, TMS, and PF5, but the sketch wouldn't compile.

Does anyone know how to switch the pins?
Find all posts by this user
Quote this message in a reply
12-17-2018, 04:09 AM
Post: #2
RE: Changing pin of servo
Alternatively, I can just use the Servo arduino library, but the brobot uses timer 1 and that conflicts with the Servo library. Is there any way to get the BROBOT to use another time for steppers instead of timer 1?
Find all posts by this user
Quote this message in a reply
12-21-2018, 10:12 AM
Post: #3
RE: Changing pin of servo
The thing is: The B-robot uses almost the 99% of the 32u4 processor. And both TIMERs to precisely control the Wheels in order to keep the balance. Changing the PIN is not straightforward as it will conflict with... timers.
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)