I have a school project but i cant program. and I need at least a medium character to stand this year. This is the task. its in tinkercad. Please help
You will now create a game that uses the LCD Display as a screen, as in the figure -->
The game should work like this: There should be one character (example triangle/arrow) that starts in the middle and goes randomly
direction right or left from the center when the game starts. I have used:
char ascii = 187; char ascii2= 188;
Is it difficult?:-->Applies to LVL 1 and LV2 level: if it is difficult with an LCD display, you can use many LED diodes one after the other instead.
The character moves with a given speed and a given pause which gradually increases, so that the figure increases its speed. Player A and player B must then press the button before the character hits the edge/or leaves the display.
LVL 1 (Grade 2)
The start button starts the game and initiates the "character".
When the player the character goes towards presses, the "character" must go the other way.
The LED should light up when the HIT it buttons are pressed.
The game must slowly increase the speed of the figure for each time both players have pressed 1 time.
a. This is how the speed will increase for each round.
Button 4 brings up the result from the last game
If a player is too slow to turn the sign over, he has lost
LVL 2 (Character 3-4)
Player A and player B must then press the button before the character hits the edge/or leaves the display.
There must be a time or distance measure, i.e. a point system based on how close the figure was to exiting the screen, the closer the figure is to exiting, the more points.
Points score should be displayed on the far left and right a little while after the player has pressed the button.
Is it difficult?: for those who use Diode series, one or 2, 7 segments must be connected for display points.
LVL 3 (Character 4-5)
A random obstacle must be inserted in the display
It must be inserted an additional button on both sides that moves the "character" to the other side so that the player avoids
that figure crashes into the obstacle.
In the event of a crash, the player who crashes loses
LVL 4 (Character 5-6)
The circuit must be connected physically.
A boundary line must be inserted in the display, where total points must be shown.
A new element must also be created for the game.
They must create a demo that plays the game itself.
i dont know how to start on level 1. and what I have so far is so far away from task 1 complete. I don't know how to change delay speed while the code is running
Instead of having a fixed number in a delay call make it a variable. Then you can change the variable's value in the code and so change the delay that is actually produced.
Did your teacher really write that? Does he/she not know that LED, stands for Light Emitting Diode, so that actually reads
you can use many light emitting diode diodes one after the other instead. Get your teacher to see the English teacher.
See where you have delay(1000]
You need to have something like delay(myDelayTime)
The myDelayTime is called a variable. You declare that variable at the top of your code and give it a value of say 1000.
Then each time you press your button you subtract something from that variable, like
if(buttonPressed) myDelayTime -= 40) ;
Of course you have to detect when a button is pressed and set the variable buttonPressed to be true.
i got this wrong message
1:6: error: expected constructor, destructor, or type conversion before '(' token
In function 'void loop()':
18:7: error: 'buttonPressed' was not declared in this scope
18:22: error: 'myDelayTime' was not declared in this scope
39:11: error: 'myDelayTime' was not declared in this scope
I read your entire assignment. It looks like a nice progression of stepwise refinements to a basic LED or LCD toy or game reminiscent of Pong. Oh, yeah, never heard of that, n'mind.
I assume you are on the LED track, Your code to make the "character" or I would call it a ball move what could be back and forth, but might be all over the place, is at best extremely primitive and is in no way a basis for further development.
Orher than to test your wiring. Looks like you are using a simulator, please confirm that and state which one.
Post your final program from the previous assignment so we can see your level of coding skill and make appropriate suggestions.
If you don't have a previous program, start by working through simple example programs. Since you have the entire semester (this like 19 weeks, right? Been a long time here) you would probably best start by googling
arduino blink without delay
and staying in your room studying it, implementing it, experimenting with it until you can actually claim to understand what it does, how it does it and why it so very important that it is. Understood. Totally.