Hi @nagelc , thanks for coming back to me - Apologies I didn't realise you'd replied nearer the time.
Am I right in thinking, so long as I define the new patterns function later on in the sketch - I can include it in the switch of function updateLightPattern, and it will be added to the mapping?
How do we know what definitive figures the 0 to 100 percentage map to in 0 to 15? Or is that basic arithmetic and each switch state will be called in each 'chunk'. I also only count 10 items in the switch state. Does that mean we can add 5 more? and if wanting more than 15 simply change our mapping size to have more?
Appreciate the help.
void updateLightPattern(){
// global: curPattern, updatePatternDelay, lastPatternUpdate
unsigned long now = millis() ;
if (now > lastPatternUpdate + updatePatternDelay){ // check if time for update
switch (curPattern) {
case pAlarm: // flash light
patternAlarm();
break ;
case pFire: // wild fire
patternFire();
break ;
case pFire2: // cosy fire
patternFire2();
break ;
case pCandle: // flame
patternCandle();
break ;
case pCircle: // flame
patternCircle();
break ;
case pRainbow: // rotating rainbow
patternRainbow();
break ;
case pSinelon: // rotating rainbow
patternSinelon();
break ;
case pSolid: // do nothing fall through
case pOff:
case pOn:
default : // def
break ;
}
lastPatternUpdate = now ;
}
}
@patrick-schaerer can I use same code file for measuring current only using sct-013-030 and at other end I'll use other sensor to read ac voltage and with the help of that I'll calculate power.
I'm new on this. Just start learning and I'm using esp32 instead of Arduino.
Please share your suggestion on this. It will really help me to learn .
Hello all,
First things first - this is a great device, kudos to everybody involved!
I built a buggy nrf24Doctor - it wasn't measuring the current consumption at all ("xxx Err" message). Trying to fix it led me to refactor the - splitting it into smaller "components" and adapting the project structure to VSCode/platform-io (ArduinoIDE is not my cup of tea).
If someone is interested, the code can be found at github.
Regards,
L.
@henkoegema said in TinyBME - ATTiny85 + NRF24l01 + BME280/I2C:
@Wim-Oosterhof said in TinyBME - ATTiny85 + NRF24l01 + BME280/I2C:
I was attracted to the idea of having a wireless hum/temp sensor and so I built this. I prototyped it on a breadboard, and I also soldered it on a PCB. I extended the antenna with a 8.3 cm wire.
But I can't get it to work stable. Sometimes it works for many hours and sometimes only for one hour. And then it just hangs. A reset of the at85 sometimes helps, but most of the times I need to power it off and on again.
I need it to work reliably for several weeks. Any suggestions ?
Have you got any suggestions?
Did you get it to work stable?
Or have you abandoned the project?