Show Posts
Pages: 1 2 [3] 4 5 ... 102
31  Using Arduino / Project Guidance / Re: Does anyone notice Keyboard.begin() Keyboard.end() not working right? on: August 21, 2014, 09:40:57 pm
delay() only takes ints, so delay(.5) is nonsense.
32  Using Arduino / Project Guidance / Re: teaching arduino to high school students? on: August 20, 2014, 10:10:34 pm
The application that we often see is traffic lights. You don't say how much teaching time you have in those 4 weeks, but I suggest just one light running through all the phases* would be do-able in the time available. Before they start programming, get them to write down all the states in order (not forgetting the 'wait' states), so as to get them thinking logically about the problem. After they've completed programming the one light, you could ask them what changes would be needed and how they would implement them (not the code, just the basic method) for a pedestrian push button controlled crossing. Extra points if they remember the walk/don't walk lights and the bleeper for the visually impaired. 
I don't think you'd have time for a full cross roads junction (with filter [turn] lights) system, but you could, at least, get your students thinking about the problem.

If you had even more time, I would suggest a lift [elevator] system. With that, you not only have lights (floor indicators and 'lift coming') but also motion. The more floors, the more complex the problem!

How about an after school club for the more interested students?

*See the 'blink without delay' example in the IDE and also look up 'State Machine' and the switch-case construct in the reference pages of this site.
33  Community / Bar Sport / Re: Music & Electricity on: August 19, 2014, 09:30:56 pm
Shocking! But did the orchestra play at a higher AMPlitude after that?
34  Using Arduino / General Electronics / Re: Pull-up interference from DCC system? on: August 19, 2014, 09:20:14 pm
I'd keep all the electronics as far away as possible from the point motors, especially if you're using the solenoid type. Those give one heck of a magnetic kick when they're activated. I'd also suggest keeping all your electronics away from the track too, near to the edge of the baseboard (or, my preferred option, on the floor in a grounded metal enclosure). Then run your twisted pair or shielded cables to the points and signals at right angles to the track, as already suggested.  Remember that your rails are acting like a very long aerial.

35  Using Arduino / General Electronics / Re: Pull-up interference from DCC system? on: August 19, 2014, 08:53:11 pm
Or you can run the drill backwards a little bit to lose the torsion. 
Then you have to remember to twist it more than you need before turning backwards. But stretching sets the twist tighter.
With short lengths a hand-drill gives much more tactile feedback.
I wouldn't like to use a hand drill on 50' lengths.    smiley-roll-blue
I hope you didn't have to strip and solder them too!  (Or make litz wire!)
I wasn't trusted with a soldering iron then! No Litz wire either, thank goodness. I hear it was nasty stuff to work with and the soldering technique was a severe fire hazard. Plunging hot wire into methylated spirits [Sterno?] isn't a good idea!

They mainly made speaker enclosures with crossovers. The demand was so slow that the testing bods found time to turn their green screen circular oscilloscope into a TV, but no sound. That was in the days of single channel monochrome 405 lines TV (early 60s).
36  Using Arduino / General Electronics / Re: Pull-up interference from DCC system? on: August 19, 2014, 07:59:59 pm
You can easily make twisted pair using a hand-drill and a bench-vice.
My first vacation job was working in a small electronics assembly plant. I spent some of that time making twisted cables (2 to 5 strands) by tying one end of the cables to some fixed point at one end of the factory and spooling about 50 foot out to the other end. I then placed the ends in the chuck of an electric drill and turned it on until the cable was twisted enough. The trick, to prevent the cable from untwisting, was to take it out of the chuck and pull hard, to stretch it slightly. That was the fun bit. I then spent the rest of the day cutting it up into 6" lengths.  smiley-sleep smiley-sleep
37  Using Arduino / Programming Questions / Re: FSM diagrams: states and transistions on: August 19, 2014, 07:24:34 pm
In a "pure" state machine, the "fade" part would consist of multiple states, with boring transitions.
(LED10% -> LED20% -> LED30% -> LED40% ... unconditional, timed.  The process where a single state sits there and changes outputs is NOT "pure")
 Agreed, but I termed it 'an unsteady state'.
