Tuesday, January 22, 2013

MiniDC and Workshop 3 Time/Place

Hey folks,

We will be starting the judging for the MiniDC at 6:30pm tomorrow (Wednesday, Jan 23) in Clark C142.  If you need an extension cord to power your project, please bring one.  After we get through the judging, we will jump right into the third workshop on motors, solenoids, and motor control. Please bring a fully charged laptop, everything in your kit, and your servo. If you haven't picked up your servo yet, those will be available for pickup as well.

I plan on ordering pizza putting up a movie during judging, so if you don't have a project, you should still come in, get a slice, and check out other folks' mini projects.  There will also be door prizes for the folks that show up before the workshop.

See you there!
Austin

1 comment:

  1. #include //Servo Library


    Servo dial; //Create our servo object
    int score = 10; //Keep track of student's score



    void setup(){
    Serial.begin(19200); //Start serial
    dial.attach(9); //Set the pin for the servo PWM
    dial.write(170);
    randomSeed(analogRead(2));

    }



    void loop(){
    int numA = random(13); //pick number between 0 and 12
    int numB = random(13);

    Serial.print("What is ");
    Serial.print(numA);
    Serial.print(" x ");
    Serial.print(numB);
    Serial.println(" ?");


    while(!Serial.available()){
    }


    int guess = Serial.parseInt();

    if (guess == numA*numB){
    Serial.println("Correct!");
    if (score <= 150) score += 20;
    }
    else {
    Serial.print("Incorrect. The answer is ");
    Serial.print(numA*numB);
    Serial.println(".");
    if(score> 30) score -= 20;
    }

    dial.write(180-score);

    if (score >= 150){
    Serial.println("You win!");

    score = 10;
    }
    }



    ReplyDelete