Mon, 16 Jan 2017 10:35:00 +0000
Fri, 13 Jan 2017 18:00:38 +0000I am a little obsessed with Twitter. It's how I communicate with most of the developers I'm not fortunate to live in the same city as. I'm a little less obsessed with IoT projects, but then it's harder to find the time to work on them than it is to check Twitter. Unless I can do both at the same time. Ever since the IoT week, I've been meaning to work on a project that will let me know when someone wants to speak to me. Something that looks cool, and is at the same time non-invasive. This is what I've come up with... Most of this code can be found on Github. I've tested it using PHP 7.1. In this post I talk a lot about pins. I use this word to mean the pins coming out of components, as well as the Arduino sockets these pins go into. They're often called terminals or ports. When I talk about pins, I just mean a place you can connect components or wires to. I'm quite specific each time though, so you'll be fine! The Project The project we're going to work on is a simple notification system, connecting a single RGB LED, a proximity sensor, and a PHP script to gather notifications. As notifications are received, the RGB LED will cycle through them, fading the LED to the appropriate color for each notification type. Say someone has mentioned us on Twitter. The LED should periodically cycle to the Twitter blue. Then, if someone sends us an email, the LED should cycle between the Twitter blue and the GMail red. We could extend this to the Fitbit green, the Facebook blue and so on. If we've seen the Twitter notification, we should be able to wave our hand in front of the proximity sensor, and Twitter blue should be removed from the rotation, leaving GMail red etc. The Hardware We can use just about any RGB LED. As long as we can control the color it fades to, we can simulate the social network notifications we're after. Really, just about any common anode RGB LED. If you get one that doesn't include resistors, be sure to add those into your circuit. I'll touch on that later... The more IoT work you do, the more likely you are to run into the terms anode and cathode. A common anode RGB LED is one that connects one pin to the positive pin on your micro-controller or battery, and three pins to ground, depending on the combination of colors you're after. Connecting the red pin to ground will close the circuit so that current flows through the red portion of the LED. Connecting the red pin to a Pulse Width Modulation (or PWM) port on our Arduino, and grounding the port by half will reduce the amount of current flowing through the red portion of the LED. Grounding the various pins by varying amounts will lead to many different colors - as many as you can define as CSS colors. Next, we need some kind of proximity sensor. The easiest (in my opinion) is an infrared transceiver. You could also use an ultrasonic transceiver, but they're better at mid-range (as they have a minimum sensing distance, so you'll have to be further away from the sensor). Finally, we need an Arduino. You can use another micro controller, but this post will refer specifically to Arduino, because I have three within arms-reach, and nothing else to test on. Connecting Things Together This is a relatively simple circuit, as far as they go. I'm by no means an expert, but I did manage to find the data sheets for the infrared sensor and RGB LED I bought; so connecting them up wasn't too troubling. The important bits are that our LED pins are connected to PWN ports, so that we can gradually adjust the amounts of red, green, and blue, and that the sensor pin is connected to an analog port (in this case A0). You may be wondering why we don't connect the LEG pins to analog ports, or why we don't connect the sensor to a PWM port. PWM is designed to simulate degrees of on/off, but the way that is done is by turning something on for a fraction of a second. With the right frequency of on/off cycles, LEDs only appear to be partially bright. That's a side-effect of our eyesight, in much the same wTruncated by Planet PHP, read more at the original (an[...]
Thu, 12 Jan 2017 17:57:15 +0000
The following is an extract from our book, Scrum: Novice to Ninja, written by M. David Green. Copies are sold in stores worldwide, or you can buy it in ebook form here. The ritual that marks the beginning of each sprint is called sprint planning. Sprint planning is hosted by the scrum master, but the […]
Continue reading %Scrum Rituals: Sprint Planning%
Thu, 12 Jan 2017 16:08:34 +0000
I am excited to announce that pds/skeleton 1.0.0beta2 has been released. (The pds/skeleton publication describes a standard PHP package skeleton, as backed by research into the PHP package ecosystem.)
Among other things, this release incorporates some command-line tooling to validate, and generate, your PHP package skeleton.
Barring unforeseen events, I expect the next release to be stable.
Thu, 12 Jan 2017 15:00:00 +0000
Thu, 12 Jan 2017 10:00:29 +0000
We’ve all heard of “Mobile First”. Most of us are savvy enough to know that that really means “API First” and then “Mobile is the first client.” Have you heard though, about “Voice First?” Starting with Siri, but greatly accelerated by the Amazon Echo and now the Echo Dot, we are seeing the birth of a …
Wed, 11 Jan 2017 16:51:51 +0000
Tue, 10 Jan 2017 15:00:21 +0000Today, we are talking about Voyager! Voyager is a Laravel package that provides a full administration system for the framework in its "skeleton app" form. Voyager has 4 main features: Media Manager - Built on top of Intervention Image, it provides a fully functional media manager that allow us to view, edit, and delete images from storage. This way, we can have all of our media in a single place, making it easy to access and manipulate. Menu Builder - The Menu Builder allows us to add, edit, and delete menu items. It also gives us the ability to create new menus and manage them. Database Manager - Allows us to access and manipulate our database directly from the admin panel. Instead of having to use Laravel's Schema, Voyager provides us with a mechanism to add, delete, and edit entries in the database. It will also (upon specification) create our models when adding tables to the database. Bread/CRUD builder - BREAD is simply CRUD for the database. Voyager provides a mechanism to Browse, Read, Edit, Add, and Delete entries and views of any table in our database. Let's take a closer look at it. Installing Voyager First, let's start with a fresh Laravel installation. Of course, we can start with an existing project, but for the purpose of this article we will start with a fresh one. While it's outside the scope of this article, the recommended way to start a new Laravel project is by using Composer: composer create-project laravel/laravel voyager This will create a new Laravel project called voyager inside the /voyager folder. To serve this new Laravel project, using PHP's built in server: php artisan serve On Homestead Improved, the serving is taken care of for you with Nginx. With a fresh Laravel installation up and running, we can now focus on installing the Voyager Admin package. composer require tcg/voyager As we can see during the installation process, Voyager is pulling components from some very well known PHP packages like Doctrine ORM for the database manager, or Guzzle and Intervention Image for PHP image handling and manipulation. This shows us that Voyager is built on top of reliable and proven components. Next, let's fire up our favorite code editor. We will need to edit some files in order to have Voyager up and running. First, we open the .env file and add our database credentials so that Voyager can connect to it. DB_HOST=localhost DB_DATABASE=database DB_USERNAME=username DB_PASSWORD=password After that, let's add the Voyager and Image Intervention service providers to our providers array. This array can be found in the config/app.php file, and all we need to do is append the following elements to it: TCG\Voyager\VoyagerServiceProvider::class, Intervention\Image\ImageServiceProvider::class, To finish the installation: php artisan voyager:install We should now see the "Successfully installed Voyager! Enjoy :)" message. Continue reading %Voyager – Can an Admin UI Make Laravel Even More Approachable?% [...]
Tue, 10 Jan 2017 08:34:30 +0000When people start (unit-)testing their code one of the worst problems to tackle are static calls. How can we refactor static calls out of an existing application without breaking the code and while producing new features? How can we get rid of this big test impediment?
Mon, 09 Jan 2017 11:50:29 +0000
The following is an extract from our book, Scrum: Novice to Ninja, written by M. David Green. Copies are sold in stores worldwide, or you can buy it in ebook form here. The practice of working on a scrum team is organized into a series of rituals. The rituals mark key events in the process […]
Continue reading %What Are Scrum Rituals?%