1

I am planning to use a joystick to input joystick stroke directions, save the directions as number in a variable. The idea is to start a servo motor if the directions match the directions in the sketch. for example, let us say, I perform the following movement on the joystick: 1. two left movement along x axis ( <-, <-) 2. two right movement along x axis ( ->, ->) 3. One Up movement along y axis and 4. one down movement along y axis. These movements are as a result of a user solving a clue. (two left strokes could mean an alphabet 'A' or a number 1, not decided yet, and so on..)

I would like to save the 4 or 5 joystick directions in a variable and if it matches the directions declared in the sketch (True condition), then DC servo motor would start and pull a screen up, which will expose 'SOLVED' written behind the screen.

Hope the scenario is clear. Since, I am new to this, I would like to get some help with the sketch and the connections (Arduino Joystick inputs and DC server output are available on web, it will be helpful if someone can give an overall guidance as well.

marc Katz
  • 11
  • 1
  • how do you do two left movements? – jsotola Feb 04 '20 at 02:42
  • Start simple, and try to detect a single joystick movement first. Print this to the serial port and watch the output on the Serial Monitor. Only if this works, think about the next steps. – the busybee Feb 04 '20 at 07:14
  • The format of this site is not good for project guidance. It's a simple Q&A site, so you need to ask a specific question, that can be asked specifically, without a contineous back and forth between you and the one, that might answer your question. With which part do you have problems and what are these problems specifically? You might want to try and post at the Project guidance section of the Arduino Forum (you can google it). It is meant for such guidance – chrisl Feb 04 '20 at 08:31
  • Consider using (explicitly asking for help with) a simpler / older joystick with only off / on switches. Such as old computer games might use. Using a joystick made from two potentiometers (like when controlling an RC airplane) would be more difficult. Also, using a 4 way joy stick and leaving out diagonal directions would make the code simpler. Finally, do you really need to servo motor? Know the position of the motor at all times? Turning an ordinary motor on and off would be much simpler. Let me know if you want me to edit your question. – st2000 Feb 04 '20 at 13:27

0 Answers0