Show Posts
Pages: 1 ... 8 9 [10] 11 12 ... 14
136  Using Arduino / Project Guidance / Re: Connecting both an APC 220 and W5100 to a Mega 1280 on: February 07, 2012, 11:46:13 am
Based on the underwhelming number of replies, I'll assume there is no easy way. I've thought of a possible solution, I'll try it out.
Jim
137  Using Arduino / Project Guidance / Connecting both an APC 220 and W5100 to a Mega 1280 on: February 05, 2012, 03:58:15 pm
I have multiple Arduinos with sensors in various locations, communicating with APC220 RF modules. I want to connect Pachtube to all of them. My plan is to use a mega 1280 with a

http://www.ebay.com/itm/New-SainSmart-Sensor-Shield-V5-4-Arduino-APC220-Bluetooth-Analog-Module-Servo-/260928323943?pt=BI_Electrical_Equipment_Tools&hash=item3cc08a4167'

to connect the APC 220 and collect data from my sensors and a

http://www.ebay.com/itm/W5100-Ethernet-Shield-for-Arduino-Laterest-Version-micro-SD-Card-PoE-Ready-00930-/110819574126?pt=LH_DefaultDomain_0&hash=item19cd5c816e

to connect the W5100 and thus to my router. What I am wondering is if you can make either shield easily communicate with serial 2 instead of serial 1 so they are not trying to talk on the same port with both shields, and if so, how?
Jim
138  Using Arduino / Project Guidance / Looking for part: 16 bit I2C ADC on: January 05, 2012, 10:32:03 pm
I have a need to measure and log some DC voltages very accurately. I'm monitoring and logging a process that is very fussy. Somewhere recently I saw something in this forum about a 16 bit ADC that communicated through a I2C interface, but now I can't find it. I can't remember if it was on a shield or just a chip. If it's a chip I will make a shield using it. Does anyone here know what device I saw, or something similar?

Jim
139  Community / Bar Sport / Re: How far would you be will to travel for a "local" electronics hobbyist shop? on: December 18, 2011, 10:09:19 pm
I live 2 hours uphill, over 2-11,000 foot passes, of Denver on a good day, 5 on a snowy winter day. Internet or RS are my only choices.

Jim
140  Using Arduino / Networking, Protocols, and Devices / Re: Wireless RF APC220 on: December 17, 2011, 02:40:18 pm
I have been using this protocol with APC220, for some time. It work great over distance of 80 feet through 2 walls.

Jim
141  Using Arduino / Programming Questions / Re: Strange result SOLVED on: November 23, 2011, 02:06:08 pm
Thanks, Robtillart you were spot on! PaulS you are correct! I a noob at this, as probably is evident in my code, but I hope I will remember your comment, as it sure makes sense.

Jim
142  Using Arduino / Programming Questions / Strange result on: November 23, 2011, 01:17:18 pm
I trying to create a remote temperature sensor with ability to turn on a heater and fan remotely. I wrote this sketch for the heater side:

Quote
#include <SHT1x.h>
#include <math.h>

#define dataPin  10   // DATA
#define clockPin 11   // SCK
  int val = 0;
  float temp_c;
  float temp_f;
  float humidity;
  int heater = 8;
  int fan = 9;
  SHT1x sht1x(dataPin, clockPin);


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

void loop()
{
  temp_c = sht1x.readTemperatureC();
  temp_f = sht1x.readTemperatureF();
  humidity = sht1x.readHumidity();
   // send data only when you receive an A:
 if (Serial.available() > 0)
 {
     val = Serial.read();
     if (val == 10)
     {
     }
     else if (val == 13)
     {
     }   
     else if (val == 65)
     {
         Serial.print("Temperature: ");
         Serial.print(temp_f, 2);
         Serial.print("F");
         Serial.print("Humidity: ");
         Serial.print(humidity);
         Serial.println("%");
     }
     else if (val == 66)
     {
         digitalWrite(heater, LOW);
         Serial.println (val, DEC);
     }
     else if (val == 67)
     {
        digitalWrite(heater, HIGH);
   Serial.println (val, DEC);
     }
    else if (val == 68)
    {
        digitalWrite(fan, HIGH);
   Serial.println (val, DEC);
    }
    else if (val == 69)
    {
        digitalWrite(fan, LOW);
   Serial.println (val, DEC);
    }
 }
}

 I entered A [enter], B  [enter], C  [enter]D  [enter] E [enter]. I got the result:


Quote
Temperature: 66.34FHumidity: 29.52%
66
67
68
69

but the relays did not toggle. So to test  them I wrote:

Quote
int relay1 = 8;
int relay2 = 9;

void setup()
{
  Serial.begin(9600);
  pinMode (relay1, OUTPUT);
  pinMode (relay2, OUTPUT);
}
void loop()
{
  digitalWrite ( relay1, LOW);
  Serial.print ("1Low");
  delay (1000);
  digitalWrite ( relay1, HIGH);
  Serial.print ("1High");
  delay (1000);
  digitalWrite ( relay2, LOW);
  Serial.print ("2Low");
  delay (1000);
  digitalWrite ( relay2, HIGH);
  Serial.print ("2High");
  delay (1000);
 
}

