|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: swerve drive with arduino mega 2560
Hi Becky,
I just ran through an installation of the Arduino software (I needed to upgrade anyway) and downloaded to a Mega and will list the steps that I went through to get it to work (there may be other ways, this is just what I used). Most of this is just a repeat of what others have said above. 1) Open a new sketch and cut/paste the Blink code example that can be found here near the bottom of the page. This is just to have a known good sketch to test. 2) In the menu item Tools->Board select "Arduino/Genuino Mega or Mega 2560" 3) In the menu item Tools->Programmer select "AVR ISP" 4) Verify your code by clicking on the left hand button with a Check Mark in it just below the menu items (The word "Verify" should display to the right of the buttons when you hover your mouse over it). It should return some messages at the bottom if the IDE indicating how large the sketch is and global variable use. 5) Plug in your Mega if you haven't already done so. 6) In the menu item Tools->Port, select the your Mega. Mine was labeled "COM3 (Arduino/Genuino Mega or Mega 2560)". Yours may have a different COM number. 7) Upload to the Mega the Blink program by pressing the right arrow button next to the verify button you used earlier. To the right of the buttons it should show the word "Upload" when you hover over it with your mouse. After a few seconds a message indicating "Done uploading." should be shown below your sketch and above the message area it it worked correctly. Also, the led on the mega (yellow on mine) will be blinking at 1 second intervals. This worked on mine. If this works for you, then you should be able to upload your own sketch, but you may have to change the Board, Programmer & Port again (Steps 2,3 & 6) after you open your sketch. If this doesn't work, if you can post any error messages you are seeing, that would help us identify the problem. Mike Last edited by Mike Bortfeldt : 31-05-2016 at 21:32. Reason: Corrected a couple of words |
|
#2
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
it is working now, but I still don't know how to code more than in extremely basic python, so im not sure what to do. ill post a picture of the whole thing in a few minutes in case that is helpful. the code is empty as of right now.
|
|
#3
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
blob:https%3A//mail.google.com/6927b9bd-8c0e-4b71-91b0-fd0a0535bec7
here it is |
|
#4
|
|||
|
|||
|
Re: swerve drive with arduino mega 2560
The URL doesn't seem to work for me. Can you try to post the picture or copy it to some other location?
Mike |
|
#5
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
Instead of starting with a swerve drive in Arduino, try working through the tutorials first; it'll be a lot of help.
|
|
#6
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
|
|
#7
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
i have to start with a swerve drive and arduino, the project was to make a swerve drive bot and i only need to do the programming now. i didn't choose the assignment, plus i spen翶spent too long cadding it for ages until i was the only person left who hadn't graduated and now I needa finish it on my own.
|
|
#8
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
This is an exceptional challenge...
We can help, but we can't do everything. Have you done the following:? 1. Loaded an example program onto the arduino, i.e. blink 2. Verified that the example program is running You have to at least achieve this before attempting to write any robot control code. Also, it sounds like you're using a programmer tool. You shouldn't need this...just a USB cable and the Arduino software. |
|
#9
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
Also, I can't see from the image if you have a steering sensor installed?
I presume you have it located on top of the steering module...but I can't tell. Is this true? What sensor is it? |
|
#10
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
it doesn't have any sensors on it yet, i will probably add them soon, but i kinda wanna figure out how to code it first since I don't know C++ at all yet.
|
|
#11
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
Have you done the following:?
1. Loaded an example program onto the arduino, i.e. blink 2. Verified that the example program is running |
|
#12
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
i don't think so. im not sure how
|
|
#13
|
||||
|
||||
|
Re: swerve drive with arduino mega 2560
http://lmgtfy.com/?q=how+to+load+code+onto+my+arduino
Check out the first link. ![]() Arduino is supposed to be easy....so follow their simple guide and get some example code loaded. Then we can discuss doing something like controlling a speed controller etc. |
|
#14
|
|||||
|
|||||
|
Re: swerve drive with arduino mega 2560
You can't write code for hardware that is not yet defined. Anthony's questions require an answer before you can get useful help: what kind of sensor is it? Where is it mounted?
|
|
#15
|
|||
|
|||
|
Re: swerve drive with arduino mega 2560
Becky,
First off, I think this drive system is an great choice for a first swerve system. Having the steering modules linked together, as well as speed, will make things much easier from a control aspect. Because of this, I wouldn't start with any sensors. They are not needed to be able to drive around, and for someone relatively new to programming, this will make things much easier. I would use a two axis joystick model, where the forward/backwards motion drives the robot, and the side to side motion controls the speed of turning. Sensors can be added later once you get it driving if you want to have more (or more interesting) control. As others have said, you will need to be able to generate PWM signals for the speed controllers and the Arduino servo library has that capability. But before we get to that, one important question comes to mind. Have you thought about how you are going to control this? What type of operater station do you have and how will it communicate with the Mega? Wireless? Wired (tethered?) Somehow you will need to get the information to the mega on what you want it to do, and that will add another layer of complexity to your system depending on the communications you want to use. I would initially like to suggest an idea that could make this project much easier (no programming). Do you have access to an RC style transmitter/receiver? Maybe something like this? Using an RC style controller would allow you to eliminate the mega and just control the speed controllers directly. IIRC, the talons should be able to take a standard servo style input. Just a thought. There may be other better ideas out there, but this happened to come to mind. Would this be a possibility? Mike |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|