Original MMA8452 Accelerometer code from Electric Imp: reference / hardware / MMA8452 / MMA8452.device.nut .
Send events from device to agent. Log from agent.
Agent receives accel data and sends command to light the LED for the upward face.
Translate accel data to cube face selection. Code cleanup. Hook for publishing face selection.
simple pubnub demonstration