Recent Posts

Pages: 1 ... 6 7 [8] 9 10
72
Code: [Select]
SoftwareSerial serial1(8, 9); // RX, TX
So, you connected a serial1 to the Arduino? Why are you not using names that make sense?

Code: [Select]
port.open("COM4");
//set baud rate match that of the transmitting device
port.set_option(asio::serial_port_base::baud_rate(9600));

Most people set the options first (and there are LOT more than that that need to be considered) and THEN open the port.

Code: [Select]
std::cout << "Received: " << readLine() << std::endl;
If you don't care what was sent, why send anything specific, like "55.134~"?
73
Deutsch / Re: Schnäppchen ProMini unter ...
Last post by uwefed - Today at 09:06 pm
Oder was meinst du, warum Kunden in bestimmten Ländern nicht mehr beliefert werden?
Italiener halte ich für nicht so problematisch in der Kunden-Verkäuferbeziehung. :D  :D
Viele Verkäufer liefern nicht nach Italien. Das ist aber wegen einer Zwangspause beim italienischen Zoll, sodaß Lieferungen mindestens 6 Wochen brauchen.

Grüße Uwe

74
Deutsch / Re: LED-Laufschrift
Last post by agmue - Today at 09:05 pm
Mein Lieblingslink: http://parola.codeplex.com/ mit einem Video hinter Launch in another window.

Ein bischen was von mir: http://forum.arduino.cc/index.php?topic=301621.msg2101411#msg2101411

Hardware und Programmbibliothek müssen zusammenpassen, sonst stimmt die Orientierung möglicherweise nicht!

Von Thomas habe ich keine Rückmeldung erhalten, hoffentlich hilft es Dir.
75
Project Guidance / Re: Compass project failure on...
Last post by Frostline - Today at 09:05 pm
Two points:-
1) You seem to have no pull up resistors on the I2C bus. You do need them. Look here at the results of not having them.
http://www.dsscircuits.com/index.php/articles/47-effects-of-varying-i2c-pull-up-resistors

2) It could be that the first program is doing some initialization of your compass module that the second program is not doing. This would explain why you get it working when you load one followed by another, but on a power down this initialization is lost and therefore just having the second program will not work.
As to point 1.  I 'think' the required resistors are built into the board the HMC5883L is on.  Not 100% sure though since my board is slightly different. See here.

I could be easily 100% wrong on that.  But I would think the problem with new data being stopped would happen all the time, not just on USB removal if it was an I2C issue lacking resistors.
And since the board does some type of voltage regulation(it allows 5v input for the HMC5883L which has a max input of like 3.6v per the datasheet) I do not know what value of resistors I would need.  Datasheet shows 2.2k from I2C to VDD but I don't know if that value is based on typical voltage of 2.5 or max of 3.6 or if voltage in this situation matters.

I think your point #2 is exactly right.  But I can't see what is different in the magsensor code from my compassBeta code other than a bunch of serial.prints that I don't want/need.  Which is why this thread started.  I basically know magsensor does 'something' I did not copy to compassBeta.  I just don't know what that 'something' is.
76
Displays / Re: connecting ampire AG240128...
Last post by olikraus - Today at 09:05 pm
Hi

Why dont you use the information from the web site?

1   VEE       Negative Power Supply (-20V)
2   VSS       Ground (0V)
3   VDD       Logic Supply Voltage(+5V)
4   VO       Contrast Adjustment
5   /WR       Write data when WR = L
6   /RD       Read data when RD = L
7   /CE       Chip Enable
8   C/D      WR = L --- C/D = H : Command Write  C/D = L : Data Write    RD = L --- C/D = H : Status Read      C/D = L : Data Read
9   /RES       H --- Normal    L --- Initialize T6963C
10~17   DB0 - DB7      Data Bus Line
18   FS    FS : Pin for selection of font  H -- Font 6×8 (default)               L -- Font 8×8     
19   LEDA   LED back-light Power Supply + (4.05V)
20   LEDK   LED back-light Power Supply - (4.05V)
 
