Home > HardwareSensor

HardwareSensor

HardwareSensor is a project mainly written in C++ and JAVA, it's free.

An arduino sensor library

HardwareSensor

HardwareSensor is a library for sensor communication via packets. This library is packaged into the Antipasto Arduino IDE binary releases for Windows, Mac, and Linux. It can be downloaded here:

  • http://www.illuminatolabs.com/IlluminatoDownloads.htm

This library works for the following boards:

  • TouchShield Slide
  • TouchShield Stealth
  • Arduino Duemilanove
  • Arduino Mega
  • Arduino Diecimila

The typical usage case is to program the Arduino Sketch first, then program the TouchShield Sketch by changing your board through the Tools->Boards menu in the Antipasto Arduino IDE.

Arduino Example Sketch

This guy is broadcasting sensor values onto the serial pins.

    void setup() {
        Sensor.begin(19200);
    }

    void loop() {
        int value = analogRead(5);
        Sensor.print("accel", value);
    }

TouchShield Example Sketch

This guy is reading sensor packets from the serial pins.

    void setup() {
        Sensor.begin(19200);
        background(0);
    }

    void loop() {
        if (Sensor.available()) {
            int value;

            value = Sensor.read();  //get the sensor value
            text(value, 50, 10);             // print the value to the screen
            text(Sensor.getName(), 10, 10);  // print the name to the screen
        }
    }

More Information

For more information, visit the Antipasto Hardware Blog

Previous:sheBe