(of course, this level of purity can be annoying to implement...)
This would lead to the banishment of the for loop and further leads back to assembly language programming... smiley-eek-blue
38  Using Arduino / Programming Questions / Re: Dumb novice question -- How does one stop a sketch from continuing to run? on: August 19, 2014, 06:37:44 pm
I've been having this problem as well, I want to just stop one part (a function) of the sketch from running and then get another function to run afterwards based on values from the previous stopped function.
What Hackscribble wrote, plus look up the switch/case construct if you want more than two functions.
39  Using Arduino / Programming Questions / Re: FSM diagrams: states and transistions on: August 18, 2014, 10:28:55 pm
The good thing that's coming out of this discussion is that states are good stuff.....
I'd say they're vital for avoiding indecipherable spaghetti code.
If you've ever written assembly language, states come naturally, otherwise you'd tie yourself up in knots within less than 100 lines, especially if your assembler program would only accept 5 character labels, as mine did. 
40  Using Arduino / Programming Questions / Re: Calculating Celsius using Datalogger on: August 18, 2014, 09:54:46 pm
Shouldn't this be *5000.0 ?
      float millivolts= (rawvoltage/1023.0) * 500.0;

Possibly. I didn't check the maths, as the OP said it was working correctly. All he wanted was to combine the two sketches.
41  Using Arduino / Programming Questions / Re: HELP! I have a program but it doesn't work on: August 18, 2014, 09:49:42 pm
Post your code between code tags (use the # key above the smileys).
Get rid of your delay()s. Use the 'blink without delay' example in the IDE.
42  Using Arduino / Programming Questions / Re: programming confusion on: August 18, 2014, 09:39:16 pm
"int left, right=0;" defines two integer variables (left and right), but only initializes "right" to zero.
If you define a variable without giving it a value, is it not automatically initialised to zero?
I was under the impression that "int x;" and "int x = 0;" were exactly the same, although the former should be avoided for the sake of clarity.
43  Using Arduino / Project Guidance / Re: ultrasonic ground speed detection on: August 18, 2014, 09:12:29 pm

I guess you could experiment with taking one of those mice to pieces and possibly replace the lens, but you'd still have the issue of needing a USB host
There were, and probably still are, ball-less mice with a PS2 connector. But I wasn't suggesting using a mouse, merely the principle of reflecting IR off the ground.
 ANY reflective system needs to take into account the surface over which it will travel. Tarmac, concrete, grass, carpet, vinyl and wood will all have different reflective properties to any wavelength of both sound and light. The OP hasn't told us anything about the surface(s) he want to use it on, so were just guessing here.
44  Using Arduino / General Electronics / Re: Safety match activation energy on: August 17, 2014, 11:21:37 pm
I saw a YouTube video where someone took nichrome wire and took a wall outlet attached to wire and managed to light a whole series of matches. I am assuming his mains was 220V, 50Hz since he didn't have any kind of plug I had ever seen before (so not US plug).
The 2 pin plug he used is known as a Europlug and I'd guess his mains supply was 240/250V AC, which is common throughout most of Europe.  The socket he was using is not a UK socket, but looks like the type used in most of mainland Europe.
45  Using Arduino / Programming Questions / Re: FSM diagrams: states and transistions on: August 17, 2014, 11:08:49 pm
But it's a matter of one's own interpretation of the word 'state'.

Yep... or the interpretation of the convention one's following. In UML-speak it certainly seems the states are the steady parts (off, on; the boxes) and the transitions are the pathways between them (goOn, goOff; the arrows).
I think it's how you approach it. My approach is "What state is the program in?" rather than "What state is the LED in?" I can say my program is in the state of fading the LED and, only when it has completed that, it will transition to the next state.
I tend to use switch-case in my sketches. I'd find it very difficult to use fade as a transition between states.
OTOH, the LED is transitioning during the fade. You pays your money and you takes your choice!
Pages: 1 2 [3] 4 5 ... 102