Thread: Computers Nerd homework
View Single Post
Old 10-14-2021, 09:40 AM   #40
stanleychief stanleychief is offline
Veteran
 
stanleychief's Avatar
 

Join Date: Aug 2002
Location: Kansas City, MO
Casino cash: $5286254
Quote:
Originally Posted by kepp View Post
I think the question is mostly answered in here already, but just an aside as to coding style...he needs to give useful names to his variables. Just saying x, y, z equals something makes it difficult to follow the logic, even in his own head.

Also (and I've never worked with this Arduino stuff), since he already is setting up the serial port for comms, will Serial.print work as someone suggested? Or will that output over the current serial port link?
Yep, Serial.print should work as well. I recommended Serial.println, which simply tacks on a linefeed as a convenience.

When doing Arduino programming and debugging, the serial line is how you write and read data from the device as it is operating. In essence, your IDE compiles down the C++ sketch file into a binary, uploads that over the serial line to the Arduino device, and then resets it. The reset makes it execute your code. The serial connection remains open, and any messages from the Arduino are sent across.
Posts: 1,193
stanleychief has just been standing around suckin' on a big ol' chili dog.stanleychief has just been standing around suckin' on a big ol' chili dog.stanleychief has just been standing around suckin' on a big ol' chili dog.stanleychief has just been standing around suckin' on a big ol' chili dog.stanleychief has just been standing around suckin' on a big ol' chili dog.stanleychief has just been standing around suckin' on a big ol' chili dog.stanleychief has just been standing around suckin' on a big ol' chili dog.stanleychief has just been standing around suckin' on a big ol' chili dog.stanleychief has just been standing around suckin' on a big ol' chili dog.stanleychief has just been standing around suckin' on a big ol' chili dog.stanleychief has just been standing around suckin' on a big ol' chili dog.
    Reply With Quote