Show Posts
Pages: [1] 2 3
1  Using Arduino / Project Guidance / triggering ikea Dioder without too much hardware modification? on: November 23, 2012, 05:10:24 pm
I was wondering if there was a way to control an ikea dioder using it's own powersupply but turn on and off with an arduino digital pin?
2  Using Arduino / Programming Questions / Ethernet Client Getting Stuck On Connecting on: June 25, 2011, 12:44:50 pm
Hello all,

I've been running my sketch for a couple hours the loops through a connection to a site every 30 secs and every once and a awhile it will get stuck on the connecting step,
if i reset it, it connects right way.
My question is, do you guys think it's the arduino or my web server denying access to it? my suspicion is that it's the arduino since if i reset it, it will connect right away.
Is the arduino capable of re-quering a page this often?
3  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 24, 2011, 05:21:06 pm
Ok
Thank You
4  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 24, 2011, 04:27:54 pm
I appreciate your help, after a piece of code is written for me (during my learning experience) i do take the time to understand it before i move on. it's really just a Syntax barrier for me. Commenting on sample code would be helpful for me and others that might come a long an review the code provided.

I do have a question on the sample code provided. if i'm understanding it correctly, this would not work if i wanted a in game LED to start blinking while the online led stayed on.

but i guess if i did all of the On statements first and the blinking ones second it would look like they were happening at the same time(maybe).

I'm not sure what this is doing
if(online || ingame)
5  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 24, 2011, 03:40:46 pm
Alright guys, i got it working kinda.
i have it running through the script with some conditions checking for certain text in the string and having the leds turn on.
BUT
i would like the two conditions to run at the same time?
right now it's checking for one and turning on the led then checking the next one and turning on the second LED
I would like it to check them both at the same time so both leds will turn on at the same time.

