Show Posts
Pages: [1] 2 3 ... 84
1  Using Arduino / Displays / Re: 20x4 display with serial board - Line 1 and 3 blocks? on: September 01, 2014, 06:15:16 pm
SDA to A4, SCL to A5.  4.7K resistor from SDA to V+, 4.7K resistor from SCL to V+.

run the I2C scanner sketch to verify communication with the backpack and verify the address.

Code:
#include <Wire.h>

void setup() {
  Serial.begin (115200);
  // Leonardo: wait for serial port to connect
  while (!Serial)
    {
    }

  Serial.println ();
  Serial.println ("I2C scanner. Scanning ...");
  byte count = 0;
 
  Wire.begin();
  for (byte i = 1; i < 120; i++)
  {
    Wire.beginTransmission (i);
    if (Wire.endTransmission () == 0)
      {
      Serial.print ("Found address: ");
      Serial.print (i, DEC);
      Serial.print (" (0x");
      Serial.print (i, HEX);
      Serial.println (")");
      count++;
      delay (1);  // maybe unneeded?
      } // end of good response
  } // end of for loop
  Serial.println ("Done.");
  Serial.print ("Found ");
  Serial.print (count, DEC);
  Serial.println (" device(s).");
}  // end of setup

void loop() {}

Was the display found?  Does the address match?
2  Using Arduino / Programming Questions / Re: Functions - call a function and send a variable on: September 01, 2014, 05:49:42 pm
Make the function
Void setAlarm(byte error)

Call with setAlarm(1);
Then in the setAlarm() function
Serial.print(error);
3  Using Arduino / Programming Questions / Re: how to troubleshoot laser harp program? on: September 01, 2014, 12:07:32 pm
Open the Tone.h file in an editor.  add #include <arduino.h> near the top of the file and save it.  That worked for me. 
4  Using Arduino / Programming Questions / Re: How to send a float over Serial to another controller. on: September 01, 2014, 11:15:30 am
Look up dtostrf function.  That will convert your float to a c-string (say myFloat)  Then mySerial.println(myFloat);.  The println will add the carriage return.
5  Using Arduino / Programming Questions / Re: button.h library not working on: September 01, 2014, 11:02:18 am
I downloaded and installed the button library from arduino-info, copied and pasted your code and your code compiled fine.  Check your library installation.
6  Using Arduino / Programming Questions / Re: How to send a float over Serial to another controller. on: September 01, 2014, 10:48:24 am
Is the ph circuit expecting a string like "74.22\n"  (\n is carriage return code)?  Are you using a software serial port to communicate with the ph circuit?  It would be a big help if you could provide a data sheet for the ph circuit so we could see what format, baud rate, etc. that the ph circuit wants.
7  Using Arduino / Motors, Mechanics, and Power / Re: Arduino, 5V relay, 220v: checking I'm not putting myself or others at risks on: August 31, 2014, 07:48:19 pm
The SSRhas the additional advantage that it can be driven directly by an output pin.  No transistor and diode required.
8  Using Arduino / Programming Questions / Re: How can i inprove this code?? on: August 31, 2014, 06:30:05 pm
I would make states boolean, but they are stored as bytes so there is no difference space wise.  Declaring as boolean let's reader know their function better, though.
9  Using Arduino / Programming Questions / Re: How can i inprove this code?? on: August 31, 2014, 06:17:41 pm
Pin numbers will not be greater than 255, so don't need to be ints. Make the pin assignments const byte.  Saves a byte of memory and puts it the assigned byte in program memory.  States  don't need to be ints either, but can't be const if they will change.  Use the F macro to store string literals in print statements in program memory (Serial.print(F("text"));
Make your code more readable by removing blank lines.  Use control t to auto indent your code, again for readability.
10  Using Arduino / Project Guidance / Re: HELP - Digital Piano 72keys ... what is the best solution for so many inputs? on: August 31, 2014, 06:04:18 pm
For the keyboard, look up keyboard matrix.  The matrix could be made using 17 digital pins.  You can use shift registers or I2C port expanders to cut down on pin count.
11  Using Arduino / Displays / Re: Read data from lcd of any other device on: August 31, 2014, 09:11:06 am
Do you have any more info on the device?  Is the LCD a standard character LCD?  What is the LCD interface?  8 bit, 4 bit, I2C, serial? 
12  Using Arduino / Displays / Re: I/O Expander with LCD and 4x4 Keypad on: August 31, 2014, 09:06:14 am
I suggest that if you are having trouble with a library, that is not a standard Arduino library, that you include a link to or attach the library that you are using so everyone is on the same page.  As it is I have to search for the libraries and hope that they are the ones you are using.
13  Products / The Arduino Starter Kit / Re: Question about Spaceship Interface project on: August 31, 2014, 08:32:55 am
220 would work for the switch, but 10K is used because very little current needs to flow  into the digital pin and 10K will allow enough current.  If 220 ohm were used almost 50 times the current flows.  That much current is not required and is inefficient as heck.  On he other hand the LED requires the current that the 220 ohm resistor allows.
14  Using Arduino / Programming Questions / Re: Understanding Code on: August 30, 2014, 12:16:01 pm
Quote
So is it correct to say you dont need the wire library if the lcd i2c library takes care of these commands.
You still need the Wire library as the liquid crystal library uses it (calls wire functions).  You still need to include the Wire library.  Try not including it to see.  To see what the functions and required function parameters are for a library, look at the header (.h) file.  All member functions for that library (class) are declared there.  The .cpp file has the member function definitions, ie the guts of the functions.
15  Using Arduino / Project Guidance / Re: communication with a digital scale on: August 30, 2014, 10:55:34 am
Arduino serial defaults to 8 bit.  The scale is 7 bit.  Have you tried to change either Arduino serial or scale serial so the data bits match?
Pages: [1] 2 3 ... 84