New answers tagged

0

gpo0 goes to ground to program the module


1

The problem was with the buzzer, somehow was a faulty buzzer, I've managed to replace it and the problem was solved. Thanks everybody for your time trying to help me!


5

I mean where would you expect it to print Hello World ... On the Serial Monitor, right? So first open it by clicking on the Serial Monitor button at the bottom of the code tab in Tinkercad. I tried your code and it works perfectly fine.


1

It is unclear to me, where you flashed what, so I will describe some basics. The Uno cannot act as a keyboard/HID device, since the microcontroller on it (the Atmega328p) doesn't have native USB capability. For connecting to USB the Uno has a USB-to-Serial chip on it (actually another microcontroller, the Atmega32u4 I think). So with the Uno you only have a ...


0

With the AccelStepper.move() function, you are setting the target position of the motor. Then you run the motor with AccelStepper.runToPosition(). But that is a blocking function. It will not exit, until the motor reached it's target position. So you just picked the wrong function from the AccelStepper library. Small adjacent about simultaneous action on ...


1

I'm later, but, I think you should redesign your python and arduino code, to make messages like "start up", "end up", and if message is "start *", hold that key, if "end *", release that key. This should work as intended. I will pin python and arduino code later here. (Also sorry for my english, i'm russian)


0

When I make a new (Uno-like) board, I test for shorts and opens with sketch that blinks each pin in sequence. @Gerben's suggestion to test the inputs as well makes a lot of sense for your application. Plus the basic ability to power up (working barrel-connector input & voltage regulator, working USB connector and USB communication) would another test I'd ...


0

I'd add a second Arduino to supply a HIGH and LOW signal to the Arduino being tested (to test the INPUT), and to verify that the tested Arduino can output HIGH and LOW. Testing inputs, outputs, and being able to upload you test sketch will catch the most common problems. Testing the regulator would be my next thing, but that also depends on whether you're ...


1

Both tavis and Edgar Bonet have hit the nail on the head, and Edgar has provided you with an excellent tutorial. You are unlikely to get this to work properly in the Tinkercad browser simulator because it runs at different speeds depending on the complexity of the code it is running. And the complexity varies when you press buttons, which throws the timing ...


0

Testing microcomputers is a very complicated task. In your case I would suggest writing some programs to do exactly what you are saying. Then let the students do the testing. When the class starts you have to teach them the basics, this will check the computers etc and also the test equipment on there benches. At the end of testing they will have knowledge ...


0

You can measure each one at the output of the port (where you plug a connecting-wire to the port). Measure from that wire to ground with your DVM. It should be either 0v or 5v, depending on whether the port is set LOW or HIGH. (Or it could be pulsing from 0v - 5v - 0v - ... , if it is one of the PWM ports and the port has been set to provide a PWM output.) ...


2

Your solution does not work, mainly because GPIOs are not intended to source current higher than a few mA. If you want the laser diode to emit a reasonable amount of power, you need to drive it with a transistor. A MOSFET-based low-side-switch would probably be the easiest solution. But note that you still need to limit the current, e.g. by using a series ...


0

AI as in reading sensor data and doing something with it is certainly possible, but full on AI is not possible with just an UNO. Full on AI requires large programs that learn and understand, mapping user inputs over a large period of time Etc. So, in conclusion not possible with UNO, but maybe with other boards.


4

tavis’ answer nailed down your problem: your program is completely unresponsive when it is blocked in the first while loop of the loop() function. Here I will try to give you some hints on how to avoid this situation, but first some general comments: if (pres_len < (unit_delay*3) && pres_len > 50) The threshold should be unit_delay*2, maybe ...


0

It depends on your expectancy. You will definitively not be able to make something even remotely sophisticated due to the limited resources and computational power. But for simple decision making there is a great article in the HackSpace Magazine Issue 8 for starters. On page 100 onward they describe how to teach the Arduino UNO when to turn on or off a ...


2