so i have something like this
Code:
if(readString.indexOf("Co") >0)//checks for online
           {
             Serial.println("Online");
             digitalWrite(2, HIGH);
           //  Serial.println("Led On");
             delay(5000);   
             digitalWrite(2, LOW);

if(readString.indexOf("Big") >0)//checks for in game
           {
             Serial.println("in game");
             digitalWrite(3, HIGH);
           //  Serial.println("Led On");
             delay(5000);   
             digitalWrite(3, LOW);

           }
6  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 24, 2011, 10:50:51 am
Quote
At some point you gotta just dig in, read the tutorials, read the docs, and read auxiliary articles pertaining to your issue. If your issue is that you don't know how to program in C/C++, read beginners C/C++ articles.
At some point, you have to understand that you can not destroy the hardware by loading a sketch on it and trying to run it. Personal observation is much more useful than asking questions like that last one on the forum.

I agree, i do learn a lot easier by doing. I got that portion figured out. Now i'm changing my output to reduce the data sized returned before i continue.
7  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 23, 2011, 11:38:37 pm
So that basically checks for the "on" or "off" in the string ?
8  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 23, 2011, 07:44:19 pm
That seems to work perfectly, now to the next step. creating an array from the string.
or
search the string for a word?
something like this

string = bob:in-game|paul:in-game|;2
if string contains paul then varb=true end if




9  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 22, 2011, 10:42:22 pm
Ok, so if i understand you correctly that if statement should work the first time around?(if my output was "turn on LED")
if so shouldn't i still be able to output the "incoming" variable once before it gets overwritten? nevermind, i think i understand that part

I wonder if i need to do something like this
http://www.arduino.cc/cgi-bin/yabb2/YaBB.pl?num=1222095474
10  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 22, 2011, 10:32:02 pm
I understand why it is writing it one char at a time, because i'm doing the output in the loop but what i don't get is when i output the variable outside the loop all i get is a bunch of blanks. (non stop, it seems)

i'm pretty sure this is the only thing getting returned from the page.

Code:
(
T
h
e
 
c
a
u
s
e
)
X
t
r
e
m
e
b
u
b
b
a
:
 
i
n
-
g
a
m
e
<
b
r
>
 
c
h
a
z
z
y
1
8
6
4
:
 
i
n
-
g
a
m
e
<
b
r
>
 
2

current code
Code:
void loop()
{
    while(client.available())
    {
    char incomingString =+ client.read();

     Serial.println (incomingString);
    }
       
     
   // if(incoming == "turn on LED")
    //{
     
    //digitalWrite(13, HIGH);
   // incoming = "";
             
    //}
     
}
11  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 22, 2011, 10:15:54 pm
ok when i do this
Code:
void loop()
{
    while(client.available())
    {
    char incoming = client.read();
     Serial.println (incoming);
   
    }
   
     
    if(incoming == "turn on LED")
    {
     
    digitalWrite(13, HIGH);
    incoming = "";
             
    }
     
}

i get the letters but they go down the screen one at a time

and when i do this( put the output outside the "While condition" it seems to just generate a bunch of blanks (the scroll bar starts shrinking rapidly)
Code:
void loop()
{
    while(client.available())
    {
    char incoming = client.read();
    }
         Serial.println (incoming);
     
    if(incoming == "turn on LED")
    {
     
    digitalWrite(13, HIGH);
    incoming = "";
             
    }
     
}

12  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 22, 2011, 09:45:06 pm
Thanx, ok so now i tried to output incoming to the serial console to check what is being returned and i got a bunch of numbers
code:
Code:
void loop()
{
while(client.available()) {
    incoming += client.read();
    Serial.println (incoming);
  }
 
  if(incoming == "turn on LED") {
  
    digitalWrite(13, HIGH);
    incoming = "";
  }
  
  
  
}

output:
Code:
starting simple arduino client test

connecting...
connected
40
4084
4084104
4084104101
408410410132
40841041013299
4084104101329997
4084104101329997117
4084104101329997117115
4084104101329997117115101
408410410132999711711510141
40841041013299971171151014188
40841041013299971171151014188116
40841041013299971171151014188116114
40841041013299971171151014188116114101
40841041013299971171151014188116114101109
40841041013299971171151014188116114101109101
4084104101329997117115101418811611410110910198
4084104101329997117115101418811611410110910198117
408410410132999711711510141881161141011091019811798
40841041013299971171151014188116114101109101981179898
4084104101329997117115101418811611410110910198117989897
408410410132999711711510141881161141011091019811798989758
40841041013299971171151014188116114101109101981179898975832
40841041013299971171151014188116114101109101981179898975832105
40841041013299971171151014188116114101109101981179898975832105110
4084104101329997117115101418811611410110910198117989897583210511045
4084104101329997117115101418811611410110910198117989897583210511045103
408410410132999711711510141881161141011091019811798989758321051104510397
408410410132999711711510141881161141011091019811798989758321051104510397109
408410410132999711711510141881161141011091019811798989758321051104510397109101
40841041013299971171151014188116114101109101981179898975832105110451039710910160
4084104101329997117115101418811611410110910198117989897583210511045103971091016098
4084104101329997117115101418811611410110910198117989897583210511045103971091016098114
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462
40841041013299971171151014188116114101109101981179898975832105110451039710910160981146232
4084104101329997117115101418811611410110910198117989897583210511045103971091016098114623299
4084104101329997117115101418811611410110910198117989897583210511045103971091016098114623299104
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462329910497
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462329910497122
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462329910497122122
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462329910497122122121
40841041013299971171151014188116114101109101981179898975832105110451039710910160981146232991049712212212149
4084104101329997117115101418811611410110910198117989897583210511045103971091016098114623299104971221221214956
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462329910497122122121495654
40841041013299971171151014188116114101109101981179898975832105110451039710910160981146232991049712212212149565452
4084104101329997117115101418811611410110910198117989897583210511045103971091016098114623299104971221221214956545258
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462329910497122122121495654525832
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462329910497122122121495654525832105
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462329910497122122121495654525832105110
40841041013299971171151014188116114101109101981179898975832105110451039710910160981146232991049712212212149565452583210511045
40841041013299971171151014188116114101109101981179898975832105110451039710910160981146232991049712212212149565452583210511045103
4084104101329997117115101418811611410110910198117989897583210511045103971091016098114623299104971221221214956545258321051104510397
4084104101329997117115101418811611410110910198117989897583210511045103971091016098114623299104971221221214956545258321051104510397109
4084104101329997117115101418811611410110910198117989897583210511045103971091016098114623299104971221221214956545258321051104510397109101
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462329910497122122121495654525832105110451039710910160
40841041013299971171151014188116114101109101981179898975832105110451039710910160981146232991049712212212149565452583210511045103971091016098
40841041013299971171151014188116114101109101981179898975832105110451039710910160981146232991049712212212149565452583210511045103971091016098114
4084104101329997117115101418811611410110910198117989897583210511045103971091016098114623299104971221221214956545258321051104510397109101609811462
408410410132999711711510141881161141011091019811798989758321051104510397109101609811462329910497122122121495654525832105110451039710910160981146232
40841041013299971171151014188116114101109101981179898975832105110451039710910160981146232991049712212212149565452583210511045103971091016098114623250


Future question, once i get this figured out.
Is there a way to search a string for a certain word anywhere in the string? kinda like a contains?
13  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 22, 2011, 09:17:50 pm
Ok, it looks like i may need to take a step back then?

I'm trying to have a LED turn on if a certain value is returned from the page.
Do i need to handle the data in a different way?
i know i don't have to print it but could i run a condition off of the "stringOne" variable to turn on a LED?
if not, i need to find out how to access the data coming back from the page
Code:
String stringOne = c;
     Serial.print(stringOne);
14  Using Arduino / Programming Questions / Re: Handling Returned Data from web server on: June 22, 2011, 08:54:08 pm

This is the code i'm using, is the data coming through my usb cable or through the ethernet?
i assumed it was coming from the ethernet, but i guess i could be wrong.

Code:
//zoomkat 11-13-10
//simple ethernet client test code
//for use with IDE 0021 and W5100 ethernet shield
//modify the arduino lan ip address as needed
//open serial monitor to see what the arduino receives

#include <SPI.h>
#include <Ethernet.h>

byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
byte ip[] = { 192, 168, 1, 100 };
byte server[] = { 65, 23, 97, 190 }; // zoomkat

Client client(server, 80);

void setup()
{
  Ethernet.begin(mac, ip);
  Serial.begin(9600);
  Serial.println("starting simple arduino client test");
  Serial.println();
 
  delay(1000);
 
  Serial.println("connecting...");
 
  if (client.connect()) {
    Serial.println("connected");
    client.println("GET http://server.net/serverpage.asp");
    client.println();
  } else {
    Serial.println("connection failed");
  }
}

void loop()
{
  if (client.available()) {
    char c = client.read();
   
    String stringOne = c;
     Serial.print(stringOne);
  }
 
  if (!client.connected()) {
    Serial.println();
    Serial.println("disconnecting.");
    client.stop();
    for(;;);
  }
}
 
15  Using Arduino / Programming Questions / Handling Returned Data from web server on: June 22, 2011, 08:35:30 pm
I started this thread
http://arduino.cc/forum/index.php/topic,64696.0.html

but i have made it out of the concept portion and am now looking for some help dealing with the returned data.

This is what i'm having returned to the serial monitor
starting simple arduino client test

connecting...
connected
bob: online<br> 1
disconnecting.

I am looking to turn on an LED if "bob" returned and better yet find a way to tie in the status of online to bob.

i guess i'm really just looking for some direction, maybe a link that shows me how to manipulate data coming into the serial monitor.
if that's even possible

Pages: [1] 2 3