Final Project: Good Parent Or Not?

Good Parent Or Not? – Jae Yang – Andy Garcia

CONCEPTION AND DESIGN

This project is a game, or an interesting test for everyone who is a parent or would like to be a parent. In this project, you can experience different events during your kid’s growth and choose your reaction that could influnce your kid. But when doing this test, the user does not know what kind and degree of effect they would give to their kid, which is also happening in real life. In my previous group research, my team and I designed a device that could receive neural signals and transmit feedback from users. Good Parent Or Not has also achieve an interaction like this but instead of real-time feedback, it gives a comprehensive result at the end.

From my perspective, I will define interaction as an environment in or with which two actors can listen, think and speak to each other as a cycle. This environment is built with digital code and different elements which themselves remain their identity, which can make it have countless possibilities and also be automated easily. So we decided to make a project with user-oriented process and ending. Considering now people care more about teenagers’ mental health, we choose a concept about how a parent affects kids. But finally we decided not to make the feedback obviously shown during the process because mostly it won’t in real life. 

In the User Test Day, many students tried our project and gave feedback based on their experience. One of them is about the length of our text. It is too much to read. So we shortened the text. We also added a background music after that. Besides, we added a scale to our project according to Andy’s suggestion to enrich the physical part.

FABRICATION AND PRODUCTION

I would say the most hard part of this project is coding. We had been suffering from coding for so many days. 

First, we built the circuit with 4 buttons and started coding. It was quite easy to put pictures in Processing, however, we were stucked for a long time to make them shown after pressing the buttons. We defined many functions for different questions but they just did not appeared. We had checked all of the buttons and every jumper cables but all of them were working correctly. So we asked professor and found the reason. Something was going wrong about serial communicating in Arduino coding and the order of code was wrong in Processing. 

We were once also facing a problem that it kept jumping to the next step when keeping pressing button. We had tried delay() function and so many other ways, but it had not been working even for a while. Finanlly, I recalled we learnt about using previous value at the start of this semester and this coule be used to solve this problem. But it was still hard to write those lines since the coding had already been very complex. But we still needed to overcome this problem and we solved it step by step.

After finished the most part of coding, we started to make the physical part. I first draw the sketch on Cuttle. The screenshot below is top and bottom side of the physical part. 

Then we used the laser cut machine to cut the board.

 

The button was fitted to the board by the nut successfully. 

But we forgot to test the buttons. When running Processing with it, one of the button did not work so we had to remove those things and use another one which needed soldering.

As Andy suggested, we added a scale to our project. The hard part was not to improve the circuit or code, but finding some appropriate weights, both in weight and size. We wanted to use laser cutting again and glue the pieces together to make cubes, but the laser cutting machine was under maintainance so we could not use it. Then I asked Andy again for help. Thanks to Andy for making those wooden cubes by hand for us. All we needed to do for the cubes was only polishing them smooth.

CONCLUSIONS

As I said at the beginning, our goal is to make users think carefully about how to treat their kids. Even every single reaction could have big impact on a kid. You and your kid are you different people and please do not blame your child for not following your expectations. So in the fianl version, a user need to both choose the answers and also put cubes on the scale, which represent they think how much pressure they put on their kid. After all the scenarios, user would get an report showing expected mental health, real mental health and academic performance. During IMA Final Show, a lady got one of the outcome with low mental health but high academic performance, asked her son: “Was mum too strick to you? Sorry I didn’t not notice it and I will try to be better! Thank you for being so nice to mum even sometimes I really hurt you.” I was so gratified. 

If we still have time to improve this project, we would first adjust the background to make the text easier to read. We will also record ourselves reading the scenarios instead of just showing them as slides. 

So generally speaking, I think our project reached the goals that we set before——make people think carefully about their action to kids and others. In the IMA Show, a student got a outcome of kid’s suicide, and told me his answers were how his parents did to him. There were a lot of parents haven’t cared much about kids’ mental health, so we, and the society still have a long way to go.

