Loading...
  Show Posts
Pages: 1 ... 3 4 [5] 6 7 ... 14
61  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 07:28:30 am
Then how can I implement my that idea ?
62  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 07:22:57 am
Quote
it means the code sometimes will fail to execute ? Am I correct ?
During development, code will always sometimes fail to execute as we expect it to.
But, no, you are not correct. "Blocking" means the code will loop waiting until a message is received. This may or may not be a problem for you.

The great thing about the Arduino is that you can try things, and if they don't work, try something different.
The frequency of your questions leads me to suspect you're not trying the things you're asking about.
Code:
#include <VirtualWire.h>
#undef int
#undef abs
#undef double
#undef float
#undef round
void setup()
{
    Serial.begin(9600); // Debugging only
    Serial.println("setup");

    // Initialise the IO and ISR
    vw_set_ptt_inverted(true); // Required for DR3100
    vw_setup(2000); // Bits per sec

    vw_rx_start();       // Start the receiver PLL running
    pinMode(13, OUTPUT);
}

void loop()
{
  uint8_t count;
if(count==true)
{
  count = false;
}
  count = vw_wait_rx_max(2000);// Non-blocking
  if (true)
  {
        digitalWrite(13, HIGH); // Flash a light to show received good message
delay(500);// Message with a good checksum received, dump it.
digitalWrite(13, LOW);
        delay(500);
  }
  else if(false)
  {
    digitalWrite(13, HIGH);
    delay(100);
    digitalWrite(13,LOW);
    delay(100);
  }
       

   
}

I write this code..I want it to be like when it does not receive message for 2s, then it will return false. If it receive message, then return true. Then it will only blink once then the whole system become false again. So what moddification I need to do ?

Thanks
63  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 04:59:31 am
Cool..yea I shall work for it now..thanks so much ..This library is easy to use !
64  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 ?
65  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 04:31:59 am
Blocking of what ? Blocking of the signal from transmitter ?
66  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 ?
67  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()?
68  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 03:24:37 am
Is this the syntax ? Thanks
69  Using Arduino / Programming Questions / Re: VirtualWire on: January 22, 2013, 02:56:11 am
Modified ! Thanks . hope you can help me
70  Using Arduino / Programming Questions / Re: Ethernet programming on: January 21, 2013, 11:53:00 pm
Oh, its html.

Okay thanks !
71  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
72  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 ?
73  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
74  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
75  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
Pages: 1 ... 3 4 [5] 6 7 ... 14