Show Posts
Pages: 1 2 [3] 4 5 ... 191
31  Using Arduino / Sensors / Re: I bought 5 digital rotary encoders. 1 interrupt. on: July 28, 2014, 09:36:20 pm
An alternative plan,  would be to connect the outputs of the encoders to a shift register,    and then simply read the shift register into the arduino and compare to the previous reading.   Don't use interrupts at all.   How fast does this thing have to respond,   and how fast to you expect to be twiddling the knobs ?
32  Using Arduino / Sensors / Re: MPU6050 Will Not Wake Up! on: July 28, 2014, 09:22:59 pm
The output you appear to see,  is just random bits,  because you are not actually communicating with the device at all.

The Uno and similar devices use a4/a5 for the I2C connections.    I don't think the Due does,   you need to check that instead of tryng random things,  I think the due has similar pin connections to the Mega.  Don't take my word for it.  look it up.

You need to run the I2c_scanner sketch  to verify that the I2C is actually communicating with the device.   If you don't get a response,  check the wirng,  check the voltage,   review the pull-up resistor issues.

The Due is a 3.3V device,   you need to consider that .  Different sensor modules will deal with that issue in different ways.

You need to get the I2C to work,  BEFORE  you worry about putting the device into or out of sleep mode.

If you want another chek that the I2C is working and the device is responding,   try to read the device register with the "who am i" value,   and check you get the correct value.  This will confirm that the device's i2c is working and also the hardware to access it's data registers is working. and also verifies that your I2C implementation on your arduino is working.

33  Using Arduino / Programming Questions / Re: Java send data to arduino. on: July 28, 2014, 09:14:54 pm
Quote
send a byte to arduino over internet (ethernet shield). Once arduino recieves byte it analyzes the first four numbers

How do you propose to find four number in a byte ?

There seem to be plenty of examples of how to use ethernet connections from the arduino.
34  Using Arduino / Programming Questions / Re: New to Arduino - help converting float on: July 28, 2014, 09:12:47 pm
Quote
ble_write(unsigned char *).

why would you assume this function only processes a single char at a time ?

If the function really did process a single char at a time,  it would use a single byte char argument,    not a pointer to a single char,  which would take two bytes.

It is much more plausible that the argument to this function is the address of the first element of an array of chars.
35  Using Arduino / Programming Questions / Re: How to find number of "rows" in an array of strings? on: July 28, 2014, 07:24:23 pm
Quote
because sizeof(myString) returns 8

sizeof(myString) returns 8,   because myString contains 4 pointers,   and each pointer is two bytes.

On the arduino,  a pointer is always 2 bytes.

Therefore,  if you want to know how many strings are in the array,     sizeof( myString ) / 2    will work.

But actually,  defining things the way you have,   the array will alway have 4 elements, it won't change.  So this question is somewhat pointless.

If you want to have some kind of array of strings which is dynamically variable length,   you'd have to approach the whole problem a slightly different way.
36  Using Arduino / Programming Questions / Re: int to byte conversion on: July 28, 2014, 07:13:51 pm
I'd go with the approach in reply #3  ( without the minor bugs ).

Each of your 12 output bytes contains either part of one of your input ints,    or else it contains the second part of one of the ints and the first part of the next one.