APPENDIX

Code for Processing:

import processing.serial.*;
import processing.sound.*;
Serial serialPort;
SoundFile sound;

int NUM_OF_VALUES_FROM_ARDUINO = 5;  /* CHANGE THIS ACCORDING TO YOUR PROJECT */
/* This array stores values from Arduino */
int arduino_values[] = new int[NUM_OF_VALUES_FROM_ARDUINO];


PImage kid1;
PImage kid2;
PImage kid3;
PImage a1;
PImage a2;
PImage a3;
PImage a4;
PImage a5;
PImage a6;
PImage a7;
PImage a8;
PImage a9;

PImage ed1;
PImage ed2;
PImage ed3;
PImage ed4;


// use state to record if the button is pressed
int state = 0;
// value we need for game: ap and mp
int AP = 100;
int MP = 100;
Float weight;
int grade;

int preVal;
int preMP;

//String[] instruction = new String[7];
//instruction[0] = "You and your lover have a kid, and you really love him/her";
//instruction[1] = "You acoompanied with your kid through a carefree childhood";
//instruction[2] = "As time goes by, your kid needs to attend primary school";
//instruction[3] = "Suddenly, you need to make so many decicisions for your kid";
//instruction[4] = "No matter you like it or not, it is your duty...";
//instruction[5] = "Now, it is your turn to make choices";
//instruction[6] = "Press Any Button To Continue...";


void setup() {
  size(1200, 750);
  kid1 = loadImage("kid1.jpg");
  kid2 = loadImage("kid2.jpg");
  kid3 = loadImage("kid3.jpg");
  a1 = loadImage("a1.jpg");
  a2 = loadImage("a2.jpg");
  a3 = loadImage("a3.jpg");
  a4 = loadImage("a4.jpg");
  a5 = loadImage("a5.jpg");
  a6 = loadImage("a6.jpg");
  a7 = loadImage("a7.jpg");
  a8 = loadImage("a8.png");
  a9 = loadImage("a9.jpg");
  ed1 = loadImage("ed1.jpg");
  ed2 = loadImage("ed2.jpg");
  ed3 = loadImage("ed3.png");
  ed4 = loadImage("ed4.jpg");


  //start page
  image(kid1, 0, 0);

  // BGM
  frameRate(30);
  println("Loading mp3...");
  sound = new SoundFile(this, "Under the Heavens.mp3");
  sound.loop();


  printArray(Serial.list());
  // put the name of the serial port your Arduino is connected
  // to in the line below - this should be the same as you're
  // using in the "Port" menu in the Arduino IDE
  serialPort = new Serial(this, "COM6", 9600);
}



