Pages: [1]   Go Down
Author Topic: labview+arduino BT  (Read 852 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i m getting error i2c_init was not declared in the scope while i upload the code for MLX90614, i follow the instructions given http://bildr.org/2011/02/mlx90614-arduino/
Pls help me
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6106
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
To make this code work, before you load the code, or even open the Arduino program, we need to place the “I2Cmaster” in your Arduino Library. If you don’t know where that is by default, Look to the right.

Did you install the library?
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Thank you sir, i done what you ve said, now the code is compiled but it showing that "Binary sketch size: 4,652 bytes (of a 28,672 byte maximum)" it doesnt show any value in my serial monitor. Actually i m working with ArduinoBT interfacing with MLX90614 IR Thermometer. Please help me.
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
now the code is compiled but ... it doesnt show any value in my serial monitor

What code would that be?
Logged

Austin, TX
Offline Offline
Faraday Member
**
Karma: 71
Posts: 6106
Baldengineer
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Are you clicking the button that actually opens the serial monitor window?
Logged

Capacitor Expert By Day, Enginerd by night.  ||  Personal Blog: www.baldengineer.com  || Electronics Tutorials for Beginners:  www.addohms.com

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

yes sir, i clicked the actual button for the serial monitor, here the code is


#include <i2cmaster.h>


void setup(){
   Serial.begin(9600);
   Serial.println("Setup...");
   
   i2c_init(); //Initialise the i2c bus
   PORTC = (1 << PORTC4) | (1 << PORTC5);//enable pullups
}

void loop(){
    int dev = 0x5A<<1;
    int data_low = 0;
    int data_high = 0;
    int pec = 0;
   
    i2c_start_wait(dev+I2C_WRITE);
    i2c_write(0x07);
   
    // read
    i2c_rep_start(dev+I2C_READ);
    data_low = i2c_readAck(); //Read 1 byte and then send ack
    data_high = i2c_readAck(); //Read 1 byte and then send ack
    pec = i2c_readNak();
    i2c_stop();
   
    //This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for temps
    double tempFactor = 0.02; // 0.02 degrees per LSB (measurement resolution of the MLX90614)
    double tempData = 0x0000; // zero out the data
    int frac; // data past the decimal point
   
    // This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte.
    tempData = (double)(((data_high & 0x007F) << smiley-cool + data_low);
    tempData = (tempData * tempFactor)-0.01;
   
    float celcius = tempData - 273.15;
    float fahrenheit = (celcius*1.smiley-cool + 32;

    Serial.print("Celcius: ");
    Serial.println(celcius);

    Serial.print("Fahrenheit: ");
    Serial.println(fahrenheit);

    delay(1000); // wait a second before printing again
}

Logged

Offline Offline
Sr. Member
****
Karma: 9
Posts: 254
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Have you got the serial monitor baud rate set to 9600 properly?
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i m using arduinoBT , is this compatible with labview latest version
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

i m using arduino BT , is this compatible with Labview, if so means pls send me some example links
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 10
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

sir,
pls help me in my project, i want to transmit data from my arduino BT to labview, send me some example codes
Logged

Global Moderator
Offline Offline
Brattain Member
*****
Karma: 474
Posts: 18696
Lua rocks!
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Please do not cross-post. This wastes time and resources as people attempt to answer your question on multiple threads.

Threads merged.

- Moderator
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Labview reads and sends serial data. The code on the Arduino is no different when the serial data goes down a wire or is sent using radio waves.
Logged

Pages: [1]   Go Up
Jump to: