Show Posts
Pages: 1 2 3 [4] 5 6 ... 68
46  Using Arduino / General Electronics / Re: eeprom- help on: July 21, 2014, 12:23:30 am
I have used this library:

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.
47  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:
48  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
49  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().
50  Using Arduino / Programming Questions / Re: Shuffle a char array? on: July 20, 2014, 07:07:07 pm
Like this:

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

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

Live example: (C doesn't have a native random(max) function so it's not exactly the same code)
51  Using Arduino / Programming Questions / Re: Serial not working on: July 20, 2014, 06:49:40 pm
Not sure because I never used SoftwareSerial but:
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).
52  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:

states[ random(4) ]
53  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.

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.
54  Using Arduino / Programming Questions / Re: Callback function to serial avaiable. on: July 20, 2014, 04:43:06 pm

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

Read this:

And also read about "Blink without delay", for non blocking code.
55  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..
56  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:


You see the pattern? If not, remove the zeroes:

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

   1        1
   1        1
   1        1
   1        1

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
57  Using Arduino / Programming Questions / Re: find value in long table. on: July 20, 2014, 08:36:40 am
58  Using Arduino / Programming Questions / Re: Using switch case on: July 19, 2014, 10:17:25 am return a char, not an int. so in the switch, use '1' instead of 1, etc. smiley-wink

Edit: sorry, return an int, but it will be the ASCII decimal value of the character that was received. Still, the solution is to use '1', or it's ASCII decimal value: 49
59  Using Arduino / Project Guidance / Re: Small Bluetooth Device on: July 18, 2014, 09:39:12 pm
Hello and welcome smiley

With a cheap BT module such as the HC-07 (search on ebay), you just need to power it with 5VDC and it will be detectable by your phone.

To configure it, the easiest way is to use a USB to Serial adapter: search ebay for "PL2303". It's a little tricky to install it's driver if you use Windows 8 64bits, so PM me if you have problems with it.

You connect the HC-07 to it ( RX to TX, TX to RX, VCC to 5V, GND to GND ) then plug into your computer, then you open the Arduino IDE's Serial Monitor (or any other Serial terminal) on the corresponding Port and at 9600 bauds, and send AT commands.

Default password is 1234, and here is details of the available AT commands for the HC-07:

Quote from: some chinese vendor
1, test communications
Send: AT
Return: OK
2, change the Bluetooth serial communication baud rate

Send: AT + BAUD1
Returns: OK1200
Send: AT + BAUD2
Returns: OK2400
1 --------- 1200
2 --------- 2400
3 --------- 4800
4 --------- 9600
5 --------- 19200
6 --------- 38400
7 --------- 57600
8 --------- 115200
9 --------- 230400
A --------- 460800
B --------- 921600
C --------- 1382400
Not recommended for more than 115200 baud rate, signal interference make the system unstable.
Set with more than 115,200 machine is unavailable, use microcontroller programming at higher than 115 200 in order to use this baud rate and re-issued AT command set low baud rate
AT command to set the baud rate, the next power to use without re-set, you can power down to save baud rate.
3, change the Bluetooth name

Send: AT + NAMEname
Returns: the OKname
Parameter name: To set the current name, the Bluetooth name to be searched. 20 characters or less.
Example: Sending AT + NAMEbill_gates
    Return OKname
    To changed bill_gates Then the Bluetooth name
    Parameters can be powered down to save, simply modify the time. PDA-side refresh you can see the Bluetooth name changed.
4, change the Bluetooth passkey

Send: AT + PINxxxx
Returns: the OKsetpin
Parameter xxxx: To set a passcode, 4 bytes, this command can be used from the machine or the host. The slave adapter or mobile phone pops up to enter the passkey window, then manually enter this parameter can be connected to the slave. Host with the master Bluetooth module with digital cameras, digital cameras from the machine, find the password of the camera pair, and then set up the White Bluetooth module, the master Bluetooth module can automatically connect the camera.
Example: Sending AT + PIN8888
    Return OKsetpin
    At this time the Bluetooth pairing password to 8888, the module at the factory default passkey is 1234.
    Parameters can be powered down to save, simply modify the time.

Note that you can also use your Arduino to configure it, but it's more work for you, I don't recommend it.
60  Using Arduino / Programming Questions / Re: PC Application for controlling Arduino on: July 18, 2014, 09:34:10 pm
It's fairly easy to write this kind of program with C#, try it smiley-wink
Pages: 1 2 3 [4] 5 6 ... 68