I want to consider a project where I make a simple snake-like game, to get some more experience.I thougth that if I made a matrix, say a 5x5 matrix of zeros, I could make a snake like game if the snake was displayed by the number 1 in the matrix.
I would move the "snake" by joystick or buttons, which should be fine.
Questions:1) I am guessing the serial monitor is a poor choice for this?
2) Could I rather use the terminal (linux) and refresh the matrix from my computer, and only use the arduino for controls?
3) Say I make a program in C, and I'm currently in the while(1) part of my program, and waiting for input on the arduino. The matrix is constantly being "refreshed". If I'm communicating with the arduino and using it for control inputs, how does this work in terms of data transfer? The arduino works at 16 Mhz, and my computer far more. Or is the baud rate what determines the speed (bottleneck)? This is maybe a basic hardware question, would love to understand how it works.
4) I haven't compiled any projects from the terminal before. Do you have any guides or help on how to get started with this? I'd rather use VIM or gedit than the IDE. Do you perhaps have a never makefile? I saw there were makefiles when I googled but they seem to be a bit dated.
Should be possible. Even with much bigger matrices.You could control either the Arduino directly by connecting something on the Arduino- buttons- IR receiver- joystickso the input is given directly to the Arduino, and Serial is only used for sending the output to the terminal screen.Or you could control the Arduino with keyboard input over Serial and the Arduino sends back output to the terminal screen as well over Serial.You are right. Arduinos serial monitor is limited for keyboard input which always must be finished hitting the ENTER key. And Arduinos serial monitor is a 'dumb terminal'. But you would need something like a VT52, VT100 or ANSI terminal, so you will need to use a terminal program instead of the serial monitor to send nice terminal codes to the screen.I don't understand that question. The Arduino takes input from whereever (terminal or other) and sends output to the terminal to show what's going on.If your programming is done "the matrix constantly being refreshed", then the Serial baudrate will be the bottleneck. Max. Serial baudrate for Arduino is 500000 baud when communicating with a terminal over Serial-USB. But you need not "the matrix constantly being refreshed" for a snake-like game. For a snake-like game you need:- clear the screen when the game begins- send one char (and possibly one position) to the screen at each move of the snakeREAL programmers use Emacs.For what reason you want to use an Arduino?If you just want to write a program that takes input from the keyboard and sends output to a terminal screen, you really need no Arduino. It can be done with a PC alone, without any Arduino for nothing.The Arduino IDE is JAVA based and provides a complete and easy to use toolchain for editing, compiling, linking and uploading to the Arduino controller. You'd really need to have good internal knowledge about everything (compiler, linker, programmer) to set up your own toolchain not based on the Arduino IDE.
So the final setup would be:* Use arduino for controls, joystick/buttons/pots of some kind* Write code in C, using linux. * Have the matrix output on the terminal in linux
The main problem is knowing how to use any editor (VIM/gedit) to do the same as the IDE. However I can bypass this, IF it is possible to get output to a terminal from the IDE? Do you or anyone else reading this konw how?
Please enter a valid email to subscribe
We need to confirm your email address.
To complete the subscription, please click the link in the
email we just sent you.
Thank you for subscribing!
via Egeo 16