I don't actually know what a UART is UART (Universal Asynchronous Receiver Transmitter) is the technical term for the communication interface, which is called Serial in Arduino speak. It's often called UART, because that is more precise, since there are many different communication protocols, which also work serially (meaning transferring data bits one ...


2

It looks like the line : while (digitalRead(but) == HIGH) {} will capture the processor in a loop until "but" is pressed. So if you press the send button immediately after using "but" it might see that you pressed "send", but if you let the program loop get back to while (digitalRead(but) == HIGH) {}, then nothing can happen ...


1

So here is the deal (I Kinda Solved It) so I took apart a 9V battery pack with a flip switch in it..... soldered some wired to it and now it works perfectly...... haha but I would still like the know the reason why the rocker switch module doesn't work. the only thing I can think of is the Voltage or Amp passed from the Switch Module isn't enough to power ...


0

5[V] is ideal EMF(electromotive force) of arduino UNO R3. Since I stated "ideal" ,the actual EMF be slightly lower than 5[V]. In this instance , EMF can be assumed as voltage between GND and port of UNO R3 as ports are connected only by a wire.


4

As a minor addendum to Edgar Bonet's excellent answer, you could simplify your code further and save even more memory by renaming your files. In particular, instead of storing a list of character names indexed by Amiibo number and using those as the filename prefix, why not use the Amiibo numbers directly? That is, instead of your files being named MARIO01....


12

You have a huge switch...case here to decide the name of the file that should be played. This costs a lot of code space, but also data space, because every single literal string in this portion of code gets copied to RAM during initialization. There is no need to spend all this cost, as the file names have been assigned in a very regular fashion, so you can ...


1

Just a SWAG try switching from a UNO to a MEGA the code should work once the decelerations are fixed. What the compiler is not telling you is how much memory is actually used. You have the Heap and Stack etc.


0

The best place to start, is with the BlinkWithoutDelay example in the IDE. Once you master that concept, you may be tempted to start several different timers. With enough timers, your code will start to look like a bowl of spaghetti. Next, you could build a generic function which would help to reduce the "spaghetti code". I would favour an OOP ...


1

You have two problems Both of them is related to your power supply : 1st, max. Voltage requirement for your servomotor is 6 volts, not 9 volts 2nd، your batteries are weaker than servo's need. Your servomotor need 2.5 Amps. In the max. Torque. So, over-voltage and not enough current is your fault (According to 996R servomotor datasheet). Change your power ...


0

You can send an SMS using the Arduino GSM library. Here is a bare bones sketch that sends one pre-set SMS when it starts up, based on this tutorial: #include <GSM.h> #define PINNUMBER "1234" #define REMOTENUMBER "07123456789" #define TXTMESSAGE "System started!" GSM gsmAccess; GSM_SMS sms; void setup() { boolean ...


1

I encountered a similar situation where I accidentally set the baudrate to 8000 with the AT commands. Thankfully I remembered the baud rate I set, so I used PuttY to create a serial communication with the port with the weird 8000 baud rate and changed the baud rate back to 9600. The method can be found here: http://flower-platform.com/2015/12/16/esp8266-with-...


0

If you use default values in struct declaration, you have to define also constructors for setting specific elements: struct Amiibo { const char *aName{}; const char *ID{}; const char *AudioFileName{}; bool alreadyPlayed{false}; Amiibo() = default; // default implementation for default constructor Amiibo(const char* name, const char* id, ...


2

According to (MG996R)'s datasheet You must connect a 6 volts - 2.5 amps power supply for it's best performance (max. Torque) Maximum voltage of this servomotor is 6 volts And be careful, exceeding that voltage can be cause of some damage to it's control board Try 6 volts 2.5 amps power supply and if doesn't work maybe your servomotor's control-board is ...


2

remove all c3 to c10 capacitors of 22pf. This will increase sensitivity and will sense through 5 mm sheet also .


1

I got it. just upload blank code that is written when you start arduino ide.


0

so if i inputting the duration of the light travel from trigger to echo, i can find the distance?. will it work? That's the basic working principle, but you cannot do that with an Arduino. Light is too fast, resulting in incredibly small travel times. You need specialized hardware for that. And thats, what a Lidar sensor (or other Time Of Flight sensor) are....


1

So it turns out that I got a few things wrong. Firstly, I misunderstood the example code and made a mess of the bits to send to the MAX6921. To work out the correct mapping, I went and probed each pin of the IV-18 and noted the connection to the pins / outputs of the MAX6921 which gave me this table: BIT 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 ...


0

Consider taking on this project in sever steps. Some you might do now and other later if necessary First, accelerometers do not usually need alignment. But if accuracy and reproducibility is important, a project may benefit from finding any offset a single accelerometer may need and finding any magnitude adjustments between the three accelerometers. Using ...


1

The current structure with multiple if statements and on timestamp variable does only work, if you also check for millis()-then being smaller than the next interval. Otherwise the first if statement will always be executed. I think it gets easier, when you use only one if statement, but put the intervals in an array. In that if statement you can either use a ...


0

your else in that set of if's is causing only a single if to be possible to be true at any one time, and once the now-then line up, only the first one in the line-up will ever execute. remove the else from your if block. treat each if as its own thing. i.e. if(now-then >=0) { /* do thing 1*/ } if(now-then >=1000) { /* do thing 2*/ } if(now-then >=...


5

I don't know if the amperage is additive with each additional motor Yes, amperage is additive. the Arduino cannot handle over one amp but 0.24*5>1 That is correct. But the stepper motors should never be powered through the Arduino. You should connect a fitting power supply directly to the stepper drivers. That way the needed current flows past the ...


0

It would depend on which Arduino and what bootloader it's running. Generally MCUs have their pins in INPUT mode when they reset. Sometimes the bootloader will leave some pins configured for a particular mode by the some the sketch runs. E.g. the Leonardo seems to leave pin 13 set to OUTPUT mode. You usually want devices connected to your Arduino to have ...


3

I can't post comments. One difference is that the ATmega32 has JTAG; ATmega328P has not.


2

You forgot to put the parenthenses () after the name of the function changelights. They are there to declare variables you can use later in the code like that: void function(int a){ a+=1; return a; } To fix your error just change void changelights{ to void changelights(){ Keep in mind if you want to program C++ (which would be Off-Topic here, but you ...


1

There's not enough information to provide a general solution at this time. As chrisl rightly says, the 3D printers are expecting a connection from a host. That host connection depends on whether the USB-serial interface inside the printer is supported. These are typically FTDI or WCH (QinHeng) chips, and would need the appropriate system driver for each type....


1

Read a value through serial (what exactly is entirely up to you) to do the same job the button does now. Use Serial.read() to get that data, and Serial.available() to know if there is any data to read. How you generate that value on the PC to send through serial we cannot help you with, as that is outside the scope of this site.


2

Firstly, the 9V batery is going to struggle with driving two motors. Change this 9V battery out with another power source. As @timemage points out in his comment, you are using a PWM command on a non-PWM pin. For the Arduino Uno, the PWM pins are: 3, 5, 6, 9, 10, 11. Move the wiring and change the code so that it is using pin 9, 10 or 11 instead of pin 4. It ...


0

The value of the symbol 'A2' is an integer - it is an Arduino pin number. For an Uno, it is equal to 16. Are you maybe confusing the pin number, A2, with the value read from A/D channel 2? That would be the value returned by analogRead(A2) or analogRead(PIN_A2) as it has been #define'd. And even then, that value is also an integer between 0 and 1023, which ...


6

Its not as easy as you think. An Arduino will not be enough for connecting the USB of the 3D printer. The USB protocol is strictly divided into slaves and masters. A USB(us) has exactly one master, which totally controls, what the slave can do. The slave itself cannot do much of its own. Your 3D printer is a USB slave device. That enables a USB master (like ...


2

The Nano, like the Uno, has an onboard serial ↔ USB converter. If you can get a logic level serial from the Moxa, then you can use the Nano to convert that to USB: Load a do-nothing sketch in the Nano Connect the Moxa TX to the Nano's Tx through a 1 kΩ resistor, and the Moxa RX to the Nano's RX. Yes, the second step looks backwards. The reason is that the ...


2

You are correct. A2 is just a number (like everything in a microcontroller). We can look at the corresponding part in pins_arduino.h (a file defined in the variants folder of your used core and of your used board, for me: ~/arduino-1.8.9/hardware/arduino/avr/variants/standard/pins_arduino.h): #define PIN_A0 (14) #define PIN_A1 (15) #define PIN_A2 (16) #...


2

When you open or reopen the Serial port, the Arduino resets (depending on how you open it; some programs don't send the signal on DTR or RTS, which result in the reset). My guess is, that the stepper driver reacts to the Arduino configuring its pins for the stepper. Difficult to say, what exactly happens there. To mitigate that, you can add an external ...


0

A wiring diagram would help! But it sounds like you're powering your sensor from the Arduino's AREF pin. That is not the purpose of AREF; AREF is there for you to provide an accurate +5v or other reference voltage to the A/D convertor. You need to power the sensor independently from your 5v supply (and not through the Arduino either, because of the sensors ...


0

Is it possible to use Maix_Speech_Recognition for speaker-dependent voice recognition on Arduino Uno compatible boards? No. It's not. What part of Maix_Speech_Recognition should I modify to make it work on Arduino Uno compatible boards? Don't even think about it. The UNO cannot do anything even remotely like speech recognition of any form without adding ...


2

Short answer is probably. There is a voltage drop from base to emitter that is about .7 volts. But something still has to contend with the rest of the energy. You might try a different Arduino digital output on the chance that the balance of the processor is working as expected. I say probably because several things might have happened if the transistor ...


Top 50 recent answers are included