Show Posts
|
|
Pages: [1] 2 3 ... 17
|
|
2
|
Using Arduino / Programming Questions / Re: TEA encryption algorithm test vector
|
on: May 17, 2013, 08:15:11 pm
|
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: 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
|
|
|
|
|
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  the way I suggested: 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: 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!  Also next time please put all your code in code tags: [code][/code]
|
|
|
|
|
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
|
|
|
|
|
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 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.
|
|
|
|
|