New answers tagged

0

All you need to program any ESP32 (Cam or not) is a serial interface. How you make that serial interface is up to you. Most ESP32 development boards have a USB to UART converter on them which you can use just like on an Arduino - keep the ESP32 you're using for the programming in RESET so it doesn't try and respond on the UART. You could also program the "...


0

Thanks for the help, this is my working code. I changed things to long, got rid of some long's, stopped passing variables, and forced number in sensorValue to be long. It now counts up and down were I set the potentiometer every minute. int analogInPin = A0; int analogOutPin3 = 3; long sensorValue; int i = 0; int a; long y; void sens(){ sensorValue = ...


1

You define i,y,i as global variables so there is no need to hand them over to different functions. They can be accessed and changed in all parts of your program. define instead of int y; change to long y; and change void inOut(int &i){ to void inOut(){ and remove return i;// Its a global var change the line unsigned long y = ((...


0

You could easily set the LED output LOW just before you call going_to_sleep(), and set it HIGH when going_to_sleep() returns. There would be two short periods where the LED signal would indicate sleeping but the processor is running: between the LED going LOW and the processor actually entering sleep; and between the processor waking and the LED going HIGH. ...


1

Doing something as complex as a HTTP request in an interrupt is a very very silly idea. Instead set a flag in the interrupt routine and examine that in the main loop() function to perform your HTTP request.


2

The IO doesn't require the clock to keep its current state. It only requires it to change state. There is no real external signal provided by the chip to indicate if its in sleep mode or not. However you could monitor the current consumption of the chip and when it drops below a certain threshold you can assume that it is in sleep mode.


0

After I waited to get my order on ebay. I managed to restore the bricked board. The issue was related to bootloader fail. either the producer shipped it without a bootloader or some kind of static discharge caused to erase or stop the booloader from working and that why windowws didnt detect the board. I used a converted cortex m3 to swd programmer debugger ...


0

Either set the watchdog to 8s, and setup the WDT interrupt. And deal with the fact that the MCU wakes up every 8s. You could have it go back to sleep, unless a button is pressed, or something. The extra power usage for these short wakeups is negligible in most cases. Or disable the watchdog right before sleeping, and enable right after waking up. And hope ...


-1

As I learned, It does not generate a .hex file for some board. If you change board in Arduino IDE it gives .hex file.


0

When you sleep the Arduino is locked up. So yes, the watchdog timer will time out and reset the Arduino. But, since you're in sleep mode, it's not so much a "reboot" as a "wakeup". The watchdog timer is one of the normal ways of waking up periodically to do things. If you want to use the watchdog for its other "anti-lockup" purpose then you will have to ...


0

Having a line from Arduino 1 to Arduino 2 to indicate that Arduino 2 should do something is sufficient. Simple way: a line that is an input on both sides with internal pullups turned on. Both sides monitor it. When Arduino 1 wants to write, it checks to make sure the line is high, then it makes its pin an output and pulls it low, and when done releases ...


1

void loop() { digitalWrite(redPin, HIGH); delay(250); digitalWrite(redPin, LOW); delay(250); } I'm not quite sure what you're after but this is shorter and would get you equivalent results. Since loop is going to repeat anyway, there's no need to repeat yourself inside loop. Per the comments, not that this is particularly useful... const int ...


0

Shouldn't the Com-Ports be independent? Not in the Arduino IDE, no. Basically the IDE is [expletive deleted] when it comes to using more than one board at a time. You're better off using a proper serial terminal program, not the "serial monitor" in the IDE. Something like Teraterm or Putty, where you can have multiple instances on different ports at once.


2

Include Guards only protect against inclusion of a header file multiple times within the same translation unit. This is important. If you include a header file (1) in a source file, then include another header file (2) in the same source file, said header file also including the previous header file (1), then the include guard will perform its function. ...


0

You added a / to the end of the Humidity and Temperature collections. e.g Firebase.pushString("Humidity/", fireHumid); Firebase.pushString("Temperature/", fireTemp); The firebase API translates it to an address https://testtesttest-bd679.firebaseio.com/Temperature/.json?auth=xxxx` as we can see in the output. I'm pretty sure the correct address ...


0

Ok, after a very long time, I have something new, I tried changing that Atmega328p to another, borrowed Arduino UNO, and it worked but than I plugged Atmega from that borowed one to my own and it wasn't working! It means that probably that 16u MCU is not working correctly, can i repair it somehow?


1

Your code written more complex, than it has to be, and you have much repeated code, that makes it harder to understand and change the code. So I will first describe, how to shorten and generalize your code. That will make it easier to implement new features, like invalidating a card after 3 wrong PIN entries. Handling the RFID cards: Currently you are using ...


1

1.initialize a global variable int failcount=0,MiFareCardMode=0; for reset put it in an if statement that checks fail count if(failcount==0) {reset code}``` in this piece of code increase the failcount number(line 195:200) also add an if statement to check which card was detected initialize a global variable to set the card status ...


0

If you upload to a SAMD board like the MKR boards or the Nano 33 IoT with Nano 33 BLE selected in Tools menu of Arduino IDE, the upload is executed and deletes the bootloader of the SAMD MCU. The problem is that bossac uploader doesn't check the chip, because it was developed only for the SAMD chips, but Arduino created a bootloader for the Nano 33 BLE ...


1

The if condition is causing the issue. When the global variable 'fade' reaches 240, upon entering the loop(), you are incrementing it by 15, making 'fade' = 245. So, the if condition becomes true and 15 is subtracted from 245 making 'fade' to be equal to 240 again. This keeps repeating and hence the value 'fade' variable is stuck between the values 240 and ...


4

The problem is that you add 15, and than if it's >= 240, you decrease 15, so it will not change (I wouldn't consider it haywire though). You can better use a direction sign. Below is only the relevant code (not the GPIO functionality). What it does in the loop is, in case up is true, it adds fifteen, otherwise it subtracts 15. When 255 is reached, it ...


Top 50 recent answers are included