Why is my Arduino Uno not receiving data and how can I fix it?

  • Thread starter Thread starter lcr2139
  • Start date Start date
  • Tags Tags
    Arduino Data
AI Thread Summary
The Arduino Uno is not detecting data, preventing the stepper motor from rotating as intended. The code snippet provided checks for available serial data but fails to execute the rotation function due to the serial port not being available. Possible reasons for this issue include incorrect serial port settings, the Arduino not being properly connected to the computer, or the wrong board or port selected in the Arduino IDE. To troubleshoot, users are encouraged to verify the connection and settings, and to test the behavior of the serial port using the provided Arduino documentation link. If the serial port is functioning correctly, it may help narrow down the issue further.
lcr2139
Messages
58
Reaction score
0
for some reason, my Arduino Uno does not detect data. I have it hooked up to an EasyDriver and a stepper motor. I would like the motor to turn and I am controlling it with the Arduino IDE.

void loop()
{

if (Serial.available() > 0)
{
Serial.print("data available");
int a = Serial.read();
Serial.print(a);
rotate(a, .1);
}
}
The motor is not rotating because the serial port is not available, but I do not know why. Can someone tell me the reasons why the serial port would not be available? How can I fix this problem?
 
Technology news on Phys.org
Can you duplicate the behavior of this example?

http://arduino.cc/en/Serial/Available

If so that eliminates some potential explanations. If not that eliminates some others.

I am assuming that web page is the correct place/version/etc/etc
 
Thread 'Is this public key encryption?'
I've tried to intuit public key encryption but never quite managed. But this seems to wrap it up in a bow. This seems to be a very elegant way of transmitting a message publicly that only the sender and receiver can decipher. Is this how PKE works? No, it cant be. In the above case, the requester knows the target's "secret" key - because they have his ID, and therefore knows his birthdate.
Back
Top