Show Posts
Pages: 1 ... 12 13 [14] 15 16 ... 23
196  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 04:49:19 am
Oh..it means the code sometimes will fail to execute ? Am I correct ?
197  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 04:31:59 am
Blocking of what ? Blocking of the signal from transmitter ?
198  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 04:22:54 am
OK..so means I can use the idea that vw_have_message () then do something ?
199  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 04:02:14 am
Quote
What does it means ?
In a nutshell, see if there's any data to read, read it
Code:
if (vw_get_message(buf, &buflen))
, and then print it
Code:
for (i = 0; i < buflen; i++)
{
    Serial.print((char)buf[i]);
    Serial.print(" ");
}
.
Then how about vw_have_message()?
200  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 03:24:37 am
Is this the syntax ? Thanks
201  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 02:56:11 am
Modified ! Thanks . hope you can help me
202  Using Arduino / Programming Questions / Re: Ethernet programming on: January 21, 2013, 11:53:00 pm
Oh, its html.

Okay thanks !
203  Using Arduino / Programming Questions / Ethernet programming on: January 21, 2013, 10:55:15 pm
http://pastebin.com/CZ6J62qJ

Referring to this projects,

Quote
          client.println("HTTP/1.1 200 OK"); //send new page
          client.println("Content-Type: text/html");
          client.println();
 
          client.println("<HTML>");
          client.println("<HEAD>");
          client.println("<meta name='apple-mobile-web-app-capable' content='yes' />");
          client.println("<meta name='apple-mobile-web-app-status-bar-style' content='black-translucent' />");
          client.println("<link rel='stylesheet' type='text/css' href='http://homeautocss.net84.net/a.css' />");
          client.println("<TITLE>Home Automation</TITLE>");
          client.println("</HEAD>");
          client.println("<BODY>");
          client.println("<H1>Home Automation</H1>");
          client.println("<hr />");
          client.println("<br />");
         
          client.println("<a href=\"/?lighton\"\">Turn On Light</a>");
          client.println("<a href=\"/?lightoff\"\">Turn Off Light</a><br />");       
 
          client.println("</BODY>");
          client.println("</HTML>");
          client.println("<br />");
           client.println("<hr />");
           
          client.println("<br />");
          client.println("HELLO WORD");
 


I am curious, where can I learn that programming to create a GUI online ? For example :
 client.println("<br />");
 client.println("<hr />");

Thanks
204  Using Arduino / Programming Questions / Re: VirtualWire on: January 21, 2013, 09:13:25 pm
Quote
So, if I want to send a number 2, then how do I wrote it in array of 8 bits ??? Thanks
Code:
uint8_t msg[1] = 2;
vw_send(msg, 1);

So how about the receiving part ?
Code:
void loop()
{
    uint8_t buf[VW_MAX_MESSAGE_LEN];
    uint8_t buflen = VW_MAX_MESSAGE_LEN;

  [b]  if (vw_get_message(buf, &buflen)) // Non-blocking[/b]
    {
int i;

        digitalWrite(13, true); // Flash a light to show received good message
// Message with a good checksum received, dump it.
Serial.print("Got: ");

for (i = 0; i < buflen; i++)
{
   Serial.print((char)buf[i]);
   Serial.print(" ");
}
Serial.println("");
        digitalWrite(13, false);
    }
}
What does it means ?
205  Using Arduino / Programming Questions / Re: VirtualWire on: January 21, 2013, 08:48:34 pm
So from this can I say uint8_t is like a data type ?

For example int variable, so uint8_t variable ?

Thanks
206  Using Arduino / Programming Questions / Re: VirtualWire on: January 21, 2013, 01:37:04 pm
So, if I want to send a number 2, then how do I wrote it in array of 8 bits ??? Thanks
207  Using Arduino / Programming Questions / Re: VirtualWire on: January 21, 2013, 12:32:32 pm
Okay. Got it.

Means if I give the function unsigned integer with 8 bits(An array), then I do not need to write the keyword uint8_t ?

Correct ?
Heheh
208  Using Arduino / Programming Questions / Re: VirtualWire on: January 21, 2013, 12:22:48 pm
So the  purpose of adding (uint8_t*)msg is just to tell that the message is an array of 8 bits.

Am I correct ?
209  Using Arduino / Programming Questions / Re: VirtualWire on: January 21, 2013, 12:17:24 pm
I mean I can also write like this vw_send(char msg[8],8) ? Instead of writing it like vw_send((uint8_t*)msg,8), char msg[8] = {'1','2','3','4','5','6','7','8'}

Hahaha.. well, so confuse ><
210  Using Arduino / Programming Questions / Re: VirtualWire on: January 21, 2013, 12:08:11 pm
Okay, I think I have to read more about pointer and array. Thanks !

vw_send(message, length)
Transmit a message. "message" is an array of the bytes to send, and "length" is the number of bytes stored in the array. This function returns immediately and the message is sent slowly by an interrupt-based background process.

so the message is refering to ((uint8_t*)msg), where msg is any number of words ? It is not array anymore because we include the uint8_t already ?

Thanks
Pages: 1 ... 12 13 [14] 15 16 ... 23