Show Posts
Pages: 1 2 3 [4] 5 6 ... 68
46  Using Arduino / Programming Questions / Re: My EEPROM data kept resetting =( on: July 21, 2014, 09:15:48 pm
Hello,

You say you have the problem since you added the RTC... And then you say if you remove the code for the button, it works... So I'm a bit confused.

If the problem is your button code: How is your button wired? Are you sure you wired it so it reads LOW when pressed ?

Also, still about that button, you should debounce it properly: http://arduino.cc/en/Tutorial/Debounce

Or, as you are using many big delays, you should look into using interrupts to catch every button presses, because actually your code won't catch button presses while the code is delayed... Or yet better, get rid of those delays and use non blocking code instead smiley
47  Using Arduino / General Electronics / Re: eeprom- help on: July 21, 2014, 07:41:10 pm
No idea, I think that with an 16Mhz Arduino, speeds would be very similar, but I can be wrong.  smiley-kitty
48  Using Arduino / General Electronics / Re: eeprom- help on: July 21, 2014, 04:10:43 pm
If you are talking about Chip Select, then yes, in the datasheet they call it CE (Chip Enable).

And this isn't an EEPROM, this is Flash memory. Main difference is: with the EEPROM you can erase one byte, but with the Flash, you can't erase just one byte, you have to erase a whole sector (in the case of this chip, the smallest sector size is 4KB).

If you absolutely want an EEPROM, I doubt you will find one with a size greater than 1MB (but I can be wrong).
49  Using Arduino / General Electronics / Re: eeprom- help on: July 21, 2014, 12:23:30 am
I have used this library: https://github.com/LowPowerLab/SPIFlash

If you look at the provided example, you will see that when creating the SPIFlash object, it require optionally a manufacturer ID (but IIRC, in my case it didn't work without it no in fact it worked without it, it's just to make sure that the flash chip being talked to, is of the correct type).

For the SST25VF032B, the manufacturer ID was 0xBF25. I don't remember how I found this ID, I think it was somewhere in the datasheet.

Oh and I forgot to say, this chip must be powered by 2.7-3.6V (including the SPI). NOT 5V. So you may need level shifters, depending on your Arduino board.
50  International / Français / Re: boucle infinie et serial on: July 20, 2014, 11:22:00 pm
Bonjour et bienvenue smiley

Tu n'as pas besoin d'une boucle infinie, car loop() en est déjà une.

Regarde l'exemple "Blink without delay"

Ceci peut également t'intéresser: http://gammon.com.au/serial
51  Using Arduino / General Electronics / Re: eeprom- help on: July 20, 2014, 11:05:47 pm
I have successfully worked with a SST25VF032B, 4MB SPI Flash. It was cheap and easy to connect. There is also a 8MB version, the SST25VF064C. I can't suggest something else, because it's the only one I've tried and I'm still a beginner smiley
52  Using Arduino / Programming Questions / Re: Shuffle a char array? on: July 20, 2014, 07:20:03 pm
Sorry , forgot to say that you need to add a randomSeed just before calling random().
53  Using Arduino / Programming Questions / Re: Shuffle a char array? on: July 20, 2014, 07:07:07 pm
Like this:

Code:
char *states[] = { "Null", "Win", "Lose", "Accel" };

void setup()
{
    Serial.begin( 9600 );
    Serial.print( states[ random(4) ] );
}

Live example: http://codepad.org/2ji3b66O (C doesn't have a native random(max) function so it's not exactly the same code)
54  Using Arduino / Programming Questions / Re: Serial not working on: July 20, 2014, 06:49:40 pm
Not sure because I never used SoftwareSerial but:
Quote
Not all pins on the Leonardo support change interrupts,
 so only the following can be used for RX:
 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI).
55  Using Arduino / Programming Questions / Re: Shuffle a char array? on: July 20, 2014, 06:42:08 pm
Can't you just use random instead? Like so:

Code:
states[ random(4) ]
56  Using Arduino / Programming Questions / Re: reset static variable on: July 20, 2014, 06:33:06 pm
Not sure if that is what you are doing, but if you write in the EEPROM every loop(), the cells where this long is written, will be ruined very quick and it will fail to read from or write to it.

Quote
The EEPROM memory has a specified life of 100,000 write/erase cycles, so you may need to be careful about how often you write to it.

Maybe show your code so we can understand what you want to do.
57  Using Arduino / Programming Questions / Re: Callback function to serial avaiable. on: July 20, 2014, 04:43:06 pm
Hello,

You want to increase speed, yet you are using delays and while loop... smiley

Read this: http://gammon.com.au/serial

And also read about "Blink without delay", for non blocking code.
58  Using Arduino / Programming Questions / Re: reset static variable on: July 20, 2014, 04:37:55 pm
Why make it static if you want to change it's value? I don't understand what you want to do..
59  Using Arduino / Programming Questions / Re: Fonts on: July 20, 2014, 04:17:04 pm
I think I can help you

Take for example number 0. In ASCII, it's decimal value is 48. Now look in the font file, where it say "//48". Convert these hex numbers of this line, into binary, using the Windows calculator or whatever.

It gives this:

Code:
11111100
00000010
00000010
00000010
00000010
11111100
00001100
00010000
00010000
00010000
00010000
00001100

You see the pattern? If not, remove the zeroes:
Code:
111111
      1
      1
      1
      1
111111
    11
   1
   1
   1
   1
    11

Combine the first half with the second half, you got your 0, (rotated to 90° for some reasons) smiley-wink
Code:

    11111111
   1        1
   1        1
   1        1
   1        1
    11111111

Do the same thing for the 5 now, fix the "drawing" as you like, then convert back from bin to hex, tadaa it's fixed smiley-wink
60  Using Arduino / Programming Questions / Re: find value in long table. on: July 20, 2014, 08:36:40 am
What?
Pages: 1 2 3 [4] 5 6 ... 68