Do Not Write to Pin Simulators!

edited March 2015 in UC Berkeley CS160

All,

A recurring theme in the Piazza/Forum questions is about people wanting to programmatically change the value of a Pin Simulator. You should not do this!

Doing so breaks the analogy here: the idea is that a pin simulator is analogous to a real-world sensor. In the real world, your app would not be telling the sensor to change it's value. Your device (the pet feeder) would be making some change in the world (e.g. making your pet happier or less hungry) and then the sensor would read that that change has happened in the world and update itself. The app would not be updating the sensor.

The way that works in your prototype is this:

  1. Prototyper (you) sets values in the Pin Simulator using your mouse to describe the state of the world.
  2. Device app reads from Pin Simulator to find out what the world is like.
  3. User interacts with companion app to tell the Device to make some change in the world.
  4. Prototyper (you) sets new values in the Pin Simulators using your mouse to describe how the state of the world has changed due to the action taken by your device.

No where in there is either the companion phone app or the device app itself programmatically updating the Pin Simulator.

Comments

  • Maybe I am misunderstanding something, but doesn't this contradict the rubric breakdown?

    "App provides user with control of the hardware simulator (able to modify simulator data from mobile app)"

  • You're looking at an old version of the spec. I updated on bcourses and the course website to try to clarify.

Sign In or Register to comment.