Pages: [1]   Go Down
Author Topic: Control Feasibility  (Read 599 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hey guys,

So I am working on making my own custom hexapod. I will be using 3 DOF legs and the Arduino Mega2560. After I have it up and running I want to write different walking sequences (i.e. walk forward, walk backward, etc....) as well as some positioning/stance codes ( high stance, low stance, rotation, etc.....). I know this is feasibile and prohaps simple to some of you guys. My question is would it be possible to make a controller for it. Something like a handheld board with push buttons. I have attached a rough sketch. I know this would be a pretty easy to make but how would I have it send the button inputs to the arduino mega on board the bot so that it could respond to the commands? Thanks. Or maybe even hack a game console wireless controller.


* hex.png (42.5 KB, 1930x1168 - viewed 11 times.)
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23611
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Make yourself an RF remote control.
Something like this
http://www.robotshop.com/433mhz-transmitter-receiver-pair.html
with 12/16/20 button keypad.

Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you for the diagram is is very helpful. Do you know where I can find an example code. I am just not sure how to differentiate between the different buttons using the single I/O pin that goes to the Transmitter to be sent to the on board MEGA. thanks again!
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23611
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Search for the keypad.h library. That's what I used.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Offline Offline
Newbie
*
Karma: 0
Posts: 38
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Okay, so I have read through the keypad library. Now I am just confused on the transmitter/receiver combo. I was wondering if someone could help me out. So I would map a keypad that would have 12 keys. Similar to the one shown in your schematic. Now I know which button I want to do what and how to code the mega onboard to execute the commands. The part I am confused about is if the transmitter only has one data pin how to I code the 12 different outputs since the arduino mini digital pins only have a high/low output? If this is wrong please correct me. Here is what I am thinking

keypad (12 keys) ---wires to mini 12 pins -----mini (1pin) wires to tranmitter (1pin) (what data does it send) ----- receiver gets data----wires to mega (1pin)----mega wires to servo and executes command based on button pushed.
Logged

Global Moderator
Boston area, metrowest
Online Online
Brattain Member
*****
Karma: 435
Posts: 23611
Author of "Arduino for Teens". Available for Design & Build services. Now with Unlimited Eagle board sizes!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

The keypad gets wired to 3 column inputs and 4 row inputs, 7 keys only.
When the keypad library is running, it reads the buttons and reports back when a key is pressed, and gives a value for it.
You then pass that value to virtualwire and it sends it to the RF transmitter using D12 (as the default pin, I think).

On the receive side, the code is looking for data coming in on D11 (default I think) and is read out similar to reading a byte from the serial port, and then you act on it.

Take it in steps - get the keypad library working so you get the value you want when you press a button.
Then add the virtual wire code so you can send that button value out.
Logged

Designing & building electrical circuits for over 25 years. Check out the ATMega1284P based Bobuino and other '328P & '1284P creations & offerings at  www.crossroadsfencing.com/BobuinoRev17.
Arduino for Teens available at Amazon.com.

Pages: [1]   Go Up
Jump to: