9 years, 6 months ago.

how do i make lm75b as the interruptin to be event triggered?

osMode();
 
    /** Set the OS pin mode of the LM75B
     *
     * @param mode The new OS pin mode as an OSMode enum.
     */

i am working on a project that i think i have to use event triggered interrupt, when my mic voltage is above threshold, interruptin will rise so it will be a HIGH and vice versa. i am having problem making the lm75b temperature as a interrupt. i know that i have to use osmode to configure it and stating its default address.do i have to solder a wire to from the os which is pin 3 to somewhere?can someone share with me to how to configure it as an interrupt.thank you

#include "mbed"
 #include "LM75B.h"

AnalogIn  rightmic(p16);
InterruptIn sensor(p28, p27);//supposely this should be LM75B
Timer t;

void right()
{
t.start();
float sample=rightmic.read()*3.3;
printf("%f",sample);
t.stop();
printf("%f", t.read());
t.reset();
}
int main()
{
while(1)
{
sensor.rise(&right);//if it is a HIGH it will run the function of right. 
}
}

this so far what i have tried.

posted by faris abdat 20 May 2015
Be the first to answer this question.