Electronic Components Datasheet Search |
|
NOA1305CUTAG Datasheet(PDF) 12 Page - ON Semiconductor |
|
|
NOA1305CUTAG Datasheet(HTML) 12 Page - ON Semiconductor |
12 / 13 page NOA1305 http://onsemi.com 12 Example Programming Sequence The following pseudo code configures the NOA1305 ambient light sensor and then runs it in an interrupt driven mode. When the controller receives an interrupt, it reads the ALS_Data from the device, sets a flag and then waits for the main polling loop to respond to the ambient light change. external subroutine I2C_Read_Byte (I2C_Address, Data_Address); external subroutine I2C_Read_Block (I2C_Address, Data_Start_Address, Count, Memory_Map); external subroutine I2C_Write_Byte (I2C_Address, Data_Address, Data); external subroutine I2C_Write_Block (I2C_Address, Data_Start_Address, Count, Memory_Map); subroutine Initialize_ALS () { MemBuf[0x00] = 0x08; // POWER_CONTROL assert Power On MemBuf[0x01] = 0x10; // RESET assert reset MemBuf[0x02] = 0x02; // INTEGRATION_TIME select 200ms MemBuf[0x03] = 0x01; // INT_SELECT select Low to High MemBuf[0x04] = 0xFF; // INT_THRESH_LSB MemBuf[0x05] = 0x8F; // INT_THRESH_MSB I2C_Write_Block (I2CAddr, 0x00, 6, MemBuf); } subroutine I2C_Interupt_Handler () { // Retrieve and store the ALS data ALS_Data_LSB = I2C_Read_Byte (I2CAddr, 0x06); ALS_Data_MSB = I2C_Read_Byte (I2CAddr, 0x07); NewALS = 0x01; } subroutine main_loop () { I2CAddr = 0x39; NewALS = 0x00; Initialize_ALS (); loop { // Do some other polling operations if (NewALS == 0x01) { NewALS = 0x00; // Do some operations with ALS_Data } } } |
Similar Part No. - NOA1305CUTAG |
|
Similar Description - NOA1305CUTAG |
|
|
Link URL |
Privacy Policy |
ALLDATASHEET.COM |
Does ALLDATASHEET help your business so far? [ DONATE ] |
About Alldatasheet | Advertisement | Datasheet Upload | Contact us | Privacy Policy | Link Exchange | Manufacturer List All Rights Reserved©Alldatasheet.com |
Russian : Alldatasheetru.com | Korean : Alldatasheet.co.kr | Spanish : Alldatasheet.es | French : Alldatasheet.fr | Italian : Alldatasheetit.com Portuguese : Alldatasheetpt.com | Polish : Alldatasheet.pl | Vietnamese : Alldatasheet.vn Indian : Alldatasheet.in | Mexican : Alldatasheet.com.mx | British : Alldatasheet.co.uk | New Zealand : Alldatasheet.co.nz |
Family Site : ic2ic.com |
icmetro.com |