Skip to main content
Search type Search syntax
Tags [tag]
Exact "words here"
Author user:1234
user:me (yours)
Score score:3 (3+)
score:0 (none)
Answers answers:3 (3+)
answers:0 (none)
isaccepted:yes
hasaccepted:no
inquestion:1234
Views views:250
Code code:"if (foo != bar)"
Sections title:apples
body:"apples oranges"
URL url:"*.example.com"
Saves in:saves
Status closed:yes
duplicate:no
migrated:no
wiki:no
Types is:question
is:answer
Exclude -[tag]
-apples
For more details on advanced search visit our help page
Results tagged with
Search options not deleted user 2926

The Arduino Uno is the most common of the Arduino boards. It is based on the ATmega328P microcontroller.

1 vote

One LED being constant and another blinking

Remember that the setup() function runs once, and then the loop() function runs forever. So to keep the blue LED light, simply turn it on, but never off. The code for the red LED remains unchanged. …
Kingsley's user avatar
  • 773
2 votes

Where to start?

It's sounds silly, but just get an UNO, a breadboard, wires, 1 resistor (220 ohm) and an LED. Wire up a LED circuit, and program the Arduino to flash the LED. (There's a million examples of this all …
Kingsley's user avatar
  • 773
1 vote

Arduino to breadboard with LM35 temp sensor

Check the baud rate of your serial monitor matches what you have set in your setup() function. In the above code that is 9600. If the baud rate is incorrect you typically get rubbish output in the s …
Kingsley's user avatar
  • 773
2 votes
Accepted

Arduino Uno rev 3 toggling a 230 V submersible pump on intervals

The Arduino will easily drive this relay board, and it needs only a very small input current. The board you linked to has a built-in optical isolation circuit, so there is no direct electrical connec …
Kingsley's user avatar
  • 773
1 vote

Controlling Arduino through MATLAB?

Do all the processing on the Arduino, and supply the results to Matlab over serial. I'm not 100% sure about your particular encoder, but generally encoders talk in "Grey Code". This is a series of b …
Kingsley's user avatar
  • 773
0 votes

Getting a random number for electronic dice

I've had better success with this version. I did not work out the problem with the first version. Although I did find the rear legs of the push-button were lighting up a LED - but only when pushed. …
Kingsley's user avatar
  • 773
1 vote

Bad LCD? Bad microcontroller? Or what?

These 16x2 LCDs are fairly sensitive about their power requirements. As a first step, I would check the VCC and GND wires are well connected, and closely connected on the breadboard near the LCD. If …
Kingsley's user avatar
  • 773
2 votes
2 answers
1k views

Getting a random number for electronic dice

I am making a "Electronic Dice". I have 7 LEDs to form the output, and this works fine. My problem is getting a random result on the output. int die_face = 1; void loop() { if (analogRead(BUTT …
Kingsley's user avatar
  • 773
1 vote

Having issues with Arduino + Bluetooth

Is the device on the other side of the bluetooth connection running at 9600 baud too ? You say you transmit the state of the sensor - which BTW is only ever a space ' ', and never changes. So that …
Kingsley's user avatar
  • 773
1 vote

Sending data from Arduino to the server where arduino (sketch) acts as a client

A simple HC-05 module will give you a wireless bluetooth connection. They're fairly simple to setup, and you can write data to them the same as one would the Arduino serial console. Obviously they c …
Kingsley's user avatar
  • 773
2 votes

How come my transistor doesn't work?

The program is fine. Looking at the first photograph - The Ground of the Arduino needs to be connected to the ground of your circuit. I do not understand the two-transistor part of your circuit, so …
Kingsley's user avatar
  • 773
1 vote

How to run TCP socket server on Arduino Uno WiFi?

I suspect these delays are caused by TCP buffering. For some theory on this sort of thing, perhaps read about Nagle's Algorithm which covers some of the issues with small packet buffering. It seem …
Kingsley's user avatar
  • 773
1 vote

How to update a text file dynamically

It's difficult to answer without details of how your server works. If your arduino is simply connected to the server, the server could open the arduino serial port (e.g.: COM5: or /dev/ttyUSB0) and s …
Kingsley's user avatar
  • 773
2 votes
Accepted

Unexpected behavior of sprintf with i32/u32

Ints and unsigned ints are 16 bits on AVR ATmegas. So while the argument passed is a 32-bit value, sprintf() is expecting a 16 bit value. The stack is packed with twice as much data as needed. From …
Kingsley's user avatar
  • 773
0 votes

What is better: one sprintf() or multiple strcat() and itoa()?

The sprintf() function has a memory cost because of the library import at compile time. But it only costs that once, no matter how many more times you use it. Unless you're running out of space, mem …
Kingsley's user avatar
  • 773