Game Controller

For this assignment, I created a game controller to play Atari’s Lunar Lander game in a browser. Using buttons, the controller sends W(up), S(down), A(left) and D(right) keypresses as a USB keyboard.

I used the MKR1000 board for this assignment. The device uses bluetooth connection but I connected it via USB directly to the computer for power and connection.

Code

#include “Keyboard.h”

const int upButton = 7;
const int downButton = 8;
const int leftButton = 6;
const int rightButton = 9;
//const int reloadButton = 4;
//const int enterButton = 5;
void setup () {
pinMode(upButton, INPUT);
pinMode(downButton, INPUT);
pinMode(leftButton, INPUT);
pinMode(rightButton, INPUT);
// pinMode(reloadButton, INPUT);
// pinMode(enterButton, INPUT);

//Serial.begin();
Keyboard.begin();
}

void loop() {

//keyboard button presses
if (digitalRead(upButton) == HIGH) {
Keyboard.press(‘w’); //send UP
delay(100);
}
else if (digitalRead(upButton) == LOW)
Keyboard.release(‘w’);

if (digitalRead(downButton) == HIGH) {
Keyboard.press(‘s’); //send DOWN
delay(100);
}
else if (digitalRead(downButton) == LOW)
Keyboard.release(‘s’);

if (digitalRead(leftButton) == HIGH) {
Keyboard.press(‘a’); //send LEFT
delay(100);
}
else if (digitalRead(leftButton) == LOW)
Keyboard.release(‘a’);

if (digitalRead(rightButton) == HIGH) {
Keyboard.press(‘d’); //send RIGHT
delay(100);
}
else if (digitalRead(rightButton) == LOW)
Keyboard.release(‘d’);

Circuit Design

Fabrication

Materials:

Matboard
Buttons
Wires
Bamboo box
Breadboard

Process:

Solder header pins to the MKR1000
Solder wires to the 4 buttons
Connect the buttons and MRK1000 to breadboard

 

Citations

Arduino mouse and keyboard libraries

Arduino mouse button control

812 thoughts on “Game Controller”

  1. I happen to be writing to make you understand what a terrific experience our princess went through visiting yuor web blog. She realized such a lot of things, with the inclusion of what it is like to possess an incredible teaching style to make the others without hassle thoroughly grasp various tricky topics. You undoubtedly surpassed visitors’ expected results. Thanks for showing those valuable, trustworthy, revealing not to mention unique tips on your topic to Sandra.

  2. Thank you for each of your hard work on this web page. My aunt really likes going through investigations and it’s really obvious why. Most of us learn all of the lively method you offer practical strategies through this web site and even increase participation from some other people on the issue so our favorite girl is in fact learning a lot of things. Take advantage of the rest of the year. You are always doing a really good job.

  3. I am glad for writing to make you know what a notable encounter my wife’s girl had studying your web site. She mastered several pieces, which include what it’s like to possess an awesome helping nature to let other individuals with ease know precisely some problematic subject matter. You truly exceeded people’s expectations. Thank you for producing these practical, trusted, informative and in addition fun tips about this topic to Kate.

  4. Hey there! I could have sworn I’ve been to this site before but after browsing through some of the post I realized it’s new to me.

    Nonetheless, I’m definitely delighted I found it and I’ll
    be bookmarking and checking back frequently! asmr 0mniartist

  5. Greate pieces. Keep posting such kind of info on your page.
    Im really impressed by your site.
    Hi there, You have done an excellent job. I will certainly digg it and individually suggest to my friends.
    I am confident they’ll be benefited from this site.

    0mniartist asmr

  6. Hello there! This is my 1st comment here so I just wanted to give a quick shout out and tell you I
    truly enjoy reading through your posts. Can you recommend any other blogs/websites/forums that go over the same subjects?
    Thank you so much! 0mniartist asmr

  7. This is my first time pay a visit at here and i am actually pleassant to read
    everthing at alone place. asmr 0mniartist

  8. Good day! I know this is kinda off topic but I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest writing a blog article or vice-versa?
    My blog covers a lot of the same topics as yours and I
    think we could greatly benefit from each other. If you’re interested feel free to send me an e-mail.
    I look forward to hearing from you! Superb blog by the way!
    0mniartist asmr

  9. Excellent site. Lots of useful information here. I’m sending it to some buddies
    ans additionally sharing in delicious. And certainly,
    thanks to your effort!

  10. Hi, i think that i saw you visited my site so i came to “return the favor”.I’m trying to find things
    to improve my web site!I suppose its ok to use a few of your ideas!!

  11. Excellent beat ! I wish to apprentice while you amend your site,
    how can i subscribe for a blog site? The account aided me a acceptable deal.

    I had been a little bit acquainted of this your broadcast offered bright clear idea

  12. If some one desires expert view concerning running a blog after that
    i propose him/her to pay a visit this webpage, Keep up the good work.

  13. What’s up to all, how is the whole thing,
    I think every one is getting more from this web page, and your views are
    good designed for new visitors.

  14. scoliosis
    Appreciation to my father who stated to me on the topic of this webpage,
    this blog is actually awesome. scoliosis

  15. free dating sites
    Thanks for a marvelous posting! I seriously
    enjoyed reading it, you’re a great author.I will remember to bookmark your blog and may come back later on. I want to encourage one to continue your great posts, have a nice weekend!
    dating sites

  16. Wonderful goods from you, man. I have consider your stuff previous to and you’re just too magnificent.
    I actually like what you have acquired right here, certainly
    like what you are stating and the way in which during which you are saying
    it. You are making it entertaining and you continue to take
    care of to stay it wise. I can’t wait to read far more from you.
    That is actually a tremendous site.

  17. Hello just wanted to give you a quick heads up.
    The words in your article seem to be running off the screen in Safari.

    I’m not sure if this is a formatting issue or something to do with internet browser compatibility but I thought I’d post to let you know.
    The design and style look great though! Hope you get the problem resolved soon. Many thanks http://cleckleyfloors.com/cialis

  18. I do accept as true with all of the concepts you’ve introduced for your post. They’re very convincing and can definitely work. Still, the posts are very quick for starters. May you please lengthen them a bit from subsequent time? Thank you for the post.

  19. Excellent pieces. Keep posting such kind of info on your site.
    Im really impressed by your blog.
    Hey there, You’ve performed a fantastic job.
    I will certainly digg it and individually recommend to my friends.
    I am sure they will be benefited from this website.

  20. Very nice post. I just stumbled upon your weblog
    and wished to say that I have truly enjoyed surfing around your blog
    posts. After all I will be subscribing to your
    rss feed and I hope you write again soon!

  21. Please let me know if you’re looking for a writer for your site.
    You have some really great posts and I feel I would be a good asset.

    If you ever want to take some of the load off, I’d love to write some content for your
    blog in exchange for a link back to mine.
    Please shoot me an email if interested. Thank you!

  22. I always used to study article in news papers but now as I am a user of net so from now I am using net for content, thanks to
    web.

  23. Hey! This post could not be written any better!
    Reading this post reminds me of my old room mate! He always kept talking about this.
    I will forward this page to him. Pretty sure he will have a
    good read. Thanks for sharing!

  24. Excellent goods from you, man. I have understand your stuff previous to and you’re just
    too magnificent. I actually like what you have acquired here, really like what
    you’re saying and the way in which you say it. You make it entertaining and you still take care of to keep it sensible.
    I cant wait to read much more from you. This is actually a terrific site.

  25. Thanks for a marvelous posting! I really enjoyed reading it, you
    happen to be a great author.I will always bookmark your
    blog and definitely will come back someday. I want to encourage you continue your great job,
    have a nice day!

  26. Play the classic definition guessing game Balderdash without owning the board game. This version of Balderdash is unique to Zoom, so you can call it Zoomerdash. You’ll need at least three players, but the game is best with around five. Kids ages eight and up will have the most fun with this game. If you love train games for kids to play online, GamesGames.com has an excellent selection of these for free! If you enjoyed this collection of Zoom games for kids, please share this post on Pinterest! This website is a resource for those who want to have fun, build self esteem and teach their kids how to lead happier, healthier and more fulfilling lives. https://merabusinesscard.com/community/profile/celinasoderlund/ Where we make this available, you can choose to log in to your King Profile using your account details with a third party network, such as Facebook or Google. If you do this, you will be able to use your account to log in on multiple devices and synchronise progress across those devices. Where available, you will also be able to see which of your friends are playing the same game and their progress through the games (and they will be able to see you and your progress), or access other functionality we make available in our games and other Services, such as inviting friends to play, asking other players for lives and 1-2-1 messaging.

  27. I blog quite often and I genuinely thank you for your information. This article has truly peaked my interest.
    I’m going to take a note of your website and keep checking
    for new details about once a week. I opted in for your Feed as well.

  28. Для того чтобы оформить заказ причина и лечение потенции необходимо оставить свои контактные данные на сайте. В течение 15 минут оператор свяжется с вами. Уточнит у вас все детали и мы отправим ваш заказ. Через 3-10 дней вы получите посылку и оплатите её при получении. Психогенная эректильная дисфункция – это психические расстройства в виде невроза, депрессия с сопутствующим ей невротическим состоянием. Такое заболевание возникает внезапно при сохранности спонтанных ночных и утренних эрекций. При этом проблемы являются эпизодическими. Лечение импотенции этого типа требует изначального выявления и устранения её причины. https://thefinde.com/community/profile/wilfordcheongch/ Беда нашего общества еще и в том, что мало кто спешит в такой ситуации за помощью к врачу. Многие предпочитают лечиться самостоятельно. Ищут информацию в интернете, советуются со знакомыми, экспериментируют, пробуют «бабушкины методы», проверяют на себе широко рекламируемые средства от импотенции. Каким способам и препаратам довериться — об этом ниже. © 2012 – 2020 Эректильная дисфункция редко являет собой самостоятельное заболевание — в подавляющем большинстве случаев речь идет об отголоске серьезного патологического процесса, затрагивающего многие органы и системы. Кроме того, снижение потенции может носить психогенный характер — быть последствием эмоциональной травмы или тяжелой стрессовой ситуации. Снижение потенции — безусловно, стресс для мужчины. Однако нет причин воспринимать ее трагически: по мнению врачей, непоправимых случаев подобного рода практически не встречается. Не откладывайте визит к доктору, если вы заметили у себя признаки эректильной дисфункции. Ведь чем раньше начнется лечение — тем скорее вы вернете себе радость яркой сексуальной жизни.

  29. Magnificent beat ! I would like to apprentice while you amend your website, how can i subscribe for a blog website? The account aided me a acceptable deal. I had been a little bit acquainted of this your broadcast offered bright clear idea

  30. My programmer is trying to persuade me to move to .net from PHP. I have always disliked the idea because of the costs. But he’s tryiong none the less. I’ve been using Movable-type on a variety of websites for about a year and am nervous about switching to another platform. I have heard good things about blogengine.net. Is there a way I can transfer all my wordpress content into it? Any help would be greatly appreciated!

  31. My brother suggested I might like this web site. He was totally right. This post truly made my day. You cann’t imagine simply how much time I had spent for this info! Thanks!

  32. My brother recommended I might like this web site. He was totally right. This post truly made my day. You can not imagine simply how much time I had spent for this information! Thanks!

  33. My brother recommended I might like this web site. He was totally right. This post truly made my day. You can not imagine simply how much time I had spent for this information! Thanks!

  34. My brother recommended I might like this blog. He was totally right. This post truly made my day. You cann’t imagine just how much time I had spent for this info! Thanks!

  35. My husband and i got quite fortunate when Jordan could carry out his preliminary research using the precious recommendations he grabbed from your weblog. It’s not at all simplistic just to be releasing helpful hints some other people could have been trying to sell. And we all understand we have the blog owner to give thanks to for this. The type of illustrations you have made, the straightforward site navigation, the friendships you can make it possible to promote – it’s got everything exceptional, and it is facilitating our son in addition to us believe that that subject is pleasurable, and that is incredibly serious. Many thanks for the whole thing!

  36. My husband and i got absolutely more than happy Peter could do his researching through your ideas he got through the web site. It’s not at all simplistic to just choose to be giving away tips which the others may have been selling. And we also discover we now have the blog owner to thank for that. All the illustrations you’ve made, the easy site navigation, the relationships your site aid to foster – it’s all extraordinary, and it’s really leading our son in addition to our family do think this theme is pleasurable, which is very important. Many thanks for the whole thing!

  37. My husband and i have been absolutely glad Louis managed to conclude his analysis through the ideas he made from your very own blog. It is now and again perplexing just to always be giving out ideas many others may have been making money from. We do know we now have the blog owner to be grateful to because of that. The specific illustrations you’ve made, the simple blog menu, the relationships you make it easier to create – it’s mostly amazing, and it is leading our son in addition to the family feel that this subject matter is enjoyable, which is rather vital. Thanks for all!

  38. My husband and i ended up being quite fortunate when Jordan could carry out his homework using the precious recommendations he was given from your web pages. It’s not at all simplistic to simply be giving away tricks most people may have been selling. And now we fully grasp we have the writer to be grateful to for that. The main explanations you have made, the straightforward site navigation, the relationships your site help promote – it’s all fantastic, and it’s really leading our son and us feel that the concept is enjoyable, which is tremendously fundamental. Many thanks for the whole lot!

  39. My husband and i ended up being quite fortunate when Jordan could carry out his homework using the precious recommendations he was given from your web pages. It’s not at all simplistic to simply be giving away tricks most people may have been selling. And now we fully grasp we have the writer to be grateful to for that. The main explanations you have made, the straightforward site navigation, the relationships your site help promote – it’s all fantastic, and it’s really leading our son and us feel that the concept is enjoyable, which is tremendously fundamental. Many thanks for the whole lot!

  40. My brother recommended I might like this web site. He was totally right. This post truly made my day. You can not imagine simply how much time I had spent for this information! Thanks!

  41. My brother suggested I might like this blog. He was entirely right. This post actually made my day. You can not imagine just how much time I had spent for this info! Thanks!

  42. My brother recommended I might like this web site. He was entirely right. This post actually made my day. You can not imagine just how much time I had spent for this info! Thanks!

  43. Good post. I learn something totally new and challenging on websites I stumbleupon everyday.

    It will always be helpful to read through content from other writers
    and use something from other sites.

  44. Write more, thats all I have to say. Literally, it seems as though you
    relied on the video to make your point. You obviously know what youre talking about, why throw away your intelligence on just posting videos to your blog when you could be giving us something informative to read?

  45. Good way of telling, and nice paragraph to get facts regarding my presentation subject, which i am going to present in university.

  46. Thank you a bunch for sharing this with all folks you actually know
    what you’re talking approximately! Bookmarked. Please also talk over with my website =).

    We can have a hyperlink exchange contract between us

  47. Hey are using WordPress for your blog platform?

    I’m new to the blog world but I’m trying to
    get started and create my own. Do you require any html coding knowledge to make your own blog?
    Any help would be really appreciated!

  48. I absolutely love your blog and find a lot of your post’s to be
    just what I’m looking for. Do you offer guest writers to write content for you personally?

    I wouldn’t mind creating a post or elaborating on most of the subjects you
    write in relation to here. Again, awesome website!

  49. Your style is unique in comparison to other people
    I have read stuff from. I appreciate you for posting
    when you have the opportunity, Guess I’ll just book mark this blog.

  50. It’s really a nice and useful piece of info. I am happy that
    you shared this helpful information with us.
    Please keep us up to date like this. Thanks for sharing.

  51. Hi, I do believe this is a great blog. I stumbledupon it 😉 I will come back yet again since i have
    saved as a favorite it. Money and freedom is the best way to change, may you be
    rich and continue to help other people.

  52. Simply desire to say your article is as surprising. The clarity in your
    post is just excellent and i could assume you are an expert on this
    subject. Fine with your permission allow me to grab your feed to keep
    updated with forthcoming post. Thanks a million and
    please continue the enjoyable work.

  53. I loved as much as you will receive carried out right here.

    The sketch is tasteful, your authored subject
    matter stylish. nonetheless, you command get bought an nervousness over that you wish
    be delivering the following. unwell unquestionably come further formerly again as exactly the same nearly very often inside case you shield this hike.

  54. It’s remarkable to go to see this site and reading the
    views of all mates concerning this article,
    while I am also keen of getting knowledge.

  55. Hello! This is my first visit to your blog! We are a collection of volunteers
    and starting a new initiative in a community in the same
    niche. Your blog provided us useful information to work on. You have done a outstanding job!

  56. I love your blog.. very nice colors & theme. Did you make this
    website yourself or did you hire someone to
    do it for you? Plz answer back as I’m looking to design my own blog and would like to find out
    where u got this from. kudos

  57. Hey there, You have done a great job. I will definitely digg it and personally suggest to my friends.
    I’m confident they’ll be benefited from this website.

  58. We stumbled over here coming from a different web address and thought I might as well check things out.
    I like what I see so now i am following you. Look forward to going over
    your web page repeatedly.

  59. You need to be a part of a contest for one of the most useful websites
    on the web. I’m going to highly recommend this site!

  60. excellent issues altogether, you just won a new reader.
    What might you recommend about your post that you just made a few
    days ago? Any positive?

  61. Hmm is anyone else encountering problems with the images on this blog loading?
    I’m trying to find out if its a problem on my end or if
    it’s the blog. Any responses would be greatly appreciated. quest bars
    http://j.mp/3jZgEA2 quest bars

  62. May I just say what a comfort to uncover an individual who
    genuinely understands what they’re discussing on the net.
    You actually understand how to bring a problem to
    light and make it important. A lot more people really need to read this and understand
    this side of the story. It’s surprising you aren’t more
    popular given that you surely possess the gift.
    quest bars http://j.mp/3C2tkMR quest bars

  63. Attractive section of content. I just stumbled upon your web site
    and in accession capital to assert that I acquire actually enjoyed account
    your blog posts. Any way I’ll be subscribing to
    your augment and even I achievement you access consistently rapidly.
    scoliosis surgery https://0401mm.tumblr.com/ scoliosis surgery

  64. Hiya! Quick question that’s completely off topic. Do you know how to make your site
    mobile friendly? My weblog looks weird when browsing
    from my iphone 4. I’m trying to find a theme or plugin that might be able to resolve this issue.
    If you have any recommendations, please share.
    Thanks! ps4 https://bitly.com/3nkdKIi ps4

Leave a Reply

Your email address will not be published.