Week 9

Hao Yan - Mon 11 May 2020, 2:20 am
Modified: Mon 15 June 2020, 5:16 pm

We now have a problem. The brightness of our laser sensor is too low; usually, the laser irradiation distance is very far, so we can use it to do our interactive module. But now our laser sensor can only be used within a distance of less than 5 cm. For our device, this is almost useless. We need to consult Ben next Thursday and hope he can give us some suggestions about this laser sensor.

Issue 1

The second problem is that we have not solved the problem of how to play background music so far. Our background music is divided into two parts, 1. sound feedback, 2 background sound effects. The background sound effects are synthesized by 3D music, and at least four speakers are required to work simultaneously. But during this period, it also needs to be synchronized with sound feedback. So we have not been able to play these two contents at the same time so far. The plan B we now consider is to use a computer to connect a speaker to play background music, and then the four speakers around are only used to play sound feedback, such as the sound of hitting the enemy. But doing so will affect the user experience of our device. So we need Ben to give us some suggestions.

Issue 2

Regarding the feedback last week, many people suggested that I change the sound of the ultrasonic sensor because the buzzer sound is too harsh. This is indeed the case, but at present, there is still nothing that can replace the buzzer. In the course last Tuesday, Paula showed their group of small speakers. I think this may be one of our next options. We can directly use this small speaker to play some immediate sound effects instead of harsh buzzers. Or use the computer to play these prompts.

But considering the safety, the sound of the buzzer is actually not a bad thing. I mean, if the alarm emits a softer sound, it is likely not to serve as a warning. Only when the buzzer sounds loud enough can people realize that they need to return to a safe place. Maybe I can use distance as an element to adjust the volume. The sound will become louder as the distance becomes smaller.

About how to connect the work of the four people in our group, this can be a very tricky business. Because at present, each of our work is a relatively independent individual. If you connect everyone's work, you need to make some changes based on the existing code. But none of our group is good at C #, so in the foreseeable next few weeks, we may have to concentrate on doing this.

code of ultrosnic sharing


void setup() {

pinMode(trigPin, OUTPUT); // Sets the trigPin as an Output

pinMode(echoPin, INPUT); // Sets the echoPin as an Input

pinMode(buzzer, OUTPUT);

pinMode(ledPin, OUTPUT);

Serial.begin(9600); // Starts the serial communication

}

void loop() {

// Clears the trigPin

digitalWrite(trigPin, LOW);

delayMicroseconds(2);

// Sets the trigPin on HIGH state for 10 micro seconds

digitalWrite(trigPin, HIGH);

delayMicroseconds(10);

digitalWrite(trigPin, LOW);

// Reads the echoPin, returns the sound wave travel time in microseconds

duration = pulseIn(echoPin, HIGH);

// Calculating the distance

distance= duration*0.034/2;

safetyDistance = distance;

if (safetyDistance <= 120){ //Enter the Distance 

  digitalWrite(buzzer, HIGH);

  digitalWrite(ledPin, HIGH);

  digitalWrite(relayPin, LOW); 

}

else{

  digitalWrite(buzzer, LOW);

  digitalWrite(ledPin, LOW);

  digitalWrite(relayPin, HIGH); 

}

// Prints the distance on the Serial Monitor

Serial.print("Distance: ");

Serial.println(distance);

}