7. Construct a phrase

Now, you can construct a phrase based on rotational movements of the SensorTag.

  1. Turn on your sensor and use the application on your mobile device that is set to broadcasting.
  2. Use your sensor to drive the Node-RED flow that you just deployed and generate a sentence.If you lay the SensorTag down, light sensor up, text the right way round, then the side facing away from you is the bow, the side nearest to you is the stern. Left is port and right is starboard.The pitch will be the up and down rolling motion of the bow and port. The roll is the tilting motion of the port and starboard. The yaw doesn’t generate an acceleration reading in the SensorTag and will be ignored.


    Pitching it toward you is a positive motion. Pitching it away from you is a negative motion.

    Rotating the sensor left side up and right side down is a positive roll motion. Rotating the sensor right side up and left side down is a negative roll motion:

    To combine pitch and roll, you rotate the sensor diagonally corner to corner.

  3. Rotate the SensorTag to your listen/send toggle position (Pitch 0 Roll 180) that you set in step 25. The node status should change to Listening.
  4. Construct a sentence. The interpreter node builds the sentence as you add to it.
  5. Rotate the SensorTag to your send/listen toggle position.
    You should hear your constructed phrase replayed to you from your computer.

Summary

You should now have an application that can interpret the rotational movement of a SensorTag and convert that movement into an English sentence. In a later lab, you will use this capability to generate instructions to control other devices.