• ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
  • ×
    Information
    Need Windows 11 help?
    Check documents on compatibility, FAQs, upgrade information and available fixes.
    Windows 11 Support Center.
  • post a message
Guidelines
Seize the moment! nominate yourself or a tech enthusiast you admire & join the HP Community Experts!
Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
HP Recommended
Multiple
Microsoft Windows 10 (64-bit)

So I am a student instructor for a university and we teach an introductory course in programming for engineering students. We have chosen to use little robots made with Arduino boards as a way to keep them interested in the class, and we hand out Genuine Arduinos to them so that they can do their homework at home.

 

The reason we have Genuine Arduinos that cost almost twice as much as a knock off brand is because Macbooks don't have driver support for the cheaper boards USB chipset.

 

Well we are now entering the 4th week of classes and homework is starting up. I have discovered that several of my class are having difficulty with getting correct functionality from their code they have written. The common denominator as all of the students having problems have HP laptops.

 

Here's what is happening and where I've traced the probelm to:

 

In Arduino when you want to have a user enter values for problems and stuff, you have to prompt the user to enter a value and tell the Arduino to wait for something to be in the Serial Buffer. This is normally easily done with a while(Serial.avaialble() == 0); command and then the Arduino can parse the incoming data. Serial.available() simply returns a true or false value depending on if there is something in the Serial Buffer.

 

The problem we are having is after information is sent to the Arduino the Serial Buffer is not empty, which means there is data being sent to the Arduino when there shouldn't be and it is causing problems.

 

Take the following code snippet:

*************************************

int x, y;

 

Serial.println("What is your x value?");

while(Serial.available() == 0);

x = Serial.parseInt();

 

Serial.println("What is your y value?");

while(Serial.available() == 0);

y = Serial.parseInt();

 

***************************************

 

This should prompt the user for two values x and y one after another. But on the HP laptops when you enter the first value it skips the prompt for the second value. I have discovered that this is because after entering the first value and parsing the data, Serial.available() still returns 1 when it should be returning 0. Even using a Serial.flush() command that should clear the buffer back to 0 the Serial.available() command returns a 1.

 

This means that students with HP laptops are unable to communicate properly with their boards over USB. This also means that for some reason USB ports on HP laptops are sending information over USB when they shouldn't be. I suspect this is a driver issue of some sort, but they all have different models of HP laptops and most of them are newer models.

 

Does anyone have any experience with this sort of issue that might be able to help me out? I have a temporary solution for the students to do their homework, but I'd like to provide them a better expereince.

 

Archived This topic has been archived. Information and links in this thread may no longer be available or relevant. If you have a question create a new topic by clicking here and select the appropriate board.
† The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the <a href="https://www8.hp.com/us/en/terms-of-use.html" class="udrlinesmall">Terms of Use</a> and <a href="/t5/custom/page/page-id/hp.rulespage" class="udrlinesmall"> Rules of Participation</a>.