Show Posts
|
|
Pages: 1 2 [3] 4 5 ... 8
|
|
31
|
Using Arduino / Networking, Protocols, and Devices / Re: A story of three xbees; two emitters and one hub
|
on: November 08, 2012, 11:46:30 pm
|
Have the transmitting XBees include a unique identifier with the data. Could just be a single character.
I've tried your suggestion before, but might not be executing it right. for one of the transmitters, I am serially writing the incoming sensor value and and 'A' to establish an identifier like so: Serial.write('A'); Serial.write(average); delay(100); am I completely off? what were you suggesting? oh, and let me clarify, im sending sensor data from each transmitting xbee to a single receiving xbee. I am getting the sensor readings, except everything is all being mushed together when I am reading from the receiving end.
|
|
|
|
|
32
|
Using Arduino / Networking, Protocols, and Devices / A story of three xbees; two emitters and one hub
|
on: November 08, 2012, 10:46:59 pm
|
|
So I have two transmitting xbees sending data to a central arduino/xbee and that part is dandy. (btw, im working in transparent mode).
Now since these are all talking on the same serial port, I am getting both values mushed together when I want to be able to distinguish between each value from each emitting xbee.
tips? suggestions? whats possible?
|
|
|
|
|
34
|
Using Arduino / Programming Questions / Re: X Bee Series 1 RSSI signal pin values
|
on: November 07, 2012, 04:26:38 pm
|
|
Missed you PaulS!
yes, as stated in any forum, a measurement of signal strength is not the most accurate means to measure distance. ANYWAYS, in an ideal/interference free area, a measurement of the signal strength has been working for me until my issue (refer to the entire outlined explanation above)
|
|
|
|
|
35
|
Using Arduino / Programming Questions / X Bee Series 1 RSSI signal pin values
|
on: November 07, 2012, 03:03:33 pm
|
Greetings! So I am currently sending the values from an X Bees RSSI pin to another X Bee and reading the incoming values, then printing on an LCD. problem: The incoming values are only showing a range of 0-43ish. I want to see values extending to the 300ft range. I'm not sure what I am doing wrong. Here is my AT commands for each xbee, along with my sender and receiver code: Receiver emitter(everything same as receiver except ones listed) ATID4256 ATP01 ATIR0 ATCE0 ATCE1 ATBD5 ATM02 ATRP10 // Emitter Code for xbee RSSI pin
const int rssi_pin = 9; //RSSI Pin of the XBee Module int rssiDur; //variable to read pin byte inches_val;
//LED pins////////////////////////// const int led3 = 3; const int led4 = 4; const int led5 = 5; const int led6 = 6; const int led7= 7; const int led8= 8; const int led10= 10; const int led11= 11; const int led12= 12; const int led13= 13; /////////////////////////////////////
///Averager Variables///////////////////////////////
//this is intended to place first 10 read incoming RSSI values in an array and average. smoother readings
const int numReadings = 10;
int readings[numReadings]; // the readings from the RSSI int index = 0; // the index of the current reading int total = 0; // the running total int average = 0; // the average
///////////////////////////////////////////////////
void setup(){ for (int thisReading = 0; thisReading < numReadings; thisReading++) readings[thisReading] = 0;
pinMode (led3, OUTPUT); pinMode (led4, OUTPUT); pinMode (led5, OUTPUT); pinMode (led6, OUTPUT); pinMode (led7, OUTPUT); pinMode (led8, OUTPUT); pinMode (led10, OUTPUT); pinMode (led11, OUTPUT); pinMode (led12, OUTPUT); pinMode (led13, OUTPUT); Serial.begin(38400); //Xbee communicating at this baud }
void loop(){
rssiDur = pulseIn(rssi_pin, LOW, 200); //this is set to 200ms with ATRP @ 2 inches_val = rssiDur ; total= total - readings[index]; // read from the sensor: readings[index] = inches_val; // add the reading to the total: total= total + readings[index]; // advance to the next position in the array: index = index + 1;
// if we're at the end of the array... if (index >= numReadings) // ...wrap around to the beginning: index = 0;
// calculate the average: average = total / numReadings;
Serial.write(average); delay(100); // delay in between rea
// value 10 = 1 meter if (average > 18 && average < 196){ //1-5 meters // Serial.write(1); digitalWrite(led3, HIGH); digitalWrite(led4, HIGH); digitalWrite(led5, HIGH); digitalWrite(led6, HIGH); digitalWrite(led7, HIGH); digitalWrite(led8, HIGH); digitalWrite(led10, HIGH); digitalWrite(led11, HIGH); digitalWrite(led12, HIGH); digitalWrite(led13, HIGH); } if (average > 196 && average < 393){ //5-10 meters //Serial.write(2); digitalWrite(led3, HIGH); digitalWrite(led4, HIGH); digitalWrite(led5, HIGH); digitalWrite(led6, HIGH); digitalWrite(led7, HIGH); digitalWrite(led8, HIGH); digitalWrite(led10, HIGH); digitalWrite(led11, HIGH); digitalWrite(led12, LOW); digitalWrite(led13, LOW); } if (average > 393 && average < 590){ //10- 15 meters //Serial.write(3); digitalWrite(led3, HIGH); digitalWrite(led4, HIGH); digitalWrite(led5, HIGH); digitalWrite(led6, HIGH); digitalWrite(led7, HIGH); digitalWrite(led8, HIGH); digitalWrite(led10, LOW); digitalWrite(led11, LOW); digitalWrite(led12, LOW); digitalWrite(led13, LOW); } if (average > 590 && average < 787){ //15-20 meters //Serial.write(4); digitalWrite(led3, HIGH); digitalWrite(led4, HIGH); digitalWrite(led5, HIGH); digitalWrite(led6, HIGH); digitalWrite(led7, LOW); digitalWrite(led8, LOW); digitalWrite(led10, LOW); digitalWrite(led11, LOW); digitalWrite(led12, LOW); digitalWrite(led13, LOW); } if (average > 787 ){ //20-30 meters // Serial.write(5); digitalWrite(led3, HIGH); digitalWrite(led4, HIGH); digitalWrite(led5, LOW); digitalWrite(led6, LOW); digitalWrite(led7, LOW); digitalWrite(led8, LOW); digitalWrite(led10, LOW); digitalWrite(led11, LOW); digitalWrite(led12, LOW); digitalWrite(led13, LOW); } }
...and the receiver #include <LiquidCrystal.h>
const int ledPin = 13; //const int signalStrengthPin = 9;
byte incomingByte, val_read;
//int RSSIpin = 9; //unsigned long rssiDur;
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
void setup() { Serial.begin(38400); lcd.begin(16,2); lcd.noAutoscroll(); pinMode(ledPin, OUTPUT); // pinMode(signalStrengthPin, INPUT); }
void loop() {
//rssiDur = pulseIn(RSSIpin, LOW, 200); // print signal strength //Serial.println(rssiDur); if (Serial.available()>0) { // incomingByte = Serial.read(); //Serial.print(" Byte: "); //Serial.println(incomingByte); //delay(100); //while ((int(incomingByte) == 1)) { val_read = Serial.read(); //Serial.print("Svalues ="); //int inches = val_read / mathbyte; Serial.println(int(val_read));
delay(100); //Serial.print(int(inches)); lcd.setCursor(0,0); lcd.print("Bike1="); lcd.print(int(val_read), DEC);
}
}
|
|
|
|
|
36
|
Using Arduino / Programming Questions / Re: Telnet SMTP gmail with copperhead Wifi Shield
|
on: August 15, 2012, 02:31:02 pm
|
First off, thanks for the extremely helpful explanation. Second, I am trying to send an SMS directly from the arduino. I figured I'd achieve this with wifi, since each service provider has unique email addresses to send texts to a phone number (i.e. 3122224444@txt.att.net) So, that is where I am at. I am unaware of where to begin, based on the sample sketches that have been supplied with this wifi shield.
|
|
|
|
|
38
|
Using Arduino / Programming Questions / Re: Telnet SMTP gmail with copperhead Wifi Shield
|
on: August 14, 2012, 03:09:46 pm
|
it doesnt run. the syntax for the ethernet library does not work with the classes for the Wifi shield library. the sketch alone for just ethernet does not even compile. i have the library installed, but no luck. You seem to have a sketch that connects to an SMTP server and tries to send an email using SMTP. thats essentially what I want to. don't i need to specify login information? maybe an example sketch could get me going? I dont know what the issue is
|
|
|
|
|
40
|
Using Arduino / Programming Questions / Telnet SMTP gmail with copperhead Wifi Shield
|
on: August 14, 2012, 12:23:23 pm
|
alrighty, so I am trying to send an SMS via telnet to gmail, but i really have no idea what I am doing. I am using this shield: http://www.cutedigi.com/wireless/wifi/linksprite-cuhead-wifi-shield-for-arduino.htmlall of the sketches work fine. i've managed to connect the shield to the network. Now onto executing telnet to gmail : I conceptually understand these guides on this process to connect illustrated here: http://www.tech-and-dev.com/2010/10/sending-email-using-gmail-smtp-server.htmland here is my attempt to fuse together somebodys ethernet shield example and the classes with the copperhead wifi shield. I have no clue what I am missing, what I need to consider, if anyone has working examples, what functions can be attached to this shields classes, etc. HELP. /* SEND AN EMAIL WITH ARDUINO 9/23/11 This code was created by modifying the connect example from arduino.cc and with the help of the YABB forums and their very helpful members. This code sends an email to any email address and then disconnects. */
#include <SPI.h> #include <Ethernet.h> #include <WiServer.h>
#define WIRELESS_MODE_INFRA 1 #define WIRELESS_MODE_ADHOC 2
// Wireless configuration parameters ---------------------------------------- unsigned char local_ip[] = {192,168,1,2}; // IP address of WiShield unsigned char gateway_ip[] = {192,168,1,1}; // router or gateway IP address unsigned char subnet_mask[] = {255,255,255,0}; // subnet mask for the local network const prog_char ssid[] PROGMEM = {"ASYNCLABS"}; // max 32 bytes
unsigned char security_type = 0; // 0 - open; 1 - WEP; 2 - WPA; 3 - WPA2
// WPA/WPA2 passphrase const prog_char security_passphrase[] PROGMEM = {"12345678"}; // max 64 characters
// WEP 128-bit keys // sample HEX keys prog_uchar wep_keys[] PROGMEM = { 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, 0x08, 0x09, 0x0a, 0x0b, 0x0c, 0x0d, // Key 0 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 1 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, // Key 2 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 // Key 3 };
// setup the wireless mode // infrastructure - connect to AP // adhoc - connect to another WiFi device unsigned char wireless_mode = WIRELESS_MODE_INFRA;
unsigned char ssid_len; unsigned char security_passphrase_len; // End of wireless configuration parameters ----------------------------------------
//byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; // Arduino's artificial mac address //byte ip[] = { 192, 168, 1, 1 }; // my ip byte server[] = { 64,233,183,109 }; // my smtp.xxx.net server ip f gmail
Client client(server, 465);
void setup() { Ethernet.begin(local_ip, gateway_ip ); Serial.begin(57600);
Serial.println("connecting..."); if (client.connect()) { Serial.println("connected"); client.println("HELO itismeletschat"); /* say hello (statement after helo is needed but irrelevant)*/
client.println("MAIL From: me@my-isp.net"); /* identify sender, this should be the same as the smtp server you are using */
client.println("RCPT To: you@your-isp.net"); /* identify recipient */
client.println("DATA");
client.println("To: you@your-isp.net"); /* identify recipient */ client.println("Subject: You Have Arduino Mail!!"); /* insert subject */
client.println("Please let me know it worked!!!"); /* insert body */ client.println("."); /* end email */ client.println("QUIT"); /* terminate connection */ client.println(); } else { Serial.println("connection failed"); } }
void loop() { delay(10000); if (!client.connected()) { Serial.println(); Serial.println("disconnecting."); client.stop(); for(;;) ; } }
|
|
|
|
|
44
|
Using Arduino / Programming Questions / LED won't shut off completely.
|
on: May 01, 2012, 10:06:26 am
|
so i followed this LED strip tutorial: http://www.ladyada.net/products/digitalrgbledstrip/index.htmlbasically I've followed the circuit with the TIP 122 transistor, and I'm trying to fade between 3 led strips. they all work, except one of the strips will not completely turn off. I'm not sure if anyone has some quick suggestions/tips why this might be happening. the code has been tested and works fine with lower voltage LED's. I've adjusted the circuit to take into an account an external power supply instead of the Arduino power due to low amperage and not enough voltage. help?
|
|
|
|
|