Recent Posts

Pages: [1] 2 3 ... 10
1
Yes okay so that's absolutely not what i want.

In my C++ program i do something like this:

Code: [Select]


typedef struct {
    uint8_t sof;
    uint8_t cmdId;
    uint8_t payloadLen;
    uint8_t data[];
} serialCmd_header_t

typedef struct {
    serialCmd_header_t header;
    uint8_t data[];
}

void serialWrite(uint8_t *data, int len); {

    serialCmd_t *cmd;

    cmd = (serialCmd_t*) malloc(sizeof(serialCmd_header_t) + len);
 
    cmd->header.sof = 0xfb;
    cmd->header.cmdId = 0x1c;
    cmd->header.payloadLen = len;

    memcpy(cmd->data, data, len);

    int bytesWritten = write(m_fd, cmd, (sizeof(serialCmd_header_t) + len));

}




2
Deutsch / Re: Spannungsversorgung 230V -...
Last post by bire - Today at 10:22 pm
Hallo HotSystems,

ja, ich habe den Vorschlag ausprobiert (Metallgehäuse drum), wie Ihr es mir erklärt hattet, leider war das auch nicht zielführend...Es kann natürlich sein, dass ich das nicht richtig umgesetzt hatte, aber Du erinnerst Dich vielleicht, ich hatte ein relativ einfaches graphisches Schema gemacht, dass Ihr mir "freigegeben" habt. Ich denke, es hat alles gepasst. So habe ich das gemacht, leider -wie gesagt ohne Erfolg- das Einzige das "hilft" ist der "Batterie-Ansatz". Ich würde das jetzt doch schon mit einem Hutschienen-Netzteil umsetzen, da ich schon so viel Zeit reingesteckt habe.

Grüße
Christoph
3
Sensors / help with light meter
Last post by CaioLimaViana - Today at 10:20 pm
I was thinking of a project to detect light falls using a lrd, the project should feel sudden falls in the ambient light accompanied by darkness (because a sudden drop of light in a very brigth environment does not necessarily mean darkness) from there to feel the sudden fall of light accompanied by darkness must await the return of the light for a maximum of 5 seconds, if it remains dark should turn on a led.

the design should only feel sudden drops of light so that walking from a light to dark environment should not turn on the led so little the sunset should activate it.
I would like help with the code.
4
It doesn't make much sense that 4 servos would be fine but less wouldn't work. My guess is that the wiring is bad somewhere. Can you post an accurate circuit diagram showing exactly what is connected where?

The servos should be powered directly from the battery NOT through the Arduino.

Steve
5
Programming Questions / RGB LED
Last post by padd99 - Today at 10:16 pm
Hi everyone, I have a question, related to rgb led, in my work I need to put two alternating colors, like the police siren, and I do not know how to do it, when I try, it makes a junction of the two, like magenta
Thanks.
6
Deutsch / Re: Spannungsversorgung 230V -...
Last post by HotSystems - Today at 10:13 pm
Ist das in Bild1 dein endgültiger Aufbau ?
Ich vermisse das MetallGehäuse.
Die Verkabelung sehe ich als sehr störanfällig.
Wackelkontakt sowie Störstrahlung.

Metallgehäuse wolltest du doch einsetzen.
7
Deutsch / Re: Verzögertes ausschalten mi...
Last post by Katsumi_S - Today at 10:12 pm
Bitte nicht - schalten. Du hast + durchgehend an der Schaltung. Wenn die Zündung aus ist, wird die Spannung am CAN-Bus auch sinken. Vermutlich auch irgendwo Richtung 0 also Minuspotential. Plötzlich liegt am Arduino wieder ein wenig Spannung an. Ob das reicht das der rennt ist fraglich, aber nicht ausgeschlossen.
Da würde ich eher sowas oder sowas ähnliches vorschlagen:



Gruß, Jürgen
8
hi every one what if we used a push pull B class amplifier using two complementary transistors such as 2n3904 and 2n3906 and feed their common bases through a 120 ohm resistor will this give us a good amplification of the audio signal if their vcc was same as arduino mega 2560 (which is 5v) ? do we need to put a resistor before the speaker to reduce current to protect speaker and stay within the transistors allowable IC current? please advice on this?
9
Wouldn't doubling the voltage halve the current though?
Very unlikely. If you somehow had a load which absorbed constant power then it would. But in most real world cases if you're turning something twice as fast that requires more power and it may easily be more than double the power. It certainly is with propellers where the power required is proportional to the cube of the rpm. Which is why I asked what the motor was driving.

Steve
10
General Electronics / Re: LM2679 power supply
Last post by alex_fagard - Today at 10:11 pm
You are confused by thinking that wide traces are for current carrying capacity - whereas reducing
stray inductance is usually the more important reason, especially in switch-mode stuff. 

Wide as fits, plus a groundplane is what to aim for in a switch-mode supply.   General power distribution
traces should be wide for low inductance too, especially between the load and the decoupling for it.

Wide trace = low inductance,
wide trace over groundplane = lowest inductance.
I read an article from maxim on layout for switch mode power supplies and it echoes what you are saying. it also seemed to discourage using a large groundplane, and instead, stated:

it is best to have the grounds for the reg, output, and input caps short and wide, and isolated from the grounds for the analog stuff like the resistor divider.

https://www.maximintegrated.com/en/app-notes/index.mvp/id/2997
Pages: [1] 2 3 ... 10