With every wiggle and jiggle, your spaghetti accelerometer shows you exactly when and how the block is accelerating—that is, changing speed or direction.
According to Newton’s Laws of Motion, an object remains in motion (or non-motion) unless acted on by a force. This tendency is known as inertia. The more massive an object, the more force required to accelerate it.
When you apply force to the block to move it, the marshmallows’ inertia causes them to stay in place until the force has time to travel from the block to the far end of the spaghetti. This time delay shows there’s an acceleration taking place: The lagging marshmallows appear to move in the opposite direction of the motion, indicating a positive acceleration (that is, the block is speeding up).
When you stop the block, the marshmallows keep moving until the force from the block has time to travel through the spaghetti to stop them. This causes the marshmallows to lurch forward in the same direction as the original motion, indicating a negative acceleration, or deceleration (slowing down or stopping).
You can find accelerometers in cars, cell phones, airplanes, flying drones, video-game controllers, and elsewhere. Modern electronic accelerometers are astonishingly tiny—just 500 micrometers, or 1/50th of an inch across. Though not made with marshmallows, they serve to detect changes in orientation and motion in much the same way as you see here.