void draw() {
  //println(state);
  //println(MP);
  //receive the values from Arduino
  getSerialData();
  // use the values like this:
  int a = arduino_values[0];
  int b = arduino_values[1];
  int c = arduino_values[2];
  int d = arduino_values[3];

  float e = arduino_values[4];
  println (e);
  weight = map (e, 76070, 118125, 0, 100);
  grade = int (100 - weight);

  println(weight);
  println(grade);
  // 76000 nothing; largest box: 80800

  if (state == 100) {
    funeral();
  }
  if (state == 200) {
    if (MP>=60 && AP >=80) {
      ed1();
    } else if (MP<60 && AP >=80) {
      ed2();
    } else if (MP>=60 && AP <=80) {
      ed3();
    } else {
      ed4();
    }
  }


  if (state == 0) {
    noStroke();
    fill(255, 255, 255, 100);
    triangle(800, 200, 900, 200, 750, 250);
    ellipse(950, 150, 350, 250);
    fill(255, 255, 255, 1);
    rect(750, 575, 350, 100);
    String s = "What Do You Want Me";
    String t = "To Be Like?";
    fill(#778283);
    strokeWeight (10);
    textSize(30);
    text (s, 810, 140);
    text (t, 880, 190);
    String m = "Press Any Button To";
    String n = "Start The Story Game!";
    fill(255, 255, 255, 10);
    text (m, 795, 615);
    text (n, 780, 650);
  }


  // page 2 - Introduction Page -- no need to make choice, just press button to proceed
  if (state == 1) {
    image(kid2, 0, 0);
    fill(255);
    textSize(30);
    text ("You and your lover have a kid, and you really love him/her", 150, 120);
    text ("You acoompanied with your kid through a carefree childhood", 150, 170);
    text ("As time goes by, your kid needs to attend school", 150, 220);
    text ("Suddenly, you face so many decicisions", 150, 270);
    text ("No matter you like it or not, it is your duty...", 150, 320);
    text ("Now, it is your turn to make choices", 150, 370);
    textSize(23);
    text ("For each choice, add weight if you feel your chocie are somewhat harsh", 150, 650);
    text ("take off weight if you feel your chocie relief kid's pressure", 150, 685);
    textSize (22);
    text ("Press Any Button To Continue...", 900, 710);

    //for (int i = 0; i < instruction.length; i++) {
    //  fill(255);
    //  textSize(30);
    //  text(instruction[i], 100, 50 * i + 50);
    //  delay (200);
    //}
  }

  if (state == 2) {
    a1();
    // Choose A
    if (a == 1) {
      if (a != preVal) {
        MP+=5;
        AP+=5;
        preVal = 0;
      }
    }
    // Choose B
    if (b == 1) {
      if (b != preVal) {
        //MP unchange
        MP+=5;
        AP-=5;
        preVal = 0;
      }
    }
    // Choose C
    if (c == 1) {
      if (c!= preVal) {
        MP-=10;
        AP-=5;
        preVal = 0;
      }
    }
    // Choose D
    if (d == 1) {
      if (d != preVal) {
        MP-=20;
        AP-=20;
        preVal = 0;
      }
    }
    if (MP <=0) {
      state = 100;
    }
  }

  if (state == 3) {
    a2();
    // Choose A
    if (a == 1) {
      if (a != preVal) {
        MP+=5;
        AP+=5;
        preVal = 0;
      }
    }
    // Choose B
    if (b == 1) {
      if (b != preVal) {
        //MP unchange
        MP-=10;
        AP+=5;
        preVal = 0;
      }
    }
    // Choose C
    if (c == 1) {
      if (c!= preVal) {
        MP-=10;
        AP-=10;
        preVal = 0;
      }
    }
    // Choose D
    if (d == 1) {
      if (d != preVal) {
        MP-=20;
        AP-=20;
        preVal = 0;
      }
    }
    if (MP <=0) {
      state = 100;
    }
  }

  if (state == 4) {
    a3();
    if (a == 1) {
      if (a != preVal) {
        MP+=5;
        AP+=5;
        preVal = 0;
      }
    }
    // Choose B
    if (b == 1) {
      if (b != preVal) {
        //MP unchange
        MP+=5;
        AP-=10;
        preVal = 0;
      }
    }
    // Choose C
    if (c == 1) {
      if (c!= preVal) {
        MP-=5;
        AP+=10;
        preVal = 0;
      }
    }
    // Choose D
    if (d == 1) {
      if (d != preVal) {
        MP-=10;
        AP-=10;
        preVal = 0;
      }
    }
    if (MP <=0) {
      state = 100;
    }
  }

  if (state == 5) {
    a4();
    if (a == 1) {
      if (a != preVal) {
        MP-=20;
        AP-=10;
        preVal = 0;
      }
    }
    // Choose B
    if (b == 1) {
      if (b != preVal) {
        //MP unchange
        MP-=10;
        AP-=5;
        preVal = 0;
      }
    }
    // Choose C
    if (c == 1) {
      if (c!= preVal) {
        MP-=5;
        AP+=10;
        preVal = 0;
      }
    }
    // Choose D
    if (d == 1) {
      if (d != preVal) {
        MP+=5;
        AP-=20;
        preVal = 0;
      }
    }
    if (MP <=0) {
      state = 100;
    }
  }

  if (state == 6) {
    a5();
    if (a == 1) {
      if (a != preVal) {
        MP-=20;
        AP-=5;
        preVal = 0;
      }
    }
    // Choose B
    if (b == 1) {
      if (b != preVal) {
        //MP unchange
        MP-=10;
        AP+=10;
        preVal = 0;
      }
    }
    // Choose C
    if (c == 1) {
      if (c!= preVal) {
        MP+=5;
        AP+=10;
        preVal = 0;
      }
    }
    // Choose D
    if (d == 1) {
      if (d != preVal) {
        MP+=10;
        AP+=10;
        preVal = 0;
      }
    }
    if (MP <=0) {
      state = 100;
    }
  }

  if (state == 7) {
    a6();
    if (a == 1) {
      if (a != preVal) {
        MP-=10;
        AP+=5;
        preVal = 0;
      }
    }
    // Choose B
    if (b == 1) {
      if (b != preVal) {
        //MP unchange
        MP-=20;
        AP+=10;
        preVal = 0;
      }
    }
    // Choose C
    if (c == 1) {
      if (c!= preVal) {
        MP+=10;
        AP-=10;
        preVal = 0;
      }
    }
    // Choose D
    if (d == 1) {
      if (d != preVal) {
        MP-=20;
        AP-=20;
        preVal = 0;
      }
    }
    if (MP <=0) {
      state = 100;
    }
  }

  if (state == 8) {
    a7();
    if (a == 1) {
      if (a != preVal) {
        MP-=30;
        AP-=5;
        preVal = 0;
      }
    }
    // Choose B
    if (b == 1) {
      if (b != preVal) {
        //MP unchange
        MP-=10;
        AP-=10;
        preVal = 0;
      }
    }
    // Choose C
    if (c == 1) {
      if (c!= preVal) {
        MP+=10;
        AP-=10;
        preVal = 0;
      }
    }
    // Choose D
    if (d == 1) {
      if (d != preVal) {
        MP+=20;
        AP+=10;
        preVal = 0;
      }
    }
    if (MP <=0) {
      state = 100;
    }
  }

  if (state == 9) {
    a8();
    if (a == 1) {
      if (a != preVal) {
        MP-=30;
        AP+=-10;
        preVal = 0;
      }
    }
    // Choose B
    if (b == 1) {
      if (b != preVal) {
        //MP unchange
        MP-=5;
        AP-=10;
        preVal = 0;
      }
    }
    // Choose C
    if (c == 1) {
      if (c!= preVal) {
        MP+=10;
        AP-=10;
        preVal = 0;
      }
    }
    // Choose D
    if (d == 1) {
      if (d != preVal) {
        MP-=5;
        AP-=20;
        preVal = 0;
      }
    }
    if (MP <=0) {
      state = 100;
    }
  }


  if (state == 10) {
    a9();
    if (a == 1) {
      if (a != preVal) {
        MP-=20;
        AP-=10;
        preVal = 0;
      }
    }
    // Choose B
    if (b == 1) {
      if (b != preVal) {
        //MP unchange
        MP+=10;
        AP-=10;
        preVal = 0;
      }
    }
    // Choose C
    if (c == 1) {
      if (c!= preVal) {
        MP-=10;
        AP-=20;
        preVal = 0;
      }
    }
    // Choose D
    if (d == 1) {
      if (d != preVal) {
        MP+=5;
        AP+=20;
        preVal = 0;
      }
    }
    if (MP <=0) {
      state = 100;
    }
  }

  if (state == 11) {
    if (MP <=0) {
      state = 100;
    }
    if (MP>0) {
      state = 200;
    }
  }



  // press a button, and move on to next image
  if (a == 1 || b == 1 || c == 1 || d == 1 ) {
    preVal = 1;
  }
  if (a!=preVal && b!=preVal && c!=preVal && d!=preVal) {
    state +=1;
    preVal = 0;
  }
  //draw() end
}





//the helper function below receives the values from Arduino
// in the "arduino_values" array from a connected Arduino
// running the "serial_AtoP_arduino" sketch
// (You won't need to change this code.)

void getSerialData() {
  while (serialPort.available() > 0) {
    String in = serialPort.readStringUntil( 10 );  // 10 = '\n'  Linefeed in ASCII
    if (in != null) {
      //print("From Arduino: " + in);
      String[] serialInArray = split(trim(in), ",");
      if (serialInArray.length == NUM_OF_VALUES_FROM_ARDUINO) {
        for (int i=0; i<serialInArray.length; i++) {
          arduino_values[i] = int(serialInArray[i]);
        }
      }
    }
  }
}
// here we define function to be used
void a1() {
  noStroke();
  image(a1, 0, 0);
  fill(#B7B7B7, 180);
  rect(130, 110, 500, 77, 25);
  fill(255);
  textSize(40);
  text ("I got a low grade in school…", 150, 160);

  fill(#B7B7B7, 180);
  rect(130, 390, 915, 280, 25);
  fill(255);
  textSize(35);
  text("A. It's Ok, You Will Make Progress", 150, 430);                               // MP+5, AP+5
  text("B. You don't think grade is that important in primary school", 150, 500);      // MP+5, AP-5
  text("C. Hold Temper, but Actually Anxious about Peer Competition", 150, 570);      // MP-10, AP-5
  text("D. Angrily: You Didn't Work Hard Enough", 150, 640);                          // MP-20, AP-20
};

void a2() {
  image(a2, 0, 0);
  fill(#B7B7B7, 180);
  rect(130, 110, 900, 77, 25);
  fill(255);
  textSize(35);
  text ("You find Your Kid Got a Very Low Grade Without Telling You...", 150, 160);

  fill(#B7B7B7, 180);
  rect(130, 390, 860, 280, 25);
  fill(255);
  textSize(30);
  text("A. 'Why did you hide the Grade?'", 150, 430);  // MP+5, AP+5
  text("B. 'Why did you get this Grade?'", 150, 500);         // MP-10, AP+5
  text("C. You talk to teacher first", 150, 570);                                         // MP-10, AP-10
  text("D. Shocked and Angry,'You Didn't Work Hard Enough and You Lie?'", 150, 640);  // MP-20, AP-20
};


void a3() {
  image(a3, 0, 0);
  fill(#B7B7B7, 180);
  rect(130, 110, 690, 77, 25);
  fill(255);
  textSize(35);
  text ("Can I hang out with my friends on Weekend?", 150, 160);

  fill(#B7B7B7, 180);
  rect(130, 350, 900, 290, 25);
  fill(255);
  textSize(30);
  text("A. Yes but Back Home Before Dinner, You have Exams tomorrow", 150, 400);                   // MP+5, AP+5
  text("B. Sure, go have some fun in Weekend", 150, 470);                                         // MP+5, AP-10
  text("C. Well...Did You Review for BIG Exams on Monday?", 150, 540);                            // MP-5, AP+10
  text("D. No Unless You finished Exam Practice", 150, 610);                                     // MP-10,AP-10
};


void a4() {
  image(a4, 0, 0);
  fill(#B7B7B7, 180);
  rect(130, 95, 900, 100, 25);
  rect(130, 390, 885, 300, 25);
  fill(255);
  textSize(35);
  text ("I don't want to attend class today, I want some sleep.", 150, 160);
  textSize(30);
  text("A. You need to get up right now!", 150, 430);                  // MP-20,AP-10
  text("B. You must go unless you are not feeling well", 150, 500);             // MP-10,AP-5
  text("C. OK but you need to talk with teachers over the reasons by yourself", 150, 570);    // MP-5,AP+10
  text("D. OK. I text teacher", 150, 640);                           // MP+5, AP-20
};

void a5() {
  image(a5, 0, 0);
  fill(#B7B7B7, 180);
  rect(130, 95, 860, 150, 25);
  rect(130, 390, 885, 290, 25);
  fill(255);
  textSize(35);
  text ("You heard from other parents about good extra courses", 150, 160);
  text ("that help kids improve exam scores", 150, 210);
  textSize(30);
  text("A. Nervous about peer competition, sign kid up for many courses", 150, 430);            // MP-20, AP-5
  text("B. Sign kid up for a one/two courses", 150, 500);                                       // MP-10, AP+10
  text("C. You Believe courses in school are enough, will not send kids there", 150, 570);      // MP+5, AP+10
  text("D. Prioritize Kid's Willingness, Respect Kid's Decisions", 150, 640);                   // MP+10, AP+10
};


void a6() {
  image(a6, 0, 0);
  fill(#B7B7B7, 180);
  rect(130, 100, 730, 160, 25);
  rect(130, 430, 890, 270, 25);
  fill(255);
  textSize(35);
  text ("I really don't like taking that class after school", 150, 160);
  text ("Can I just don't Go Please...", 150, 220);
  textSize(30);
  text("A. Insist it is good for kid's future development", 150, 480);  // MP-10, AP+5
  text("B. Angry: You should work harder", 150, 540);                                // MP-20, AP+10
  text("C. Yes, sorry to make you feel you are forced to take that class", 150, 600);       // MP+10, AP-10
  text("D. Yes but can you promise your exam performance?", 150, 660);                      // MP-20, AP-20
};



void a7() {
  image(a7, 0, 0);
  fill(#B7B7B7, 180);
  rect(130, 100, 775, 110, 25);
  rect(130, 430, 840, 280, 25);
  fill(255);
  textSize(35);
  text ("You are told Kid has girlfriend/boyfriend at school...", 150, 160);
  textSize(30);
  text("A. Angry, Stop the Relationship", 150, 480);                                          // MP-30, AP-5
  text("B. Want to Stop, but Ask kid how is the other person first", 150, 540);               // MP-10, AP-10
  text("C. Don't think it is a big deal", 150, 600);                                          // MP+10, AP-10
  text("D. Feel Truly Happy for Kid", 150, 660);                                              // MP+20, AP+5
};


void a8() {
  image(a8, 0, 0);
  fill(#B7B7B7, 180);
  rect(130, 100, 500, 110, 25);
  rect(130, 430, 890, 280, 25);
  fill(255);
  textSize(35);
  text ("'What if I give up college?'", 150, 160);
  textSize(30);
  text("A. Impossible, Why can't You make it when others are all out there?", 150, 480);      // MP-30, AP-10
  text("B. Why", 150, 540);                                                                   // MP-5, AP-10
  text("C. You are an adult, you make decisions and be responsible for that", 150, 600);                                  // MP+10, AP-10
  text("D. Anxious but no idea what to do", 150, 660);                                        // MP-5, AP-20
};



void a9() {
  image(a9, 0, 0);
  fill(#B7B7B7, 180);
  rect(130, 100, 730, 110, 25);
  rect(130, 430, 800, 280, 25);
  fill(255);
  textSize(35);
  text ("I'm so stressed at graded mock exams recently", 150, 160);
  textSize(30);
  text("A. Stress pushes you forward", 150, 480);                                      // MP-20, AP-10
  text("B. Do you want to take a rest tommorrow?", 150, 540);                          // MP+10, AP-10
  text("C. It's just mock exams", 150, 600);                                           // MP-10, AP-20
  text("D. Try to set lower expextations for grade", 150, 660);                        // MP+5,  AP+20
};



void funeral() {
  image (kid3, 0, 0);
  fill (255);
  textSize(37);
  text ("Sad Story: YOU LOST YOUR KID", 520, 200);
  text ("Kid's Mental Health Points is", 520, 280);
  text("You expect kid's Mental Health to be:", 520, 360);
  text(grade, 520, 440);
  text (MP, 980, 280);
}


void ed1() {
  noStroke();
  image (ed1, 0, 0);
  fill(#B7B7B7, 180);
  rect(140, 77, 900, 327, 25);
  fill (255);
  textSize(35);
  text("You expect kid's Mental Health to be:", 180, 120);
  text(grade, 740, 120);
  text("Kid's Mental Heath Grade:", 180, 180);
  text(MP, 570, 180);
  text("Kid's Academic Performance Grade:", 180, 240);
  text(AP, 720, 240);
  text("Your kid gets into a great college and has a", 180, 300);
  text("great time in college. After graduation, your", 180, 350);
  text("kid lives their own lives smoothly and happily", 180, 400);
}

void ed2() {
  noStroke();
  image (ed2, 0, 0);
  fill(#B7B7B7, 180);
  rect(140, 77, 900, 327, 25);
  fill (255);
  textSize(35);
  text("You expect kid's Mental Health to be:", 180, 120);
  text(grade, 740, 120);
  text("Kid's Mental Heath Grade:", 180, 180);
  text(MP, 570, 180);
  text("Kid's Academic Performance Grade:", 180, 240);
  text(AP, 720, 240);
  text("Your kid goes to a good college, but when he becomes", 180, 300);
  text("self-indulgent when he/she has full control over life.", 180, 350);
  text("He/she fails college and lives an unhappy and normal life", 180, 400);
}

void ed3() {
  noStroke();
  image (ed3, 0, 0);
  fill(#B7B7B7, 180);
  rect(140, 77, 900, 327, 25);
  fill (255);
  textSize(35);
  text("You expect kid's Mental Health to be:", 180, 120);
  text(grade, 740, 120);
  text("Kid's Mental Heath Grade:", 180, 180);
  text(MP, 570, 180);
  text("Kid's Academic Performance Grade:", 180, 240);
  text(AP, 720, 240);
  text("Your child goes to a mediocre college and leads a", 180, 300);
  text("very normal but fulfilling life.", 180, 360);
}

void ed4() {
  noStroke();
  image (ed4, 0, 0);
  fill(#B7B7B7, 180);
  rect(140, 77, 900, 327, 25);
  fill (255);
  textSize(35);
  text("You expect kid's Mental Health to be:", 180, 120);
  text(grade, 740, 120);
  text("Kid's Mental Heath Grade:", 180, 180);
  text(MP, 570, 180);
  text("Kid's Academic Performance Grade:", 180, 240);
  text(AP, 720, 240);
  text("Your child fails to enter a college, and escapes from", 180, 300);
  text("home to find his/her freedom.", 180, 360);
}

Code for Arduino:

#include "HX711.h"
// HX711 circuit wiring
const int LOADCELL_DOUT_PIN = 2;
const int LOADCELL_SCK_PIN = 3;

HX711 scale;
long scaleReading;

void setup() {
  Serial.begin(9600);
  scale.begin(LOADCELL_DOUT_PIN, LOADCELL_SCK_PIN);
}

void loop() {
  // to send values to Processing assign the values you want to send
  // this is an example:
  // value from potentiometer, ranging from 0 to 1023
  int sensor0 = digitalRead(10);
  int sensor1 = digitalRead(11);
  int sensor2 = digitalRead(12);
  int sensor3 = digitalRead(13);

  if (scale.is_ready()) {
    scaleReading = scale.read();
  }

  // send the values keeping this format
  Serial.print(sensor0);
    Serial.print(",");
  Serial.print(sensor1);
    Serial.print(",");
  Serial.print(sensor2);
    Serial.print(",");
  Serial.print(sensor3);
  Serial.print(",");
  Serial.print(scaleReading);
    Serial.println();



  // too fast communication might cause some latency in Processing
  // this delay resolves the issue
 // delay(10);

  // end of example sending values
} 

Leave a Reply

Your email address will not be published. Required fields are marked *