Final project (initial) progress

I want to build off of this code that was on ml5js. I need to train the program to recognize the different hand gestures (rock, paper, scissors).

I started with the Arduino part of the ‘rock, paper, scissors’ game, by trying to build a reward system. When the project is complete, the green LED should light up whenever the user wins a round, and the red LED should light up whenever the user loses a round. And if the user wins the game (eg. wins 5 rounds before the computer) he/she receives  candy that is hidden under the box (video link below).

#include <Servo.h>

Servo servo;
int servoPos = 100;
int gameOver = 1 ;

int gledPin = 2;
int rledPin = 4;
int winloss = 1;

void setup() {
  pinMode(gledPin, OUTPUT);
  pinMode(rledPin, OUTPUT);

void loop() {
  if (gameOver == 1){
    servoPos = 20;
   servoPos = 100;

  if (winloss == 0){
    digitalWrite(rledPin, HIGH);
    digitalWrite(gledPin, HIGH);}


Leave a Reply