Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
TSL2550.h
00001 /* 00002 * mbed library to use a TAOS TSL2550 Ambient Light Sensor 00003 * Copyright (c) 2011 Stefan Goeckeritz, 00004 * RheinAhrCampus Remagen, Suedallee 2, 53424 Remagen 00005 * 00006 * Released under the MIT License: http://mbed.org/license/mit 00007 */ 00008 00009 #ifndef TSL2550_H 00010 #define TSL2550_H 00011 00012 #include "mbed.h" 00013 00014 class TSL2550 : public Base { 00015 public: 00016 TSL2550(PinName p_sda, PinName p_scl); 00017 TSL2550(I2C& p_i2c); 00018 00019 unsigned short get_ch0(); 00020 unsigned short get_ch1(); 00021 double get_lux(); 00022 void update(); 00023 00024 protected: 00025 void init(); 00026 unsigned short twi_read (unsigned short, unsigned short); 00027 void twi_write (unsigned short, unsigned short); 00028 00029 I2C i2c; 00030 00031 private: 00032 double lux; 00033 unsigned short ch0, ch1; 00034 }; 00035 00036 #endif
Generated on Wed Jul 13 2022 06:14:21 by
1.7.2