New answers tagged

0

The analogWrite function checks the PIN_ATTR_ANALOG attribute from pin description in variant.cpp to determine if the pin has DAC capability. Then it checks if the pin is ADC_Channel0 or DAC_Channel0. This is unnecessary and redundant. There is no other use for DAC_Channel0. In Arduino SAMD core and derived cores the pin 'map' in variant.cpp defines pin ...


1

As far as I can see, the relay will stay on when val is less or equal than 500, and stay off when val is higher than 500. However, there might be a problem when val keeps fastly moving around 500; it will switch on and off quite fast. To prevent this, you should make two 'triggers', e.g. turn it on when the value <= 480, and turn it off when the value >=...


0

I didnt try this method but; when i check the data sheet, i found this code on last page: sbit ADDO = P1^5; sbit ADSK = P0^0; unsigned long ReadCount(void){ unsigned long Count; unsigned char i; ADDO=1; ADSK=0; Count=0; while(ADDO); for (i=0;i<24;i++){ ADSK=1; Count=Count<<1; ADSK=0; ...


0

According to library, hx711 sending pulses to mcu and we are scaling with take this pulses. I think you must connect DOUT and SCK pins directly to the MCU or you must counting pulses via I2C after all create a scaling value according the library code and send it to mcu.


0

First this should be like this: float* values= mq2.read(false); //false and then write this to be printed in the serial monitor Serial.print('\n'); Serial.print("LPG:"); Serial.print(lpg); Serial.print(" CO:"); Serial.print(co); Serial.print('\n'); Serial.print("SMOKE:"); Serial.print(smoke); Serial.print(" PPM"); Serial.print('\n');


Top 50 recent answers are included