Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Communication with Bluetooth Wireless Prelab: Preliminary NXC Program Sensor 1:

ID: 3591281 • Letter: C

Question

Communication with Bluetooth Wireless

Prelab: Preliminary NXC Program Sensor 1: Touch sensor Sensor 2: Light sensor OUT A: Left motor OUT B: Right mator Task Description: From what we have learned so far, the NXT brick can be controlled by an NXC program. It can also be directly controlled by the Bricx command center. Since the NXT brick has the facility to accept messages via the Bluetooth wireless circuitry, we can write an NXC program to let the NXT brick perform a certain task according to messages sent from another NXT brick. Being able to control the NXT using messages has many useful applications such as rermote bamb defusing, remote car control, etc Write a NXC program for the NXT to continuously (nonstop) wait for a Bluetooth wireless message and perform the task once according to the table below Message Tasks Go Forward for 0.5 sec Go Backward for 0.5 sec Spin clockwise for 0.5 sec Spin counterclackwise for Q.5 sec Play four tones: GABG, each for 0.25 sec. Go forward until touch (Sensor hits something). Go forward from white space; if Light sensor is on black, stop the motar, increment variable cnt, and display cnt value on the LCD, cnt is initially O Use NumOut function to display the cnt value) Go forward from white space, cross two black strips, and stcp.

Explanation / Answer

ANSWER: THIS IS C++

public category MainActivity extends Activity implements OnClickListener realize the weather
etNum1 = (EditText) findViewById(R.id.etNum1);
etNum2 = (EditText) findViewById(R.id.etNum2);

btnAdd = (Button) findViewById(R.id.btnAdd);
btnSub = (Button) findViewById(R.id.btnSub);
btnMult = (Button) findViewById(R.id.btnMult);
btnDiv = (Button) findViewById(R.id.btnDiv);

tvResult = (TextView) findViewById(R.id.tvResult);

// set a perceiver
btnAdd.setOnClickListener(this);
btnSub.setOnClickListener(this);
btnMult.setOnClickListener(this);
btnDiv.setOnClickListener(this);

}

&&Override
public void onClick(View v) technique stub
float num1 = 0;
float num2 = 0;
float result = 0;

// check if the fields square measure empty
if (TextUtils.isEmpty(etNum1.getText().toString())
|| TextUtils.isEmpty(etNum2.getText().toString()))

// browse EditText and fill variables with numbers
num1 = Float.parseFloat(etNum1.getText().toString());
num2 = Float.parseFloat(etNum2.getText().toString());

// defines the button that has been clicked and performs the corresponding operation
// write operation into oper, we are going to use it later for output
switch (v.getId())

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote