Leonardo micro board - Printable Version

+- JJRobots COMMUNITY (http://forums.jjrobots.com)
+-- Forum: JJrobots (/forumdisplay.php?fid=1)
+--- Forum: B-Robot (/forumdisplay.php?fid=2)
+--- Thread: Leonardo micro board (/showthread.php?tid=41)

Pages: 1 2

Leonardo micro board - sasa999 - 06-08-2015 09:10 PM

Is it possible change script fot Leonardo micro or Arduino Pro mini board? Timers section is hard for me Sad
I want make small robot, about half of size, so regular Leonardo is too big.

RE: Leonardo micro board - KomX - 06-10-2015 07:39 PM

Hi, sasa9999.
Excuse me, but regular Leonardo (big) and Pro Micro (small) have the same pinouts and it is not necessary to change the sketch.
Another thing, if you want to make timers advanced features... For example, one timer control both motors and additionally serve them well sonar HC-SR04.

RE: Leonardo micro board - sasa999 - 06-12-2015 02:16 PM

Leonardo mirco haven't D12 . How to connect motor driver "step" pin? Is it possible assign different pin for motor driver "step"?
I have this one http://www.ebay.com/itm/381229599644?_trksid=p2057872.m2749.l2649&ssPageName=STRK%3AMEBIDX%3AIT#ht_1003wt_1123
Or, maybe it is possible migrate to Nano board - it have D12

[Image: 523a1765757b7f5c6e8b4567.png]

[Image: b_robot.png]

RE: Leonardo micro board - KomX - 06-12-2015 03:32 PM

(06-12-2015 02:16 PM)sasa999 Wrote:  Leonardo mirco haven't D12 . How to connect motor driver "step" pin? How to assign different pin for motor driver "step"?

Sorry, I was wrong saying that the boards are identical.
That's not all differences - even pin A5 not out.
I'll try to help you...

1. See my post. I have the same board and I reappointed optimal conclusions, in my opinion.
2. Next post dedicated to the measurement of the battery voltage. Look at it. If you choose my option - write to me. If you are satisfied with the original version of the sketch, then just put it in a function analogRead (5) instead of the number 5 you have chosen the analog input (port).

RE: Leonardo micro board - sasa999 - 06-12-2015 04:15 PM

Tnx for help! Sad I tried change original sketch but something goes wrong. Sad It is difficult to understand exactly what piece of code must be changed Sad
Have you full sketch in one file? For Leonardo micro.

RE: Leonardo micro board - KomX - 06-12-2015 04:57 PM

I suggest you use a signal STEP MOTOR2 pinout D6. Ok?

Open sketch BROBOT.ino.
Replace string
pinMode(12,OUTPUT); // STEP MOTOR 2 PORTD,6
to string
pinMode(6,OUTPUT); // STEP MOTOR 2 PORTD,7

Replace all strings PORTD,6 to PORTD,7.

After the stepping motor has to operate.

Strings analogRead (5) search for a file JJROBOTS_BROBOT.cpp

RE: Leonardo micro board - sasa999 - 06-12-2015 05:24 PM

Tnx. I will try Smile

RE: Leonardo micro board - sasa999 - 06-13-2015 10:27 PM

Tnx KomX, motors work fine, BUT...
..when switched ON (USB connected) robot started, but after some time (maybe 10 seconds, maybe 20) it stay halted, but when I open serial monitor it continue run again. It not stop with serial monitor is open, but stop when serial monitor is closed therefore I can't detect problem. I use original sketch, only output D12 changed to D6. When it halted servo didn't respont too. Often motor continues rotate at constant speed - sometime faster, sometime slowly. Remote not responding.
So, how to detect problem? How to check what exactly? HELP PLEASE!

RE: Leonardo micro board - KomX - 06-14-2015 09:46 AM

Interesting observation. I also noticed problems with the USB. For example, when you close the COM-monitor board continues to work with COM-port.
The only thing I did not understand that you stop there?

In your amendment:
Let's start with the installation of the board, or near it, but short and thick wires electrolytic capacitor 1000-4700 uF 16V.
Also the head broke, why rangefinder begins to limit the range of fifty centimeters during operation of motors. Oh, and every driver on the engine capacity of 220-470 uF 25V

RE: Leonardo micro board - sasa999 - 06-14-2015 12:54 PM

(06-14-2015 09:46 AM)KomX Wrote:  Interesting observation. I also noticed problems with the USB.
Very often I need wait 2..3.. or 5 minutes until Arduino Ide find com port for Leonardo board. I have 1.6.4 Arduino IDE.
About robot freezing. Tried with three separate batteries - one for motors 11.1V lipo and second 5V stabilized for Arduino and third 3.3V stabilized for MPU6050 and ESP8266. Conclusion - there is no problems with Batteries and power lines because robot freeze anyway. Robot work while it is horizontal. When I slowly rise it up, it show angle adjusted until motors start. Debug 1 show angle until start motor then robot freeze. Sometime motors run 10 - 20secons and respond to gyro angles, then freeze and show FIFO Reset. After several FIFO Reset prints (sometime 1, sometime 15+) serial stop too. With motor disconnected work fine and not freeze - serial monitor not show any errors. I cant understand how can motor connection influate Arduino board and freeze them with separate power lines and batteries. I have soldered 220uF capacitors on all power lines. Some 0.1uF capacitors on stepper driver power.
I checked fifoCount value after freezing - it is all time zero "0". Looks like Stepper motor block I2C or MPU.