This is a classical T6963 GLCD. Several libraries are available for Arduino. However some may be outdated. U8glib should work with this display. Please check forum entries here. T6963 setup has been discussed several times in this forum.

Remember to connect FS to GND for U8glib. Also note that you need a 10K variable pot with wiper at V0, one end at GND other end at -20V. Adjust the varpot so that V0 has around -12 to -15V.

Oliver
77
Ok. I made an attempt at a software debounce, but I was feeding the raw button signal into the filter rather than the noiseified one, so it looked much better than it actually was.

With the fllter actually attempting to filter noise, it behaved poorly.

Looking at the way the filter output behaves, it seems to me that it's exactly wrong. When the output is high, a low bit has a dramatic effect on the next state - much more so than when the state is low. This is kinda backwards. What we need is for the curve to be stickier.

A simple curve that's more sticky is simply a linear count of the most recent bits - a rolling average of the last N samples. This, combined with hysteresis, will I think give a better result.

A word has 16 bits. The count of bits in a word is four bits long. So it seems that we can only count 7 samples and have enough room for the history, the rolling average, and the hysteresis bit.

So I can put the rolling average in the high nybble, the hysteresis bit somewhere in the next nybble, and store the most recent 7 samples in the low byte of the word.

The algorithm t maintain a rolling average on receiving a data bit is:

left-shift the bottom byte by 1.
put the data bit in bit 0.
if bit 7 is high, subtract 1 from the top nybble.
if bit 0 is high, add 1 to the top nybble.

So given a 'state' variable and a 'data' bit:

Code: [Select]

word state;
boolean data;

state = (state & 0xFF00) | ( (state & 0x007f)<<1 ) | data;
state = state - ((state&0x0080)<<5) + ((state&0x0001)<<12);



we then do hysteresis. Let's say that if 5 of the most recent 7 bits indicate that the state should change, change the state.

Code: [Select]

state = (state & ~0x0100 ) | (state > (state & 0x0100 ? 0x2000 : 0x4000) ? 0x0100 : 0);


I'll code it up tomorrow and see what the result looks like.
78
Français / Re: Télécommander à distance l...
Last post by Laurent13 - Today at 09:01 pm
Ah oui j'oubliais... Dans l'idéale, la commande se ferait à partir d'une tablette ou d'un téléphone portable... Aie ça se compliqué ;-)
79
Français / Re: Télécommander à distance l...
Last post by Laurent13 - Today at 09:00 pm
Merci pour ta réponse,
Par petites dimensions, je pense à un cylindre de diamètre 5cm et d'épaisseur 5cm aussi... Si ça peut être plus petit ça serait encore mieux.... Après il faut que chaque récepteur puisse avoir une durée de vie assez longue pour pas changer la pile (bouton?) tous les mois...
Après ça fera un écran de trop grande taille par rapport à ce que je souhaite afficher avec ces LEDS...
J'ai regardé les systèmes que tu évoqués mais sans pouvoir trouver un système qui permet de déclencher l'allumage d'autant de LEDS de façon indépendante...
Maintenant je débute donc si tu as des liens à me proposer.... Je suis preneur
Merci
80
Software / Re: problema de compilación
Last post by gepd - Today at 09:00 pm
Haciendo una búsqueda rápida del error, encontré esto https://github.com/milesburton/Arduino-Temperature-Control-Library/issues/17 

Donde llegan a la conclusión de que el error está provocado por no usar la última versión de la librería.

Hubo un cambio en las últimas versiones donde pasan de esto:

Code: [Select]
uint8_t OneWire::crc8( uint8_t *addr, uint8_t len)

a esto:

Code: [Select]
uint8_t OneWire::crc8(const uint8_t *addr, uint8_t len)

intenta actualizar a la última versión, también hablan de un conflicto al tener instalado el IDE versión 1.0.5
Pages: 1 ... 6 7 [8] 9 10