Show Posts
Pages: 1 [2]
16  Using Arduino / Sensors / Re: I2C Pressure Sensor on: October 10, 2012, 08:24:35 pm
Mark i appreciate the info..

I went ahead and modified the code as you suggested to read,
Code:
  while (Wire.available() <2 )
   {
    firstbyte = Wire.read();       // Read press high byte
    secbyte = Wire.read();      // Read press low byte
   }
 

It seems to me that it hangs around the While loop since the Serial Monitor doesn't show anything.

If i remove the "<2" i get data being spat out, although i don't think its correct since regardless of the pressure it shows the same numerical values ?

Ideas, Suggestions ?

Pete

17  Using Arduino / Sensors / I2C Pressure Sensor on: October 07, 2012, 09:47:49 pm
Hello,

I have a Smartec Pressure sensor that i am trying to get values from and eventually display to a small LCD screen.
http://www.smartec-sensors.com/assets/files/pdf/Datasheets_pressure_sensors/SPD006LIhybN.pdf

I figured the first step would be to get proper data out to the serial monitor.

So far i have the following, but i believe i need some guidance on how to interpret/convert the data to something meaningful smiley

Thanks for your help !!
Pete


Code:
#include "Wire.h"
#define addrs 0x78 // I2C bus address


void setup()
{
Wire.begin();
Serial.begin(9600);
}

void loop()
{
 
   byte firstbyte;
   byte secbyte;
 
   Wire.beginTransmission(addrs);
   Wire.write(0);        // move your register pointer back to 0
   Wire.endTransmission();
   
   
   Wire.requestFrom(addrs, 2); // contents of your first two registers
   while(Wire.available())          // Check for data from slave
    {                               
      firstbyte = Wire.read();       // Read press high byte
      secbyte = Wire.read();      // Read press low byte
    }
 
  Serial.print("first byte  ");
  Serial.print(firstbyte, DEC);
 
  Serial.print("sec byte  ");
  Serial.println(secbyte, DEC);
 
  delay(500);
}
18  Using Arduino / Displays / Re: LCD I2C Displaying Weird Characters. on: May 03, 2012, 11:11:28 am
I tried getting the  LCDi2cNHD Library to work but for some reason it wouldn't even compile, many error messages.

I ended up removing the jumper that i had soldered and implementing the screen using the Serial communication and it worked just fine.

I appreciate your help smiley

Pete
19  Using Arduino / Displays / Re: LCD I2C Displaying Weird Characters. on: May 02, 2012, 02:12:47 pm
Considering that, what are my other options for using this LCD using the fewest possible wires ?

Pete
20  Using Arduino / Displays / Re: LCD I2C Displaying Weird Characters. on: May 02, 2012, 01:12:52 pm
What about the library listed on this page for New Haven (LCDi2cNHD) Displays, it seems they also use the PIC 16F690 Interface ?

http://arduino.cc/playground/Code/LCDi2c

Pete
21  Using Arduino / Displays / LCD I2C Displaying Weird Characters. on: May 02, 2012, 01:32:07 am
I am trying to interface my Uno R3 board to this LCD

http://media.nkcelectronics.com/datasheet/LCM1602K3-NSW-BBW.pdf

Using the Example in the Liquid Crystal I2C Library "Hello World" all i get is a bunch of meaningless characters on the screen.
I have checked that the correct pins are connected and that R2 jumper is soldered for I2C comm.

Is their something i am missing ? ? ?

Thanks smiley

Code:
#include <Wire.h>
#include <LiquidCrystal_I2C.h>

LiquidCrystal_I2C lcd(0x19,16,2);  // set the LCD address to 0x19 for a 16 chars and 2 line display

void setup()
{
  lcd.init();                      // initialize the lcd
 
  // Print a message to the LCD.
  lcd.backlight();
  lcd.print("Hello, world!");
}

void loop()
{
}
Pages: 1 [2]