Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision | |||
|
en:instructions:rockpaperscissors2 [2018/06/28 09:39] kniwwelino |
en:instructions:rockpaperscissors2 [2018/06/28 10:43] (current) kniwwelino |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ===== Rock Paper Scissors version 2 ===== | ||
| + | This is an extended version of the Rock Paper Scissors game, where two Kniwwelinos communicate with each other to give feedback who has won: the RGB LED lights up in green for the winner, in red for the loser, and in blue in case both are equal. | ||
| + | {{ : | ||
| + | |||
| + | ==== Programming ==== | ||
| + | |||
| + | * Create two variables in '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | * Create a group for exchanging messages. | ||
| + | * Connect the variable '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | * Each time button A is clicked, both scores are first reset to 0, and the RGB LED is switched off. Then, there is a countdown as a delay to make sure the score is not calculated before your friend has pressed the button too (and reset his scores). After that, the own score ('' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | * As in the [[en: | ||
| + | |||
| + | {{: | ||
| + | |||
| + | * Finally you want to light the RGB LED in the right color. For this, you need to check the value of both scores (stored in '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | * Use the same code for the Kniwwelino of your friend, but replace '' | ||
| + | |||
| + | {{: | ||
| + | |||
| + | \\ | ||
| + | === Solution === | ||
| + | This is the entire solution for one of the players. For the second player, just replace '' | ||
| + | |||
| + | Open project in [[https:// | ||
| + | |||
| + | [[https:// | ||
| + | |||
| + | [[https:// | ||