Arduino Infrared (IR) Remote Driver Implementation

The Infrared Sensor

The IR Remote Receiver Electronic Module has 3 pins. From left to right they are (G) Ground, (V) Voltage, (S) Signal. BUT the marking sometimes varies on the little circuit board.

Read more

Arduino HC-SR04 Distance Sensor Driver Implementation

HC-SR04 Ultrasonic Sensor and Arduino

The HC-SR04 Ultrasonic Sensor is a very affordable proximity/distance sensor that has been used mainly for object avoidance in various Arduino robotics projects.  It provides 2cm to 400cm of non-contact measurement functionality with a ranging accuracy that can reach up to 3mm. Each HC-SR04 module includes an ultrasonic transmitter, a receiver and a control circuit.

Read more

Arduino Continuous Rotation (360 degree) Servo Driver Implementation

This servo rotates fully forward or backward instead of moving to a position. You can use any servo code, hardware or library to control these servos. Good for making simple moving robots. Comes with four different horns.

To control with an Arduino, I suggest connecting the control wire to pin 9 or 10 and using the Servo library included with the Arduino IDE. Position “90” (1.5ms pulse) is stopped, “180” (2ms pulse) is full speed forward, “0” (1ms pulse) is full speed backward.

Read more

How to bold first (or n-th) paragraph of text

In the last two projects I’ve been asked a simple task to bold first paragraph of text. This task proved to be very complex or quite trivial depending on my customer’s requirements. Hope someone will find code snippets below helpful.

Lets assume your HTML code looks like that:

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet purus in dictum scelerisque.

Vivamus ut consectetur tortor. Phasellus egestas magna nisi, non tempus purus malesuada sed.

You want to bold first paragraph like this (visual representation depends on CSS):

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Curabitur imperdiet purus in dictum scelerisque.

Vivamus ut consectetur tortor. Phasellus egestas magna nisi, non tempus purus malesuada sed.

This can be achieved in at least two ways.
Read more