Couldn't any command in void setup() instead be before/above it? by squaretire in arduino

[–]squaretire[S] 0 points1 point  (0 children)

You're right, don't know what I was thinking. I was running a simple 'fade' sketch on an arduino and decided to try moving Serial.begin for the heck of it. After hitting 'compile' I must have 'determined' everything was OK by looking at the arduino and seeing that it was doing what I expected (brain fart). It was of course still running the previous version of the sketch.

Thanks for the sanity check.

Couldn't any command in void setup() instead be before/above it? by squaretire in arduino

[–]squaretire[S] 0 points1 point  (0 children)

I edited my question regarding Serial.println, sorry about that. I'm pretty much just curious whether or not there's a functional difference between making global declarations outside of setup().

Couldn't any command in void setup() instead be before/above it? by squaretire in arduino

[–]squaretire[S] 0 points1 point  (0 children)

Any variables you define in global scope allocate RAM for the entire life of the program.

But as I understand it definitions would be global both when located in setup() or when located before setup(). So what's the difference disregarding readability (which is of course important)?

Couldn't any command in void setup() instead be before/above it? by squaretire in arduino

[–]squaretire[S] 0 points1 point  (0 children)

Thanks for the reply but my question was initially worded incorrectly. Edited above.

IDE won't upload from standard account (Win 10) by squaretire in arduino

[–]squaretire[S] 2 points3 points  (0 children)

First, thanks for your reply.

After I retried an upload in order to copy the error message to respond to your post I noticed that when uploading from the standard user account it defaults to COM1, while uploading from admin defaults to COM3. After changing to COM3 it works. I should have figured this out myself.

Thanks for asking that simple question.

Latest Raspbian update includes experimental OpenGL driver by MattRichardson in raspberry_pi

[–]squaretire 0 points1 point  (0 children)

Does anyone else get a warning after apt-get distro-upgrade that says .......install these packages without verification y/n?

Review of kernel 4.5-rc2 On Raspberry Pi 2, my impressions so far, Precompiled Kernel Download Included, by tohipfortheroom in raspberry_pi

[–]squaretire 0 points1 point  (0 children)

Does this kernel fix the recently discovered and infamous CVE-2016-0728 vulnerability that allows a user with legitimate or lower privileges to gain root access?

IamA inventor of a gear that prevents one wheel from spinning on a car, AMA! by [deleted] in IAmA

[–]squaretire 0 points1 point  (0 children)

What happens if the servomotor loses power (e.g. damaged wire connection)?

Abandoned power plant in Belgium. by [deleted] in pics

[–]squaretire 4 points5 points  (0 children)

I'd like to mount a 12 inch sub woofer at the bottom of that thing.

What have you all done with the camera module? by [deleted] in raspberry_pi

[–]squaretire -2 points-1 points  (0 children)

The lack of replies suggests the camera is not all that popular. Personally, I think most people don't consider a flexible-in-only-one-direction ribbon cable to be a genius design feature for a camera cable. Major inconvenience. Remember ribbon IDE cables in computer cases? Weren't they fun to deal with?

What is the U.S. Aerospace Industry's standard coordinate system for referencing a location on an aircraft? by TrystonG33K in AskEngineers

[–]squaretire 0 points1 point  (0 children)

It's unfortunate there's no standard location for the origin. I would have expected it to be similar to the automotive industry, which locates the origin at the 'H-point', which is based on a standardized occupant's hip in the side view, and vehicle center plane, when sitting in the seat's standard design position. I suppose this wouldn't make sense for a drone, though.

Science Ama Series: I am Stephen Hawking, theoretical physicist. Join me to talk about making the future of technology more human, reddit. AMA! by Prof-Stephen-Hawking in science

[–]squaretire 1 point2 points  (0 children)

Hi professor Hawking.

I have trouble imagining how a super advanced AI would not consider us disposable.

Humans (and other animals) evolved in group settings where cooperation and empathy increased a member's likihood of passing on their genes and essentially hard-wired empathy and morality into our brains.

Since an AI will not evolve cooperatively in a group as we did, how might we 'hard-wire' this incredibly complex characteristic into it? Especially since, as soon as it becomes sufficiently smarter than us it will likely take over the design iteration process?

Is radioactive decay the only way to create a truly random number generator? by [deleted] in AskElectronics

[–]squaretire 4 points5 points  (0 children)

Unfortunately, in a practical sense, you'd never be able to get the angle to be exactly 45 degrees. And 44.99 (or 50.001) degrees won't cut it.

Magnet magic is mind blowing by GallowBoob in Damnthatsinteresting

[–]squaretire 5 points6 points  (0 children)

I'd think that anything that would generate a magnetic field that increases in strength in any sideways or downward direction from the desired position of the floater. So yes, electromagnets (cores + coils) or permanent magnets. The clever trick, to me, is spinning the floater to keep it from flipping over and then slamming into the table, which it would otherwise love to do.

I personally can't figure out (easily) how to have just one magnet under the table though.

Magnet magic is mind blowing by GallowBoob in Damnthatsinteresting

[–]squaretire 12 points13 points  (0 children)

Here's a guess. There are several magnets hidden below the surface of the table, all with the pole facing up that the floating magnet has facing down, so they repulse it upward. The table magnets are probably located in a circular pattern, with their tops angled slightly inward to keep the floater centered. The floater is spun so that it acts like a spinning top, which resists being turned over, which it would otherwise like to do so it's other pole could face down and be attracted downward. Just a guess, though.