New answers tagged

0

Since no one has posted an answer, and I finally found one myself. Ground pin 10 for 6 seconds.


0

There are many possibilities, although it depends on the amount of data, and if there should be a master, about the certainty that messages will be received and other parameters. You can use (among many other possibilities: CAN bus, but you have to have a CAN shield (or similar components), SPI with slave selects to different Arduinos, and RS232 for the ...


0

I took a look at the FabioCuomo-DS3231 library, as I guess that is what you are using, and I saw nothing related to setting those two bits. However, you can take inspiration from the code in the library to implement the functionality yourself. I would try this: void enableAlarmInLowPower(void) { // Read the control register. Wire.beginTransmission(...


0

I think I may be able to help clarify things a bit here: You are not trying to "flash" the ESP01 (the kind you have) board, but you are trying to talk to the AT command firmware it came installed with. Also, there's a sort of pingback sketch (I forget the name and can't find it, but it basically uses a SoftwareSerial and copies characters from one to the ...


0

I commented: Test from highest to lowest. When you find one ON, and save it and quit. @alirazi asked: How can I do it? I will appreciate a script Here is code to find the highest numbered ON switch: uint8_t switchPins[] = { <pinnumber>, <pinnumber>, ... }; uint8_t i, highestOnSwitch; for( i = sizeof(switchPins)-1; i >= 0; --i ){ ...


0

What you can do with pin D7 is to set it high or low. High is when you will have either 3.3V or 5V depending your arduino board, and Low is basically 0V ish. And to do both of these, you can simply write: digitalWrite(pin, value) check this out (link) I hope it answers!


2

your updateDirection logic doesn't quite work the way you think it does. after a bit of code formatting and comments it looks like this: void updateDirection() { if (distanceInchR < minDistanceInch && distanceInchL < minDistanceInch) { if (movement != BACK) { backUp(); } else if (distanceInchR < ...


0

As a general rule, you should avoid repeating yourself whenever you can. Thomas Weller showed you how to avoid repeating the LED handling code by using an array: int leds[] = {8, 7, 6, 4}; This is a data structure that your program can loop through, handling the repetition itself. In a way, you are converting redundant code into data. This is a really good ...


0

The stepper motor 28byj-48 seems to be a 5V motor (datasheet). I've seen it being used with a A3967 driver, which means that it does not draw more than 750 mA of current. I'll go with the length you mentioned in the comments: for this example lets say 3m The rest is Physics: the resistance of a wire is R = p * l/A where l is the length of the wire and ...


1

//is this right?? counter = digitalRead(buttonPin); No. Just remove that. It will change your counter to either 0 (low) or 1 (high). it doesn't seem to work: It's because all your comparisons are actually assignments: if (buttonState = HIGH) [...] if (counter = 3) [...] For comparisons, you need two equal signs like ==. Another issue: your LEDs will ...


1

I cannot see, how your code would show the described behavior (assuming that, you have connected the buttons correctly with a pulldown resistor). But your code can be greatly simplified, which would make it less error prone. You have 8 buttons, which screams for the usage of arrays (IMO you should always use arrays, if you have more than 2 or 3 equal ...


0

So based on the information you provided I understand that the issue is that both the if(switch1state==HIGH) and the `if(switch2state==HIGH)' statements evaluate to true if either switch is flipped. That means one of the following things is happening: 1) Somewhere in your code you're mixing their values and assigning ones value to the other 2) Your ...


0

If it helps, I tuned your code little. const int dirPin = 8; const int stepPin = 7; const int enPin = 13;//with pin 13 You can monitor on-board LED, if its lit, "enable" is HIGH and stepper will turn. const int rightSensorPin = A0; const int leftSensorPin = A1; int rightSensorRead = 0; int leftSensorRead = 0; int rightLightPct = 0; int leftLightPct = 0; ...


0

Rather than trying to send your own GET/POST request by hand coding it, use https://github.com/arduino-libraries/ArduinoHttpClient which does it all for you.


-1

If you configure the esp as an access point then it should also be the DHCP server and be supplying ip addresses to it's clients. Only if you configure it to be a client station itself (eg. connect to your router as client) will it be assigned an ip address.


1

They are not poorly described. All capacitors need to be put from the VCC to GND directly (this will not cause a shortcut). The left 3 are related to the motor; as it uses a lot of current, it can take the current from the capacitors instead of flowing all the way to the power supply, causing problems of a voltage reduction that can cause other components ...


1

My version of the data sheet has a flowchart (Figure 10) for doing a "read-modify-write". In there is a clue - there has to be a dummy read before the actual read is done. Here is my function for plotting a pixel, which requires a read-modify-write to add a pixel to the existing data. It's not clear dummy read is needed before every byte read, or just on ...


0

Try to not use serial port - use an ADC :) You may need to amplify the signal from photodiode with some transistors or opamp. So, you convert the light intensity level to numbers!


4

To check if you really cannot upload anymore (assuming it's not a software error), try the following sketch https://www.arduino.cc/en/tutorial/blink This will blink the BUILTIN led. There is very low chance to wore out your memory, you can write lots of times to it (like 10,000 times guaranteed, in practice mostly more). But there can be another ...


0

Start with the Liquid Crystal, HelloWorld, Example. Find out if it's your pin configuration or pot/no pot issue, or if you have a doofed LCD. Some LCD 1602 have an on board pot, so make sure that's not there too. Process of elimination.


3

A brush DC electric motor and many other similar devices will produce random noise as well as uneven power demands and should be powered independently of logic circuits such as processors and LCDs. It is very difficult to mediate noise sources and almost always better to remove them from where they are causing harm or unexpected results. It is also ...


1

As others have mentioned lookup tables are the way to go if you want speed. I've recently been investigating computation of trig functions on an ATtiny85 for use of fast vector averages (wind in my case). There's always trade off's...for me I only needed 1 deg angular resolution so a lookup table of 360 int's (scaling -32767 to 32767, only working with int's)...


2

It turns out the problem was the A2 pin on the board. When I used the A0 pin (or a different board) the problem goes away. I realised something was wrong when I noticed the values from the pot were strange (I expected values in the range 0 - 1023, but was receiving values from 170-250 ish).


0

Step 1) Upload software serial from example and send AT, you should get reply as AT OK if your connections are correct. Step 2) Once your connections are correct and if you are uploading the given code then make sure you put your SSID, password, and Server IP which would be the three Strings: HOST, PATH and PORT. You could alternatively check your server ...


0

The solution is to always use at least 2 electrodes. You need 1 electrode, that you connect to ground. You can put this electrode to somewhere neutral (this instructable suggest connecting it to your leg, but I don't know, if that position is really good). An ADC measures voltage and voltage is the difference in potential between 2 points, so to measure ...


1

The String+ operator is very expensive. High likely what it does is: Create a new block of memory to accommodate the old string content and the to-be-concatenated text. Copy the current String to a new string location Concatenate the string Free the old memory Besides creating memory gaps which can be disastrous for the just 2 KB SRAM of the Arduino Uno, ...


1

As you wrote, that you connected the positive pins of ENA, DIR and PUL to 5V, I guess you use the common anode connection scheme from the DM542's datasheet (the driver seems to have optocouplers for the inputs). That would mean the inputs are active low (a Pulse would be a transition from HIGH to LOW and then back to HIGH). GRBL v1.1 has by default an ...


0

Step 1) Check RX TX connections Step 2) Change your baud rate to 115200. Turn off your arduino. Turn off gsm. Start your gsm first and then your arduino. or Step 3) Upload Software Serial code and just send "AT" without quotes using serial monitor. If your connections are correct you should get reply as AT. Also make sure to set the baud rates to 115200. ...


0

Got the required trace logs at the output. All I had to do was enable PSRAM in tools.


1

The usual Firebase library for esp8266 is https://github.com/FirebaseExtended/firebase-arduino. And there is some new Firebase library in Library Manager in IDE. The "More info" link leads to https://github.com/mobizt/Firebase-ESP8266


1

It's very related to the debounce algorithm (used for debouncing switches/keys), but consider a button 'bounce' as a cry. The time is much longer (seconds, to even minutes). See here the debounce explanation: https://www.arduino.cc/en/tutorial/debounce As soon as the baby starts crying, you want the LED to be turned on (almost) immediately, so use a short ...


0

There can be different reasons for your issue. But from the update you added later, we can at least say that your Arduino sometimes doesn't receive the character "1". And when that happens, your Python gets stuck in the infinite loop of trying to read something from the serial port. As your Arduino responds with "1" when it receives "1", you can base your ...


2

The problem is with the 2 pins on the very right pf the LCD display, those that are marked with LED. On this simulated LCD board the background LEDs pins are directly accessable from the outside pins, so the LED is connected directly to these pins. Every LED needs a current limiting resistor, or it will be fried by the excessive current. Add a resistor of at ...


1

you might have noticed that there are spaces for analog pins on the shield. All of those are free so you can connect your ultrasonic and IR sensor there. Talking about digital pins, some are free but some are not. So it is better to use the free analog pins instead of bothering about digital pins unless necessary. And your sensors will work fine on those ...


1

When a microcontroller or a computer is powered on, it always does something. A program on a computer will return and the OS will run again. On a microcontroller there is no OS to return to, so every microcontroller program has an infinite loop. The void loop() function of the Arduino framework is such an infinite loop. If you want your LM35 temperature ...


0

Actually, it already did something when you turned it on when you got it: it was blinking a LED. It did not mean it was connected. A microcontroller (or controller) always does something. Although you can consider an empty endless loop as 'nothing'. And now you overwritten that sketch with your LM35 sketch. However, you can put the Blink sketch again in ...


1

In case anyone has the same problem, I solved it. Turns out is was a bad PSU. Buying a new, higher quality one made everything work. So the issue was high ripple I suspect, or at least high enough when applying some load (which is why I noticed that things got worse after the fans started spinning at greater than 20% duty cycle) for the temperature sensor to ...


0

"LCD is supplied more than required current". That's not usually a thing. Most devices draw as much current as they need, no more, assuming you feed them the correct voltage. If you give them higher than the specified voltage, that pushes too much current through for the level of resistance they offer. So as long as you feed them a regulated supply at their ...


0

It depends on what voltage the devices run at and what their current draw is from the power supply versus what voltage & current your power supply provides. If everything runs at 3.3V or 5V and minimal amps then you're good to go. Read the datasheet for each device and for your power supply.


0

Literally spent hours painstakingly chasing same problem. Complained bitterly to supplier that board refused to respond or operate when received. They responded by trying to tell me I had no clue about how to connect, but eventually agreed to send replacement after I proved had connected correctly, while waiting for replacement came across this post, went ...


0

Since you mention you operate on a battery (standalone), what exactly do you mean by "the database"? Do you have online connectivity? Do you have any peripherals like an sdcard or other storage? In case you don't have a permanent online connection, you would need to use some writable memory (like EEPROM) to store your data in some organized form. Since the ...


0

Edit: Forget the post above if you just want to know how your board is working. Your board is a retired Spurkfun product - clone. Here you can see the schematics and all info about your board: https://learn.sparkfun.com/tutorials/retired---using-the-logic-level-converter Original post: The module you got, use the BSS138 MOSFET. The circuit is easy, and ...


0

The Arduino IDE uses the C and C++ programming languages. Some string comparison basics using C: In the C programming language, a string can be thought of as an array of 8 bit values. One way to compare two strings is to compare each 8 bit value and consider the strings different (not equal) upon finding the first not-matching 8 bit value. Here is an ...


1

Since you have already tried SoftwareSerial, also try inverting the serial protocol via SoftwareSerial. Sometimes a device uses inverted serial protocol and you don't know it. So initialize inverted add 1 to the end of the contructor like so : SoftwareSerial mySerial(RXPIN, TXPIN,1); // RX, TX, inverted


0

No, you're not doing anything wrong. Those simple MOSFET level shifters work by having both sides pulled up by resistors to their respective power supplies. When one side gets pulled low by a digital signal that LOW is mirrored to the other side of the MOSFET. If you connect your TX0 pin to GND you will see the TX1 pin go to 0V.


0

You could periodically store the date and time in the battery-backed SRAM in the DS1307. Every few seconds, once a minute, something like that. Upon sketch start, perhaps in setup(), read the current RTC time, compare to the stored time, if the current time is later than the stored time, you can do the math and see how long the Arduino has been down. Or use ...


1

There is not enough context to be certain, but given the variable names I can assume that this is code from a sketch that receives information from an RC controller and is intended to control parts of some form of flying craft. So with that in mind, let's take this line: flapmag=(pwm_value-880)/41.0+10; I assume that this is to calculate the amount the ...


0

In my opinion, the easiest way for the beginner is to use Platformio, it sets up CLion project automatically. See docs for more info.


0

Put the stuff before setup() together, fix any duplicates: int mamank=13; <<< pin assignment? If yes, this can be byte int red=2; <<< pin assignment? If yes, this can be byte int green=3; <<< pin assignment? If yes, this can be byte int blue=4; <<< pin assignment? If yes, this can be byte Put the stuff in setup() ...


0

Did you add your libraries to the cmake files? I don't have any experience with CLion but undefined reference normally means that the linker couldn't find the function/class your are using. So make sure the libraries are compiled and the linker knows where to find the object files.


Top 50 recent answers are included