Search found 167 matches

by RudyB
Thu Mar 21, 2019 2:13 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 23 Neopixel Addressable LED, WS2812, struct{...}

Neopixels, or addressable LEDs, are color LEDs with a built in chip that takes care of the one wire data communication and of the Pulse Width Modulation for the built in RGB(+W) LEDs. The LEDs are connected via just 3 wires, GND, 5V, Data. The Data line is connected to an Arduino output and we can c...
by RudyB
Thu Mar 14, 2019 2:22 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 22 Step Sequencer for LEDs with array[] and for() loop

A police car, fire fighter car or an ambulance with flashing lights can liven up any model railway laout. The challenge that we set ourselves is not to have to write different code any time we want another flashing pattern. We want to hav one and the same code and we only want to configure the numbe...
by RudyB
Sun Mar 10, 2019 11:21 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 20 Railway Crossing Putting it all Together

We have seen the separate ingredients for a level crossing in the previous three videos: blinking LEDs, servo to operate the gate, sensors to detect the train ... it is time to put it all together now into one piece of software. We'll use the State Transition Diagram as our starting point and build ...
by RudyB
Thu Mar 07, 2019 10:35 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 19 Railway Crossing Train Detection with Optical Sensor

There are several ways to do train detection, like sensing rail current, or a magnet under the train that triggers reed switches along the track, or with an optical sensor. The latter is used in this video, only because I had some TRCT5000's lying around and they were easy to setup for a demo. As so...
by RudyB
Thu Feb 28, 2019 9:56 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 18 Railway Crossing, Servo Motor to Operate the Gate

In part 2 of the railway crossing project we are going to connect the servo motor that operates the gate and control it with the Arduino. With the example in the video, the gate beam is mounted directly on the servo. On a layout, the servo motor will probably be mounted under the board, and a metal ...
by RudyB
Wed Feb 27, 2019 7:30 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Re: Fun with Arduino - a Series of Introductory Videos

There has been a request to also do a UK crossing. Maybe it can be in one video, else there will be an extra video with the yellow and double red additions when the continential one is finished.
by RudyB
Mon Feb 25, 2019 9:42 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 17 Railway Crossing, State Transition Diagram, switch()

We're at the start of a new Arduino project: an automatic railway crossing. The system comprises several parts: train detection (optical), blinking lights ('blink' with a twist), a moving beam (servo motor). We'll look into a way of specifying these kinds of systems as well as a way to translate the...
by RudyB
Thu Feb 21, 2019 11:09 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 16 LED Dimming with Fade, analogWrite(), millis()

Now that we know how to dim LEDs with analoWrite(), we can go a step further and change the dimming over time to create a gradual fade in or out. This is a nice effect for instance for LED strips mounted under kitchen cabinets, or for LED strip overhead lighting on a model railway layout to simulate...
by RudyB
Sun Feb 17, 2019 9:56 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 15 LED Dimmer, analogWrite(), Pulse Width Modulation

We used analogRead() to read the voltage on our potentiometer. The Arduino also has the opposite instruction: analogWrite(). This name is somewhat misleading. Unlike with an analog input, where a 10 bit A/D converter is used, the Arduino does not have a D/A converter on board. The analogWrite() func...
by RudyB
Thu Feb 14, 2019 9:49 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 14 Day Night Cycle with millis(), no Delay, Direct Feedback

Now that we know how to get rid of the delay(0 and use millis() in stead (video 13) we can finalize our Automatic Day Night Light Cycle unit to have direct on screen feedback of cycle time adjustment by the user and to have the cycle stop, and the lights turn off, immediately when the switch is set ...
by RudyB
Sun Feb 10, 2019 9:36 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 13 Timer with millis(), no delay(), Multitasking

The delay() statement that we used so far for our timing stalls the Arduino. This leads to a complete lack of feedback when we change the cycle time while the cycle is running. Luckily there is a solution: we can use the Arduino internal clock, which counts milliseconds from the moment the Arduino i...
by RudyB
Thu Feb 07, 2019 10:40 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 12 Analog Input, analogRead(), Change Range, map()

Now that we can change the cycle time via the PC keyboard, let's have a look at a hardware oriented solution ... a rotating knob. We connect a potentiometer to an analog input and read the voltage with the analogRead() instruction. With the map() instruction we can convert the range from 0-1023 to t...
by RudyB
Sun Feb 03, 2019 8:46 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 11 Keyboard Input via Serial Read and ParseInt

The User Interface works, it shows the status if the day / night cycle on screen. We're now going to add the option to change the cycle time via the keyboard. The functions we are going to use are Serial.available(), which tells us that there is new input, and Serial.read() or Serial.parseInt() to r...
by RudyB
Thu Jan 31, 2019 2:14 pm
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 10 Show Cycle Status and Time with Serial.print

Now that we have our code working, by using the correct data type or by typecasting, we can continue the work on our User interface. The goal in this video is to display the status of our day / night cycle on screen ... is it switched on or off, is it day or night, and what is the currently used day...
by RudyB
Sun Jan 27, 2019 10:06 am
Forum: Electronics
Topic: Fun with Arduino - a Series of Introductory Videos
Replies: 38
Views: 1377

Fun with Arduino 09 Variables byte int long unsigned

Before we continue to work on our User Interface, let's first take a moment to have a closer look at variables and data types. We are going to use ever more variables in the coming videos ... and ... we'll have a look at a pitfall concerning data types that prevented our code from previous video 8 t...

Go to advanced search