Recent Posts

Pages: [1] 2 3 ... 10
I didn't get it yet, I just saw how it is displayed in a browser.
Software / Re: Quando IF sembra sbagliato...
Last post by Standardoil - Today at 04:31 pm
Corretto, maledetto correttore
It does not. The NULL terminator says when the stop reading the array. It is NOT sent.

OP, you MUST add the NULL terminator to the array. Best practices call for keeping the array NULL terminated at all times:
Code: [Select]
char recMessage[radio.DATALEN];   
    for (byte i = 0; i < radio.DATALEN; i++)
      recMessage[i] = (char)radio.DATA[i];
      recMessage[i+1] = '\0'; // Add the NULL

You have buffer overflow.

You should not reallocate your rcvMessage array for each incoming message - it may cause problems on the long run. You should reserve a global variable which is large enough to hold the longest expected message, and use that:

Code: [Select]
#define MAX_MESSAGE_LEN 30
char rcvMessage[MAX_MESSAGE_LEN]; //Global variable

void setup()
  //Cheers with beers

void loop()
  if (radio.receiveDone())
    memcpy(rcvMessage, radio.DATA, radio.DATALEN);
    rcvMessage[radio.DATALEN] = 0;
    Serial.print("Received: ");

But it would be even better if you could just process the data directly from "radio.DATA" since this would eliminate the need for an extra buffer and the work of copying the content.
There's no memory allocation issue here. The buffer is on stack. And you can't process the data directly because it's not null terminated.
Can you post a schematic of how you are powering down this module please.
I would like this to be as cheap as possible.
Provided that the stations are within range, it can't get much cheaper than using two bluetooth modules that are configured to power-on autoconnect.  About $6, no Arduinos needed, no extra LEDs either.
Software / Re: Quando IF sembra sbagliato...
Last post by SukkoPera - Today at 04:28 pm
Code: [Select]
(digitalRead(RES[0] == HIGH))
Code: [Select]
(digitalRead(RES[0]) == HIGH)

(E idem sul LOW.)
Thanks for the basic principles.

No.1) suggestion wont work as simply you are relying on the status of the machine not to change during power off. What if the machine is moved even slightly by hand during servicing for example. The stored count in the eprom would be as it was when the system was powered down and the machine in a different position.

Zero crossing... i cant find any examples or reference to it?

I appreciate i write the code and for a couple of days with a book and the web i think i've done pretty well so far, but as mentioned, im stuck with what functions to use to achieve the solution, so just looking for some friendly help to move on with the sketch.

Thanks anyway.

Displays / Re: OLED - leakage current on ...
Last post by david_prentice - Today at 04:25 pm
The I2C bus takes zero current when idle.
Most OLED controllers can be sent to sleep.
Which controller are you using?

As a general rule,   SPI or I2C devices take no interface current when not active.
For an SPI or I2C device to work properly it must be powered.    It can not implement 3-state without power.

Removing power from an I2C slave will mean that it starts to conduct current through the Bus pullup resistors.

Software / Re: [PROGETTO] PVControl - Sol...
Last post by zoomx - Today at 04:25 pm
Per il bug c'erano diverse soluzioni/implementazioni.

La prima che mi viene in mente è un ciclo while dove vengono controllate 2 opzioni, il contatore dei tentativi che deve essere minore di 5 (se il primo tentativo il contatore è a zero) e che la connessione non  abbia avuto successo tramite un flag che all'inizio è su false.
All'interno del ciclo fai la connessione e, se va a buon fine metti il flag a true (quindi userai un bool), altrimenti incrementi il contatore dei tentativi.

Il titolo è un po' fuorviante perché fa pensare ad un datalogger alimentato con un pannellino solare.
Deutsch / [OT] Online PCB Service
Last post by mde110 - Today at 04:25 pm
Ich habe den tollen Link der 1$ Aktion verwendet, anscheinend wurde der Thread auch gelöscht - ich finde ihn nicht mehr.
Trotzdem vielen Dank dafür.

Ich habe nun meine ersten Layouts für eine "professionelle" Leiterplattenfertigung erstellt und hätte da an die Erfahrenen von euch eine kleine Frage bzgl. Silkscreen/Bestückungsdruck:

Ich habe u.a. Standardteile der Eagle lbr verwendet und wundere mich nun, dass der Top-Silkscreen in das Top-SMD Lötpad mit rein geht.
Silkscreen ist lt. Seeedstudio Gerber CAM File tDocu und tPlace.

tPlace überlappt mit SMD-Lötpad (SOT23 Mosfet, Flash-Taster sowie die Kondensatoren):

Hat das so seine Richtigkeit, sonst kann ich die Teile ja nicht auf die Pads Löten wenn das Bestückungsdruck drüber liegt?
Die Umrisse der Bauteile (tPlace) hätte ich aber schon gerne.
Pages: [1] 2 3 ... 10