Show Posts
Pages: 1 2 3 [4] 5 6 7
46  Using Arduino / Networking, Protocols, and Devices / Re: I2C help needed on: March 03, 2013, 01:38:39 pm
btw, the I2C table is on pg21. The device also does SPI and PWM but the I2C information is very minimal.
47  Using Arduino / Networking, Protocols, and Devices / Re: I2C help needed on: March 03, 2013, 01:26:59 pm
Hi John
Thank you.
48  Using Arduino / Networking, Protocols, and Devices / I2C help needed on: March 02, 2013, 07:07:38 pm
I am tring to understand and learn I2C better  and in doing so have come accross the following question.
I am using part of the I2C example code on the Arduino Learning website for the WIre Library SFR_Ranger reader.
My particular I2C device has a 14-bit reolution and the data is stored in Registers 254 and 255. In 255 the bits 6 and 7 are not used, hence the 14 bits.
Question 1)
I am confused about why I read register 255 in the code with 2 bytes, I would have thought it should read register 254 first but that just gives garbage.

Question 2)
In the statement
reading = reading << 6;    // shift high byte to be high 8 bits
I read the correct 14 bit data with range of 0 - 16383.
If I change the 6 to an 8 as in original code, which i understand is 16 bit, the output range is 0 - 65535. While I assume this is just the 14 bit data interpolated into the 16 bit range so resolution would not be any greater, My question is how does it do this? It is now reading 8 bits from each register but 2 of the bits are unused in the first register.

The answer is probably staring me in the face but i dont get it.

here is the working code.

#include <Wire.h>

void setup()
  Wire.begin();                // join i2c bus (address optional for master)
  Serial.begin(9600);          // start serial communication at 9600bps

unsigned int reading = 0;

void loop()
 Wire.beginTransmission(66); // transmit to device #112
 Wire.write(byte(255));      // sets register pointer to echo #1 register (0x02)
 Wire.endTransmission();      // stop transmitting

  // step 4: request reading from sensor
  Wire.requestFrom(66, 2);    // request 2 bytes from slave device #112

  // step 5: receive reading from sensor
  if(2 <= Wire.available())    // if two bytes were received
    reading =;  // receive high byte (overwrites previous reading)
    reading = reading << 6;    // shift high byte to be high 8 bits
    reading |=; // receive low byte as lower 8 bits
    Serial.println(reading);   // print the reading

  delay(300);                  // wait a bit since people have to read the output :)
49  Using Arduino / Displays / Re: Newhaven Display NHD‐C0220BiZ New LCD driver library on: February 16, 2013, 08:13:59 pm
After a struggle i have managed to get this library working with a newhaven COG LCD NHD-C0216CiZ-FSW-FBW-3V3
the only part i am now struggling with is the Contrast setting.
The specified command
seems to do nothing. Supposedly it has a range between 0-15 but there is no change.
I do not understand the implementation in the data sheet of the follower circuit as this seems to be tied to the follower settings.
Has anyone got any experience using this library successfully that may have an answer?

50  Using Arduino / Displays / Re: using LCD numeric displays without controller on: January 06, 2013, 01:10:32 am
Thank you very much for the advice. It seems like it is much easier to stick with the units that have a driver. The reasson I was looking at changing is i am trying to save space from the Bulky 8x2 display I am using now. I dont really need a baclight and i could do what I need with just 3 1/2 characters. Does anyone know of a compact lcd without the big metal frame and backlight that has a driver chip on board?
51  Using Arduino / Displays / using LCD numeric displays without controller on: January 05, 2013, 07:37:17 pm
I have been trying to find a tutorial or discussion on using Numeric LCD displays that do not have a built-in controller. These are the 3.5 digit types that look like a Dip.
Is there a way to use these with Arduino or do you have to install a controller for it?
Sorry if this covered elsewhere.
52  Using Arduino / Project Guidance / Re: BLUETOOTH + IPHONE + ARDUINO on: January 01, 2013, 03:16:11 am
You can connect bluetooth to iphone with HID profile..
Here is a post and an app tonrecieve the data..,136076.0.html
53  Using Arduino / Networking, Protocols, and Devices / Re: Arduino + Bluetooth JY-MCU on: January 01, 2013, 03:12:48 am
Iphone will not connect to this bluetooth device. You can however use a HID profile over bluetooth and it connects fine.
Here is a post about it,136076.0.html
54  Development / Other Hardware Development / Re: Using Arduino DFU Serial on your own projects on: December 11, 2012, 10:10:36 pm
Thank you. a$2000 fee? thats not going to happen.
Thanks again
55  Development / Other Hardware Development / Using Arduino DFU Serial on your own projects on: December 10, 2012, 05:08:14 pm
I apologise if this is covered somewhere else. I produce a small device loosly based on the Uno and also uses Atmega 16U2 for USB Serial. I use Amel AVRISP II to upload UNO DfU firmware to the chip and of course it enumerates just like an UNO and the descriptor is Arduino UNI by
How can I change this to install as my own descriptor instead of Arduino? I dont really understand all the jargon in the readme file about PID and VID. Hoping someone can shed some Layman light on this.

56  Development / Other Hardware Development / Re: Small-run PCB assembly on: December 10, 2012, 04:50:21 pm
I used
They make PCB's and also have assembly plant. Very reasonable, under $2 for an Uno type SMD board excluding components. Even with components it was reasonable.
57  Community / Products and Services / Re: Send Arduino data to Iphone -HID - Magic MonitorX on: December 07, 2012, 09:33:06 pm
You can purchase it with HID Pre-Loaded at Roving Networks
The part number is actually RN-42 HID @ $16.95
You can also buy it already mounted on a breakout board with a level-shifter on-board for $39, part number RN-42-SM, but you have to specify to them that you want the HID Profile pre-loaded.

58  Community / Products and Services / Send Arduino data to Iphone -HID - Magic MonitorX on: December 06, 2012, 08:08:52 pm
As everyone knows, Apple blocks most paths to get data into the iPhone from a MCU via Serial or bluetooth. After trying many apparent solutions I decided HID was a simple way to do it. A new App on the Appstore called Magic Montor X uses the HID profile to send data from your Arduino or any other RX/TX device to the iPhone. Basically HID emulates a keyboard so it reads the incoming data in ASCII format. HID bluetooth is portable so you're not stuck with Ethernet Shield. It is cheap, you can add a HID bluetooth module for about $17 or even cheaper if you know how to implement HID profiles.
You can send up to 7 different data messages to the iphone and each will appear in a different "Monitor" Window. There are also 6 LED's you can turn ON or OFF. All this data will update each loop of your sketch.
You can customise the display to show 1 to 6 Data windows and name the units for each window.
The simplest solution I found is using roving Networks RN-42 and simply connecting it to RX/TX. It pairs seamlessly with iPhone and then you can just serial.Print data to the phone.

Control characters are used to get the correct data to the intended data window.
It is wireless and so much better than an LCD display.
Any questions, let me know
59  Using Arduino / Programming Questions / Re: How to remain inside a function? on: October 11, 2012, 10:53:39 am
Right, that is why it worked ok in the UNO because it was mostly absolute. It is used only once from Reset so the 0-4 Seconds was just that, minus a small startup time. It doesnt work very well in leonardo because of the way the Serial port works so I am trying to find another way to test the Max and Min.
60  Using Arduino / Programming Questions / Re: How to remain inside a function? on: October 11, 2012, 10:36:13 am
But isn't that what the next 2 IF statements do? Test in the 0-4 seconds for the max value and test in 4-8 seconds for the min value?
Pages: 1 2 3 [4] 5 6 7