1 UPM (Useful Packages & Modules) Sensor/Actuator repository for MRAA 2 ============== 3 4 UPM is a high level repository for sensors that use MRAA. Each sensor links 5 to MRAA and are not meant to be interlinked although some groups of sensors 6 may be. Each sensor contains a header which allows to interface with it. 7 Typically a sensor is represented as a class and instantiated. 8 9 The constructor is expected to initialise the sensor and parameters may be used 10 to provide identification/pin location on the board. 11 12 Typically an update() function will be called in order to get new data from the 13 sensor in order to reduce load when doing multiple reads to sensor data. 14 15 ### Example 16 17 A sensor/actuator is expected to work as such (here is the MMA7660 accelerometer API): 18 ```C++ 19 // Instantiate an MMA7660 on I2C bus 0 20 upm::MMA7660 *accel = new upm::MMA7660(MMA7660_I2C_BUS, 21 MMA7660_DEFAULT_I2C_ADDR); 22 23 // place device in standby mode so we can write registers 24 accel->setModeStandby(); 25 26 // enable 64 samples per second 27 accel->setSampleRate(upm::MMA7660::AUTOSLEEP_64); 28 29 // place device into active mode 30 accel->setModeActive(); 31 32 while (shouldRun) 33 { 34 int x, y, z; 35 36 accel->getRawValues(&x, &y, &z); 37 cout << "Raw values: x = " << x 38 << " y = " << y 39 << " z = " << z 40 << endl; 41 42 float ax, ay, az; 43 44 accel->getAcceleration(&ax, &ay, &az); 45 cout << "Acceleration: x = " << ax 46 << "g y = " << ay 47 << "g z = " << az 48 << "g" << endl; 49 50 usleep(500000); 51 } 52 ``` 53 54 However implementation and API design is completely up to the developer, some 55 enumerable sensors for example may provide much clever instantiation. Displays 56 may also create more complex structures in order to interface with them. 57 58 Browse through the list of all [examples](https://github.com/intel-iot-devkit/upm/tree/master/examples). 59 60 Multi-sensor samples for the starter and specialized kits can be found in the 61 [iot-devkit-samples](https://github.com/intel-iot-devkit/iot-devkit-samples) repository. 62 63 ### Supported Sensors 64 65 Supported [sensor list](http://iotdk.intel.com/docs/master/upm/modules.html) from API documentation. 66 67 You can also refer to the [Intel IoT Developer Zone](https://software.intel.com/iot/sensors). 68 69 ### IDE Integration 70 71 If you would like to create projects and run the UPM samples using an Intel recommended IDE, 72 please refer to the Intel Developer Zone IDE page. 73 74 <a href="https://software.intel.com/iot/software/ide"><img src="docs/icons/allides.png"/></a> 75 76 ### Building UPM 77 78 See building documentation [here](docs/building.md). 79 80 ### Making your own UPM module 81 82 Porting [link](docs/porting.md) has more information on making new UPM modules. 83 84 There is also an example available for max31855 [sensor](docs/max31855.md). 85 86 ### Naming conventions and rules for new UPM contributions 87 88 Before you begin development, take a look at our naming [conventions](docs/naming.md). 89 90 Also, please read the guidelines for contributions [to UPM](docs/contributions.md). 91 92 Don't forget to check the documentation [section](docs/documentation.md). 93 94 Make sure you add yourself as an author on every new code file submitted. 95 If you are providing a fix with significant changes, feel free to add yourself 96 as a contributor. Signing-off your commits is mandatory. 97 98 API Documentation 99 ============== 100 101 <a href="http://iotdk.intel.com/docs/master/upm"><img src="docs/icons/c++.png"/></a> 102 <a href="http://iotdk.intel.com/docs/master/upm/java"><img src="docs/icons/java.png"/></a> 103 <a href="http://iotdk.intel.com/docs/master/upm/python"><img src="docs/icons/python.png"/></a> 104 <a href="http://iotdk.intel.com/docs/master/upm/node"><img src="docs/icons/node.png"/></a> 105 106 ### Changelog 107 Version changelog [here](docs/changelog.md). 108 109 ### Known Limitations 110 List of known limitations [here](docs/knownlimitations.md). 111