concept pressure in category javascript

appears as: pressure, pressure
JavaScript on Things: Hacking hardware for web developers

This is an excerpt from Manning's book JavaScript on Things: Hacking hardware for web developers.

Voltage is a measurement of the difference of potential energy between two points. It’s something like pressure or tension or gravitational force, as electricity is always itching to move from higher voltage to lower voltage. Voltage, measured in volts, is potential energy, but voltage alone, without moving charged electrons (jellyfish), can’t wreak any havoc (figure 3.2).

  • Other “multi” sensors (combining temperature, pressure, altimeters, and sometimes humidity): BME 280, BMP 280, HTU21D, and so on. See the Johnny-Five “Multi” API page for more supported I2C devices: http://johnny-five.io/api/multi/.
  • 7.5.3. Step 3: updating the display to show temperature and pressure

    Displaying temperature, atmospheric pressure, and compass heading at the same time overcrowds the limited 16x2 character space on the LCD. It would be better if we split the display into two screenfuls: one to display temperature and pressure, and the other to show compass heading. In our first version, there won’t be a way to swap between the two screens—it’ll just show temperature and pressure—but we’ll come back to that in a few moments.

    Listing 8.17. index.js
    // Register a callback for when a client (browser) tries to connect. // The callback is passed a reference to the `client` socket.on('connection', client => { // Listen for change events on the J5 Multi (representing the BMP180) weatherSensor.on('change', () => { // Emit a `weather` event on the client // And pass an object representing current sensor values // The client can listen for this event and handle it accordingly client.emit('weather', { // This is the temperature in Fahrenheit; // change to `C` if you'd prefer Celsius temperature: weatherSensor.thermometer.F, // Multiplying by 10 converts the sensor's readings in kilopascals // to more commonly used millibar units pressure: (weatherSensor.barometer.pressure * 10) }); }); });