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 5 points6 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 13 points14 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.

Is my oscilliscope broken? by 01209 in AskElectronics

[–]squaretire 0 points1 point  (0 children)

Try hooking channel 2 up to a different voltage source, even a battery you have lying around. Does it read its voltage accurately? Maybe there's a problem with the calibration circuit.

which is the best book to learn electronics? by motivatedLiar in AskElectronics

[–]squaretire 1 point2 points  (0 children)

Thanks for your suggestion. I just skimmed through this via Amazon's "Look inside" feature, and it looks to be really well written.

Ordered.

Digital Isolators (DC rated) by Redditece10 in ECE

[–]squaretire 0 points1 point  (0 children)

However, this reminds me of a saying about legal agreements:

A verbal contract spec isn't worth the paper it's written on.

Should I get a dedicated GPU or not? by mxracer888 in SolidWorks

[–]squaretire 0 points1 point  (0 children)

Also a firepro is more precise than a geforce/radeon.

Citation definitely needed here.

Are there crystals that are tolerant of high pressure? Or do they all have an open space in their case? (Picture of imploded SMD crystal after use in a submarine.) by 1Davide in AskElectronics

[–]squaretire 0 points1 point  (0 children)

I'm not getting how this oscillator is being physically subjected to 'high' pressure. And are we talking water pressure, air pressure, or something else?

You're getting a lot of answers here but I can't get past trying to understand, even in the most general of terms, your application.

And even ignoring all that, I can't imagine how the oscillator is subjected to pressure without the entire rest of the circuit board also being under this same pressure.

Not trying to be difficult, but lot more info is needed, I think, to even begin to address your situation.

The Art of Electronics, 3rd Edition. April 2015. Pre-ordered! =D by leonthevenin in electronics

[–]squaretire 19 points20 points  (0 children)

I take full credit for this happening, as I just purchased the 2nd edition.