Loading...
  Show Posts
Pages: [1] 2 3 ... 17
1  Using Arduino / Programming Questions / Re: Trying to combine twitter with another program. Also prevent duplicates. on: May 18, 2013, 02:54:19 am
Startby removing the delay from your twitter code, then put each one into a function, e.g checkTwitter() and checkWiFi(). In your main loop you will want to call chekWiFi() every time and checkTwitter() every minute. So something like:
Code:
unsigned long nextTwitterCheck;

void loop(){
   checkWiFi();
   if(millis()>nextTwitterCheck){
      checkTwitter();
      nextTwitterCheck+=60000;
   }
}
2  Using Arduino / Programming Questions / Re: TEA encryption algorithm test vector on: May 17, 2013, 08:15:11 pm
Code:
char Str6[15] = {"Welcome","to","Arduino","World"};
Looks like odd syntax to me, char Str6[15] allocates an array of char with 15 elements, {"Welcome","to","Arduino","World"} is an array of pointers to chars, i.e. a char**, so these types don't match.
The way you should do it is create a single char array, with the length being a factor of 8:
Code:
char Str6[32]="Welcome to Arduino World";
Even though "Welcome to Arduino World" is only 20 something characters long it allocates 32 bytes, to ensure 64 bit blocks, and the remaining bytes are all padded with 0s
3  Using Arduino / Programming Questions / Re: TEA encryption algorithm test vector on: May 17, 2013, 08:06:40 pm
It's impossible to tell what the problem could be as there are too many unknowns. Break your code up so that you can treat each bit individually. Start by making a program that sends plain characters with the RF module and ensure that you can reconstruct it at the other end correctly. Then put this into a function that takes an arbitrary array of bytes, again test with simple data to ensure it works. When you have that function created and working, your encryption and sending become independent of each other, for example if the output is incorrect then it must be the encryption, you will know where to look.
4  Using Arduino / Programming Questions / Re: Help me make sense of these bits on: May 17, 2013, 05:33:12 am
It looks as though the second byte is some sort of sequence number, if you discard the highest 4 bits (all 1111) and reverse the order of the lower 4 bits you get:
1010
1001
1000
0111
etc.
which is just decrementing. When it gets to 0000 it underflows (is that a word?) and goes back to 1111
5  Using Arduino / Programming Questions / Re: Web server, How to make a simple button to reset a counter?? on: May 16, 2013, 02:14:02 am
At the moment you are skipping over the request from the client, you will need to parse this request to check for the button press and rest the counter accordingly.
6  Using Arduino / Programming Questions / Re: Problem with files on: May 16, 2013, 01:55:35 am
It looks like there may be some problems with that library. You could try going through and fixing some of those function calls.
7  Using Arduino / Programming Questions / Re: Newbie here!! Starting a loop while its still finishing? on: May 16, 2013, 01:40:40 am
Those if statements are wrong. if (count =1) will always be true, = assigns the value of count and then returns the result of the assignment, it should be a ==, i.e. if (count==1), which is a comparison. Also you shouldn't have semi-colons at the end of your if() line, that terminates the if statement there.
There also must be a Much cleaner way to write this?
There is smiley the way I suggested:
Code:
void loop(){
   setPins(HIGH,LOW,HIGH);
   delay(Period_over_6);
   setPins(HIGH,LOW,LOW);
   delay(Period_over_6);
   setPins(HIGH,HIGH,LOW);
   delay(Period_over_6);
   setPins(LOW,HIGH,LOW);
   delay(Period_over_6);
   setPins(LOW,HIGH,HIGH);
   delay(Period_over_6);
   setPins(LOW,LOW,HIGH);
   delay(Period_over_6);
}

void setPins(char pin1,char pin2,char pin3){
   digitalWrite(Phase1Pin_P,pin1);
   digitalWrite(Phase2Pin_P,pin2);
   digitalWrite(Phase3Pin_P,pin3);
}
8  Using Arduino / Programming Questions / Re: XML string on: May 15, 2013, 05:34:05 pm
Your request should probably be:
Code:
err=http.post("ds.sidnow.com", 80, url);
ds.sidnow.com/ is not a valid host name so may be the problem.
Can't be sure though as I don't know what library you're using! smiley
Also next time please put all your code in code tags: [code][/code]
9  Using Arduino / Programming Questions / Re: TEA encryption algorithm test vector on: May 15, 2013, 05:27:06 pm
Have you got it working just sending basic strings? If you've got two bytes, you can get the lower four bits by and-ing with 0x0F and the higher 4 bits by and-ing with 0xF0 then right shifting by 4.
10  Using Arduino / Programming Questions / Re: Newbie here!! Starting a loop while its still finishing? on: May 15, 2013, 03:19:41 pm
It should be possible to do it completely with that technique, split your period into 6, then do it as:
1 ON, 2 OFF, 3 ON
1 ON, 2 OFF, 3 OFF
1 ON, 2 ON , 3 OFF
1 OFF, 2 ON, 3 OFF
1 OFF, 2 ON, 3 ON
1 OFF, 2 OFF, 3 ON

If you set the outputs on each part it will always stay in phase perfectly
11  Using Arduino / Programming Questions / Re: ethernetshield ip address retriving on: May 15, 2013, 02:49:08 pm
The external IP shouldn't matter to the Arduino, you need the default gateway so that the Arduino knows where to send external requests.
12  Using Arduino / Programming Questions / Re: Newbie here!! Starting a loop while its still finishing? on: May 15, 2013, 01:35:59 pm
I'm not sure I understand what you are asking here. The time between calls to loop will be tiny (a few clock cycles so just a few microseconds).
While I appreciate you want to work it out for yourself a bit, some more clarity would be needed to allow us to point you in the right direction.
13  Using Arduino / Programming Questions / Re: Web server, How to make a simple button to reset a counter?? on: May 15, 2013, 12:05:06 pm
Please post your code.
14  Using Arduino / Programming Questions / Re: ethernetshield ip address retriving on: May 15, 2013, 11:39:02 am
2.29.30.0 is not a valid default gateway, it will be in the ranges:
   10.0.0.0        -   10.255.255.255
   172.16.0.0      -   172.31.255.255
   192.168.0.0     -   192.168.255.255
As these are the only ranges that are reserved for private/local networks. On your PC, when connected to the network bring up a command prompt and type in
Code:
ipconfig /all
This will give you information on all of the network cards active in your computer. Find your connection in the list and read off the Default Gateway address from there.
15  Using Arduino / Programming Questions / Re: Problem with files on: May 15, 2013, 06:57:40 am
You probably need to include the SPI and Wire libraries in your main sketch file.
Pages: [1] 2 3 ... 17