It would be possible to write a reasonably fast algorithm for this in assembler.
37  Using Arduino / Project Guidance / Re: Indoor Positioning system using Arduino on: July 28, 2014, 08:15:20 am
Drill holes in the floor on a 10 cm grid and bury an rfid chip in each one.   Your robot wanders around an detects the rfid chips at the usual proximity  - a few cm.      Your robot has a table of the locations of all of the unique rfid chip ID's.   Or consults such a table on a PC server using bluetooth or nrf2401D or whatever.   Location known.
38  Using Arduino / Programming Questions / Re: Unicode characters in Arduino on: July 28, 2014, 06:30:38 am
Code:
if(client.find("Δωδεκά")){

I am not sure how that piece of code will actually be processed.

The thing is,   the greek characters are going to appear as single bytes if ISO-8559-7 encoding is used,    and as three-byte codes in Unicode (  but those three bytes actually contain a two-byte character number ).

If you are trying to "match" that,   you would need to know what code scheme  the string you are attempting to match,  is encoded in.

If there is only one string you want,  I'd figure out what the actual bytes are,   and match that byte by byte.
39  Using Arduino / Programming Questions / Re: Unicode characters in Arduino on: July 28, 2014, 06:20:25 am
You are reading a web page from the internet  to your arduino ?    Or is your arduino serving web pages ?       What is the actual pathway of these mystery characters  between the internet,  the pc and the arduino ?
40  Using Arduino / Programming Questions / Re: multiple if or for loop with if inside on: July 28, 2014, 02:36:23 am
If those array[ ] items are going to be made "high" by switches or buttons or any kind of event happening,   then the quickest method is to keep track of how often these events occur,     and then in your loop which looks for occurences of the event happening,   look for the most popular events first.
41  Using Arduino / Programming Questions / Re: what is the difference between char and int and why can you not convert them? on: July 28, 2014, 02:29:27 am
Quote
I have read many many many books on pointers and chars and integers but it doesn't make sense

If you have actually read many many books on pointers and chars [ which I very much doubt ],  and you STILL can't figure it out,    then perhaps this really isn't for you,   and perhaps you should find another hobby.

Don't feed the trolls.



42  Using Arduino / Programming Questions / Re: Unicode characters in Arduino on: July 27, 2014, 10:31:21 pm
It is not clear from the OP's post, whether he is refering to problems with characters being sent to,  or from, his arduino.

If characters are being sent from the arduino,   then changing the setting of your display device on your computer will work.

If the problem is with characters being sent to the arduino,    then the problem is going to be with the font installed on the arduino's Lcd (  or wherever it is that the OP is seeing characters he doesn't want ).  If this is the case,   then changing display settings on the computer terminal,  or in the c++ preprocessor,  is unlikely to work.  He would need to somehow select or install an alternative font into his LCD module.

And, ISO-8559 is NOT  Unicode.    It is a now largely obsolete scheme for representing alternative larger sets of non-ascii characters within a single byte character scheme.
43  Using Arduino / General Electronics / Re: Foward and reverse op amp motor control.... on: July 27, 2014, 09:33:56 pm
You would need a +12V/0/-12V  supply,   for your scheme to work.
44  Using Arduino / Programming Questions / Re: Library Error --> " 'TwoServoAdapter' does not name a type ". on: July 27, 2014, 09:31:12 pm
Yes. Both the servos and the arduino will be grossly underpowered from 2 AA batteries.
45  Using Arduino / Programming Questions / Re: Unicode characters in Arduino on: July 27, 2014, 09:10:07 pm
ISO-8859-7  appears to be not Unicode.

It appears to be a standard which uses the full set of one byte numbers ( considered unsigned ) from 0 to 255.

Regular ascii uses the numbers from 0 to 127     and 128-255  represents characters in other languages ( which depends on which code page of the 8859 table you are using ).

This is sometimes refered to as 8-bit ascii instead of 7bit ascii.    As far as I know,   these will be transmitted through the serial hardware and software just fine.

As the previous post says,  the problem is with your display device and it's font,  not with Serial.   If you are seeing all that french accent crap,   your display device is displaying the byte codes 128-255 correctly,  however it is apparently assuming that they are from ISO-8559-1,   where the important number there is the 1,   which means page 1 of the standard  which is full of french and german accented characters instead of page 7 where the greek characters are.   The character that look like a greek beta is actually a german "ss" character.

Wikipedia has a useful explanation of this here : https://en.wikipedia.org/wiki/ISO/IEC_8859

and you can see that the first two bytes of your message are 0xCD 0xE7  which are displayed as a dotted capital I and a c with cedilla  from ISO-8558-1,   where you want  upper-case_Nu  lower-case-eta   from ISO-5889-7

Pages: 1 2 [3] 4 5 ... 191