and it works as expected, toggling the relays. Why doesn't my first sketch work as expected?

Jim
143  Using Arduino / Project Guidance / Re: Displaying serial data from a apc220 on a lcd PARTIALLY SOLVED on: November 17, 2011, 04:06:20 pm
Found this solution on Internet.

{
  int i=0;
 if(Serial.available())
   {
     delay(100);
     while( Serial.available() && i< 99)
     {
        message[i++] = Serial.read();
     }
   } 
     message[i++]='\0';
  lcd.print(message);
}

works great!
Unfortunately the temperature is a float and has too many digits and overruns the line. is there an easy to truncate a float to 1 digit after the decimal point? I think the while statement above can be modified to work but I am not sure how.

Jim
144  Using Arduino / Project Guidance / Displaying serial data from a apc220 on a lcd on: November 16, 2011, 08:57:12 pm
I'm trying to monitor the temperature in one building from another building 65 feet( about 20 meters) away. i am using 2 apc220s. I want to use an Arduino on the receiving end and possibly be able to switch a heater off/on as  well. At present I have one Arduino monitoring the temperature and can read it in the other building reliably on a PC. However every attempt to display the data using an LCD on another Arduino with the apc220 I have made has failed to compile. I am new to programming so this may simply be my ignorance. The message I transmitting is "Temperature is XX degrees F, The humidity is YY%". I have a 20X4 LCD, connecting via I2C.

Jim
145  Using Arduino / Programming Questions / Re: trying tolearn case on: November 10, 2011, 08:31:58 pm
Thanks guys, I got everything working with "else if" but I thought it would be clearer with "switch-case". Looking at your sample I can see that this is definitely true.

Jim
146  Using Arduino / Programming Questions / trying tolearn case on: November 10, 2011, 05:56:31 pm
 wrote this with "else if" statements and it worked. I'm trying to learn the case statement so I started to re-write. It compiled for 'a' but when I added 'b' I got these errors.

temp_rf_case.cpp: In function 'void loop()':
temp_rf_case:39: error: duplicate case value
temp_rf_case:33: error: previously used here

 I tried to use insert code here, but got a mess of "color" statements and code was unreadable, sorry.

#include <SHT1x.h>

#define dataPin  10   // DATA
#define clockPin 11   // SCK
#define dataPin2  10   // DATA
#define clockPin2 11   // SCK
 int heater = 9;
 int fan = 8;
  int val = 0;
  float temp_c;
  float temp_f;
  float humidity;
SHT1x sht1x(dataPin, clockPin);
SHT1x sht1x2(dataPin2, clockPin2);

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

void loop()
{
  temp_c = sht1x.readTemperatureC();
  temp_f = sht1x.readTemperatureF();
  humidity = sht1x.readHumidity();


  val = Serial.read(); // See what command is
  switch (val)
  {
    case -1:
    break;
    case 'A' || 'a' :
       // Read values from the sensor
       // Print the values to the serial port
         Serial.print("Temperature: ");
         Serial.print(temp_f, DEC);
         Serial.println("F");
   case 'B' || 'b' :
       {
         Serial.print("Humidity: ");
         Serial.print(humidity);
         Serial.println("%");
       }
/*   else if ('C' == val || 'c' == val)
       {
         digitalWrite (heater, HIGH);
       }
   else if ('D' == val || 'b' == val)
       {
         digitalWrite (heater, LOW);
       }
   else if ('E' == val || 'e' == val)
       {
         digitalWrite (fan, HIGH);     
       }               
   else if ('F' == val || 'f' == val)
       {
         digitalWrite (fan, LOW);     
       } */
  }       
147  Using Arduino / Project Guidance / Re: fastest pulse? on: November 06, 2011, 06:24:48 pm
Would this be better done with a 556?

Jim
148  Using Arduino / Project Guidance / fastest pulse? on: November 06, 2011, 06:12:58 pm
I need to produce 2 separate pulses, simultaneously, both pulses variable in both rep rate and pulse width. max frequency is about 1000 Hertz. Pulse width should be from 5% to 100%. What is the minimum time between 2 digital writes? I know I can time with milli's, but I am not sure what the timing is on writes themselves. I can't use PWM as rep rate never changes. I also unsure how I handle keeping width a constant % as rep rate changes. Is this possible with an Uno?

Jim
149  Using Arduino / Installation & Troubleshooting / Re: After hard sisk crash driver not found for mega on: October 23, 2011, 03:32:24 pm
Due to other issues, I formatted the drive and reloaded Windows  again and reloaded the drivers. Everything worked! It must have been a bad Windows installation.
jim
150  Using Arduino / Installation & Troubleshooting / is there a definition of terms for the preferences file on: October 21, 2011, 02:05:13 pm
I would like to set up the environment so it starts full screen with the last opened file opened. The terse keys in the preference file are not self explanatory enough to show me how to do this. Is it even possible?
Jim
Pages: 1 ... 8 9 [10] 11 12 ... 14