<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>The MagPi Magazine</title>
	<atom:link href="https://www.raspberrypi.org/magpi/feed/" rel="self" type="application/rss+xml" />
	<link>https://www.raspberrypi.org/magpi</link>
	<description>The official Raspberry Pi magazine</description>
	<lastBuildDate>Thu, 31 Mar 2016 08:12:25 +0000</lastBuildDate>
	<language>en-GB</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=4.2.7</generator>
	<item>
		<title>Surfing  Random Streams</title>
		<link>https://www.raspberrypi.org/magpi/surfing-random-streams/</link>
		<comments>https://www.raspberrypi.org/magpi/surfing-random-streams/#disqus_thread</comments>
		<pubDate>Thu, 24 Mar 2016 11:03:30 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Walkthrough]]></category>
		<category><![CDATA[random streams]]></category>
		<category><![CDATA[sonic pi]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1761</guid>
		<description><![CDATA[<p>In this month’s Sonic Pi guide, its creator, Sam Aaron, demonstrates the incredible power of randomisation in live-coded music…</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/surfing-random-streams/">Surfing  Random Streams</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Back in part four of the series (<a href="https://www.raspberrypi.org/magpi/issues/39/">The MagPi issue 39</a>), we looked at randomisation while coding some sizzling synth riffs. Since randomisation is an important part of my live-coding DJ sets, we thought it would be useful to cover the fundamentals in detail. So get your lucky hat on; let’s surf some random streams!</p>
<p><em>The full article can be found in <a href="/magpi/issues/essentials-sonic-pi-v1/">Sonic Pi Essentials</a> along with even more Sonic Pi tutorials! All the Essentials books are now also available in print.</em></p>
<h3>You&#8217;ll need</h3>
<p>Raspberry Pi running Raspbian</p>
<p>Sonic Pi v2.7+. Update with:</p><pre class="crayon-plain-tag">sudo apt-get update &amp;&amp; sudo apt-get install sonic-pi</pre><p>Speakers or headphones with a 3.5mm jack</p>
<h3>There is no random</h3>
<p>The first surprise when playing with the randomisation functions is that they’re not random. What does this mean? Let’s try some tests. Imagine a number in your head between 0 and 1, but don’t tell me. Now let me guess&#8230; was it ‘0.321567’? No? I’m no good at this. Let me try again, but let’s ask Sonic Pi to choose a number. Start Sonic Pi v2.7+ and ask it for a random number, but don’t tell me:</p><pre class="crayon-plain-tag">print rand</pre><p>Now for the reveal&#8230; was it ‘0.75006103515625’? Yes! I can see you’re sceptical; it was a lucky guess. Let’s try again. Press the Run button again and see what we get&#8230; The same again? This clearly can’t be random! You’re right, it’s not.</p>
<p>What’s going on? The fancy computer science term is determinism. This means that nothing is by chance and everything is destined to be. Sonic Pi is destined to always return ‘0.75006103515625’ in the program above. It may sound useless, but in fact it’s one of the most powerful parts of Sonic Pi. If you persevere, you’ll learn how to rely on the deterministic nature of Sonic Pi’s randomisation as a fundamental building block to your compositions and live-coded DJ sets.</p>
<h3>A random tune</h3>
<p>When Sonic Pi boots, it actually loads into memory a sequence of 441,000 pre-generated random values. When you call a random function such as <pre class="crayon-plain-tag">rand</pre> or <pre class="crayon-plain-tag">rrand</pre>, this random stream is used to generate your result. Each call to a random function uses a value from this stream, so the tenth call to a random function will use the tenth value from the stream. Also, every time you press Run, the stream is reset for that run. That’s why you can predict the result to <pre class="crayon-plain-tag">rand</pre> and why the ‘random’ tune was the same every time. Everybody’s version of Sonic Pi uses the same random stream, which is important when we start sharing our pieces with each other.</p>
<p>Let’s use this knowledge to generate a repeatable random tune:</p><pre class="crayon-plain-tag">8.times do
	play rrand_i(50, 95)
	sleep 0.125
end</pre><p>Type this into a spare buffer and press Run. You’ll hear a tune consisting of ‘random’ notes between 50 and 95. When it’s ended, press Run again to hear exactly the same tune again.</p>
<h3>Resetting the stream</h3>
<p>While repeating a sequence of notes is essential for replaying a riff on the dance floor, it might not be the one you want. Wouldn’t it be great if we could try a number of different riffs and choose the one we liked best? This is where the real magic starts.</p>
<p>We can manually set the stream with the function <pre class="crayon-plain-tag">use_random_seed</pre>. In computer science, a random seed is the starting point for a new stream of random values. Let’s try it:</p><pre class="crayon-plain-tag">use_random_seed 0
3.times do
	play rrand_i(50, 95)
	sleep 0.125
end</pre><p>Great, we get the first three notes of our tune above: 84, 83, and 71. We can now change the seed to something else, like this:</p><pre class="crayon-plain-tag">use_random_seed 1
3.times do
	play rrand_i(50, 95)
	sleep 0.125
end</pre><p>We get 83, 71, and 61. You may spot that the first two numbers are the same as the last two numbers before – no coincidence.</p>
<p>The random stream is just a giant list of ‘pre-rolled’ values. Using a random seed simply jumps us to a point in that list. Imagine a big deck of pre-shuffled cards. Using a random seed is cutting the deck at a particular point. The great part of this is that it’s this ability to jump around the random list which gives us power when making music.</p>
<p>Let’s revisit our random eight-note tune with this new power, and also add a live loop so we can experiment live while it’s playing:</p><pre class="crayon-plain-tag">live_loop :random_riff do
	use_random_seed 0
	8.times do
		play rrand_i(50, 95), release: 0.1
		sleep 0.125
	end
end</pre><p>While it’s still playing, change the seed value from 0 to something else. Try 100, or 999. Try your own values and experiment – see which seed generates the riff you like best.</p>
<h3>Bringing it all together</h3>
<p>This tutorial has been quite a technical dive into the workings of Sonic Pi’s randomisation functionality. Hopefully, it’s explained how it works and how you can start using randomisation reliably to create repeatable patterns in your music. Crucially, you can use repeatable randomisation anywhere: the amplitude of notes, the timing of the rhythm, amount of reverb, current synth, the mix of an FX, etc. In the future we’ll take a close look at these, but for now I’ll end with a short example.</p>
<p>Type the code below into a spare buffer, press Run, then change the seeds. Press Run again while it’s playing, and explore the different sounds, rhythms, and melodies you can make. When you find a nice one, note the seed number so you can return to it. Once you’ve found a few seeds you like, put on a live-coded performance by simply switching between your favourite seeds to make a full piece.</p><pre class="crayon-plain-tag">live_loop :random_riff do
	use_random_seed 10300
	use_synth :prophet
	s = [0.125, 0.25, 0.5].choose
	8.times do
		r = [0.125, 0.25, 1, 2].choose
		n = (scale :e3, :minor).choose
		co = rrand(30, 100)
		play n, release: r, cutoff: co
		sleep s
	end
end

live_loop :drums do
	use_random_seed 2001
	16.times do
		r = rrand(0.5, 10)
		sample :drum_bass_hard, rate: r, amp: rand
		sleep 0.125
	end
end</pre><p></p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/surfing-random-streams/">Surfing  Random Streams</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/surfing-random-streams/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Balance bot</title>
		<link>https://www.raspberrypi.org/magpi/balance-bot/</link>
		<comments>https://www.raspberrypi.org/magpi/balance-bot/#disqus_thread</comments>
		<pubDate>Wed, 23 Mar 2016 11:24:16 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[balance]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[two wheeled]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1755</guid>
		<description><![CDATA[<p>A sociable, balancing robot built with a Raspberry Pi to power it. How tricky is balancing a robot via code, though?</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/balance-bot/">Balance bot</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>There’s a reason a lot of robots don’t use two wheels or two legs: very simply, it’s difficult for them to balance. It’s much easier and sturdier to be on three (or more) wheels or four (or more) legs; generally, just having a low centre of gravity is a good thing. For two wheels in particular, you need some way of maintaining balance. Usually, this task is left up to humans; as Kris Temmerman shows us, though, a good bit of coding and construction can accomplish the same thing.</p>
<p>“The idea came after seeing some social robots, like Nao and Pepper,” Kris tells us. “Technologically they’re great, but I think they are also kind of boring. Too polite, too cute. I wanted to see if I can make a social robot with a little bit more character.”</p>
<div id="attachment_1758" style="width: 1510px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/balance2.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/balance2.jpg" alt="The eyes add character. They&#039;re less creepy in motion though" width="1500" height="1004" class="size-full wp-image-1758" /></a><p class="wp-caption-text">The eyes add character. They&#8217;re less creepy in motion though</p></div>
<p>The robot is self-balancing so that it can achieve a similar look to these personal assistant robots, and hopefully look a little less weird than the robot from Rocky IV in the process. It has facial recognition built in so it can detect and react to people properly.</p>
<p>“For me it’s a sandbox – a way to try all kinds of hardware and software,” Kris explains. Since he wanted to do some intensive computations, in combination with a display and sound, he opted to use a Raspberry Pi 2. “The quad-core [CPU] came in really handy. I have the face recognition running in a separate thread on its own core, so the main process that handles the graphics, sound, and motion can run smooth and uninterrupted. And I still have two cores left over for future improvements.”</p>
<p>While Kris says it’s certainly not a project for beginners, it’s not as hard as it seems. “If you have a reasonable amount of programming experience, it’s definitely something you can make. You can find plenty of information about balancing robots online. For the face recognition I use OpenCV, an open-source computer vision library that has the hard parts already solved for you.”</p>
<div id="attachment_1759" style="width: 1510px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/step21.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/step21.jpg" alt="Parts of it are powered by Pi but there&#039;s a lot that keeps it going" width="1500" height="1004" class="size-full wp-image-1759" /></a><p class="wp-caption-text">Parts of it are powered by Pi but there&#8217;s a lot that keeps it going</p></div>
<p>Kris made lot of the body and chassis himself with nylon sheets, together with some spare motors and drivers. There’s an Arduino layer in the build as well, to aid with the balancing.</p>
<p>That works well and there are a few online videos you can watch of the little robot racing around on its two wheels. The robot still has some work left to be done. In particular, Kris is looking at mounting a lidar onto it so that it can have a better sense of its environment, allowing it to move around autonomously.</p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/pW2ZpirOcfw?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>“This was my first project with a Raspberry Pi, but I really like that it has a full-blown Linux distro&#8230; I’m definitely going to use it more in the future.”</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/balance-bot/">Balance bot</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/balance-bot/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MeArm robot kit review</title>
		<link>https://www.raspberrypi.org/magpi/mearm-robot-kit/</link>
		<comments>https://www.raspberrypi.org/magpi/mearm-robot-kit/#disqus_thread</comments>
		<pubDate>Fri, 18 Mar 2016 09:50:11 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[mearm]]></category>
		<category><![CDATA[robot]]></category>
		<category><![CDATA[robot arm]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1751</guid>
		<description><![CDATA[<p>A robot arm kit designed as an educational tool - how can people learn from MeArm?</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/mearm-robot-kit/">MeArm robot kit review</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>As a kid, it was weird coming to the realisation that the only real robots were robot arms. This was only really for a period in the Nineties, though, and probably not true; from the perspective of a child, however, that was how it seemed. Proper automatons, both expensive bipeds and cheaper wheely-trundly types, are now far more common than they were. The <a href="mearm.com">MeArm</a>, then, is a bit of a nice break from the now-normal robot types.</p>
<p><em>The full article can be found in <a href="/magpi/issues/42">The MagPi 42</a></em></p>
<p>It’s designed very much as an educational tool, teaching people about electronics, robotics, and some programming as well if they’re interested. Construction is the big first step in the process and it’s definitely not a quick one; while it’s not an overly complex build, there are a lot of parts to it and a bit of calibrating to do before you even start. The process is generally simple, though; as long as you stay aware of the screws you need and double-check which way some of the pieces are orientated, it’s straightforward enough. It’s a bit like building Meccano, and it can be quite fun.</p>
<p>The whole kit comes with everything you need to run it, including its Arduino-based ‘brains’. As you may expect, this means the MeArm is programmed in Arduino; an example sketch is available that allows you to control the MeArm using a slimline, acrylic controller with analogue sticks. The code has plenty of unused sections that allow you to try to add outputs to an included display &#8211; salvaged from old Nokia phones, no less. With enough playing and poking, you could feasibly get the robot arm to move on its own as well, albeit only with timed movements as it doesn’t have any extra sensors out of the box.</p>
<p>Generally, though, it&#8217;s a lot of fun. With a build that will keep any techie kids entertained and the instant satisfaction of being able to use the arm with the included controller, there’s a lot of flexibility and longevity with an arm like this. Don’t be put off it if you’re an adult, either: there’s definitely plenty that grown-ups can learn from and enjoy too.</p>
<h3>Last word</h3>
<p>4/5</p>
<p>It’s a little expensive, but an amazing package that can be programmed with your own initiative and ideas. Perfect for older kids and adults alike.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/mearm-robot-kit/">MeArm robot kit review</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/mearm-robot-kit/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make your own Pi HAT</title>
		<link>https://www.raspberrypi.org/magpi/make-your-own-hat/</link>
		<comments>https://www.raspberrypi.org/magpi/make-your-own-hat/#disqus_thread</comments>
		<pubDate>Thu, 17 Mar 2016 10:23:10 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Walkthrough]]></category>
		<category><![CDATA[hat]]></category>
		<category><![CDATA[maker]]></category>
		<category><![CDATA[making]]></category>
		<category><![CDATA[prototyping]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1737</guid>
		<description><![CDATA[<p>There are some amazing HATs available to enhance the hardware capability of your Pi. Let's make one ourselves.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/make-your-own-hat/">Make your own Pi HAT</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>HATs first arrived with the launch of the Raspberry Pi Model B+ in 2014. Since then, there have been some amazing and wonderful HATs, many of which have featured in previous issues of The MagPi: theUnicorn HAT, Piano HAT, Sense HAT, and Explorer HAT. Officially, HAT stands for ‘Hardware Attached on Top,’ although your expert suspects that the acronym came after the name. What else would you call an add-on board that sits on top of the Pi?</p>
<p><em>The full article can be found in <a href="/magpi/issues/42">The MagPi 42</a> and was written by Richard Hayler</em></p>
<p>Although you can manufacture and sell boards that don’t conform to the HAT standard, there are many advantages in doing so. Having the same physical dimensions makes it easy to ensure your board will fit with most Pi cases, and the inclusion of an EEPROM allows the operating system to identify the HAT and set up any required hardware at startup.</p>
<h3>You&#8217;ll need</h3>
<p><a href="http://magpi.cc/1RwAaQP">An EEPROM (a CAT24C32 is recommended)</a></p>
<p><a href="https://shop.pimoroni.com/products/solderless-breadboard-400-point">A breadboard and some jumper leads</a></p>
<p><a href="http://magpi.cc/1RwAiQi">Some LEDs</a></p>
<p><a href="http://magpi.cc/1OAHaGk">he Pi HAT specification repository</a></p>
<p>These instructions will work with either the latest version of Raspbian (Jessie) or the older Wheezy. As usual, run a sudo apt-get update and sudo apt‑get upgrade before starting. Then enable kernel support for I2C using:</p><pre class="crayon-plain-tag">sudo raspi-config</pre><p>Choose ‘Advanced Options’, then tap down and select ‘A7 I2C’. Make sure ‘Yes’ is highlighted for the answers to both questions. Alternatively, if you’re using Jessie, you can set this up using the Raspberry Pi configuration tool available through the GUI.</p>
<p>You will then be prompted to reboot. Once your Pi has restarted, install the I2C tools package with:</p><pre class="crayon-plain-tag">sudo apt-get install i2c-tools</pre><p>Now it’s time to construct your EEPROM circuit on a breadboard. Put together the circuit as shown below. If you’re not using a 24C32, you may need to connect to different pins for SDA and SCL. Check the data-sheet for your IC to make sure you get this correct. You also need to give the HAT some functionality: in the interests of keeping things simple, the circuit of Fig 1 just contains a tri-colour RGB LED, but you can use whatever components you wish, depending on what you want your HAT to do.</p>
<div id="attachment_1739" style="width: 1372px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/eeprom-prog-led_bb.jpg"><img class="size-full wp-image-1739" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/eeprom-prog-led_bb.jpg" alt="Wire up your EEPROM circuit like so" width="1362" height="990" /></a><p class="wp-caption-text">Wire up your EEPROM circuit like so</p></div>
<p>Power up the Pi. You may notice that the LED is already on (perhaps just faintly). This is because the Pi doesn’t know what is connected and so the GPIO output is ‘floating’. This is something our HAT will deal with by preconfiguring the pins that it uses. The code snippet at the end of this tutorial provides some simple Python for interacting with the LED; you’ll need to install the wonderful gpiozero library to use it.<br />
Next, check to see what I2C devices have been detected on the second I2C bus:</p><pre class="crayon-plain-tag">i2cdetect -y 1</pre><p>You should see a table displaying the devices found on your I2C bus. Assuming you have nothing else connected, all but one of the entries should be empty, as represented by 2 dashes: – –. Normally, your EEPROM should show up in the leftmost column (0) as the number 50, next to the 50 on the horizontal axis.</p>
<p>If you don’t see this or the command returns an error (‘No such file or directory’), try the other bus:</p><pre class="crayon-plain-tag">i2cdetect -y 0</pre><p>If your EEPROM still isn’t showing up, check your connections and that you have I2C support enabled.<br />
Now you need some software. Clone the HATs reference material and tools <a href="https://github.com/raspberrypi/hats">from GitHub</a>. It’s well worth reading this documentation, as it explains the thinking behind the HAT specification in lots of detail.</p>
<div id="attachment_1742" style="width: 1010px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/hat.jpg"><img class="size-full wp-image-1742" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/hat.jpg" alt="Prototyping the board before making it is essential" width="1000" height="668" /></a><p class="wp-caption-text">Prototyping the board before making it is essential</p></div>
<p>You’re also going to use the handy EEPROM tools to flash your chip. First of all, compile the eepmake tool:</p><pre class="crayon-plain-tag">cd hats/eepromutils
make</pre><p>Then modify the eepflash script, which assumes that the EEPROM is on the first I2C bus; if yours is, then you can obviously skip this step. Copy the eepflash.sh and then modify with your favourite text editor:</p><pre class="crayon-plain-tag">cp eepflash.sh eepflash1.sh
nano eepflash1.sh</pre><p>Change all mentions of i2c-0 to i2c-1, and i2c-0/0-0050 to i2c-1/1-0500, then save the file.</p>
<p>Now you need to modify the supplied template with your own settings. Open the eeprom_settings.txt file in your favourite editor and modify the various fields. Most are self-explanatory and you can read more about each one in the specification. However, the UUID is particularly important and must comply to RFC 4122, so that every HAT can be uniquely identified and can therefore be used as a per-board serial number. It also allows HATs to be stacked.</p>
<p>Once that’s done, you need to convert the human-readable text file into binary data that can be written to the EEPROM.</p><pre class="crayon-plain-tag">./eepmake eeprom_settings.txt eeptest.eep</pre><p>Then dump this data to the EEPROM &#8211; this is the actual flashing bit and you’ll see a warning asking you if you’re sure you want to go ahead:</p><pre class="crayon-plain-tag">./.eepflash1.sh -w -f=eeptest.eep -t=24c32</pre><p>Make sure you use the version of the script we modified earlier. If you’re using a different type of EEPROM, change the -t parameter accordingly.</p>
<p>To test your new creation, you need to modify your circuit so that the EEPROM is connected to the Pi as it would be if it were part of a HAT. GPIO pins 27 and 28 are reserved for HAT detection, so power down your Pi again and move the appropriate wires as shown below. Then add the 3.9kΩ pull-up resistors which ensure that the pins are not ‘floating’.</p>
<div id="attachment_1741" style="width: 1372px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/eeprom-hat-led_bb.jpg"><img class="size-full wp-image-1741" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/eeprom-hat-led_bb.jpg" alt="Modify the circuit to look like this for testing" width="1362" height="990" /></a><p class="wp-caption-text">Modify the circuit to look like this for testing</p></div>
<p>Now reconnect the power to your Pi and let it boot. If everything has worked, the directory /proc/device‑tree/hat should be present, and the contents of its files should match the details in the default eeprom_settings.txt file. You should also see that the GPIO pins used by the RGB LED have now been preset, so it should not be lit at all.</p>
<p>Congratulations! You have now programmed an EEPROM that the Pi recognises as meeting the specification for a HAT.</p>
<p>As a final test, run the myoh-rgb.py code and check that the RGB LED flashes through its sequence of colours. Clearly, this is a very basic HAT; there are loads more possibilities for using the ability to have the Pi preload the necessary drivers, so that more complicated hardware can be easily supported. The Sense HAT is a great example of this technique.</p>
<p>Now that you’ve made a simple HAT and got to grips with the process, see what other amazing add-ons you can create!</p>
<p>If you want to completely follow the whole HAT design process, you now have the option to make the transition from breadboard to proper circuit board. The Raspberry Pi Foundation specification also sets the physical properties of the board, right down to the radius of the rounded corners and the inclusion of slots for the camera and display cables. For prototyping, you probably needn’t worry about this too much; a simple stripboard design is available in the GitHub repository for this tutorial, and is pictured in the main image. If you want to take things even further, the marvellous Fritzing CAD software has a built-in PCB template that can help you produce a final design suitable for manufacture.</p>
<h3>Code listing</h3>
<p><a href="https://github.com/topshed/MYOH">myoh-rgb.py</a></p><pre class="crayon-plain-tag">from gpiozero import RGBLED
from time import sleep

led = RGBLED(22,27,17)

led.on()
sleep(0.5)
led.off()
led.red = 1
sleep(0.5)
led.red =0
led.green=1
sleep(0.5)
led.green = 0
led.blue = 1
sleep(0.5)
led.blue=0</pre><p></p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/make-your-own-hat/">Make your own Pi HAT</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/make-your-own-hat/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Sniffur &#8211; dog tracker</title>
		<link>https://www.raspberrypi.org/magpi/sniffur-dog-tracker/</link>
		<comments>https://www.raspberrypi.org/magpi/sniffur-dog-tracker/#disqus_thread</comments>
		<pubDate>Wed, 16 Mar 2016 10:29:50 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[dog]]></category>
		<category><![CDATA[estimote]]></category>
		<category><![CDATA[location tracking]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1730</guid>
		<description><![CDATA[<p>Matt Reed always knows where Bean the dog is, thanks to his beacon-powered Sniffur system</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/sniffur-dog-tracker/">Sniffur &#8211; dog tracker</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>We love animals here at The MagPi, so when we heard about a Raspberry Pi dog-tracker called ‘Sniffur’, we had to learn more.</p>
<p>Sniffur uses tracking technology called ‘beacons’; these are relatively new devices being placed in department stores to track the precise location of customers.</p>
<p><em>The full article can be found in <a href="/magpi/issues/42">The MagPi 42</a> and was written by Lucy Hattersley</em></p>
<p>Sniffur flips this idea on its head, by putting the beacon on a moving object and using three Raspberry Pis to detect where it is. The object in question is Bean, an adorable greyhound adopted by Redpepper, a marketing agency in Nashville, Tennessee. </p>
<p>“We’re a culture-first company,” says <a href="http://mcreed.com/">Matt Reed</a>, the project’s maker. “A lot of us have dogs or pets in some form, so part of us being happy is knowing our pets are happy. It doesn’t hurt that our CEO also has two dogs.</p>
<p>“Bean is absolutely the sweetest dog. Very shy, timid, loving. She wanders around into people’s offices and just stands next to their desks waiting for rubs, then just wanders on to the next spot.”</p>
<div id="attachment_1733" style="width: 1510px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/Sniffur_Step1.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/Sniffur_Step1.jpg" alt="The beacon on Bean&#039;s collar allows her to be tracked around the office" width="1500" height="1000" class="size-full wp-image-1733" /></a><p class="wp-caption-text">The beacon on Bean&#8217;s collar allows her to be tracked around the office</p></div>
<p>But all dogs like to go out and play. “When [greyhounds] do, they are very hard to catch because they are so fast,” Matt tells us. “They are the second-fastest land animal after the cheetah: top speed 43mph. Greyhounds also have a high prey drive; if they see a squirrel then it’s ‘bye bye’.</p>
<p>“The need to know where she is at any moment and see if she’s close to the front doors is the reason Sniffur was built,” continues Matt. “We have done retail experiments using <a href="http://estimote.com/">Estimotes</a> and constantly keep a stock of beacons available in our lab for experimentation.</p>
<p>“I grabbed one of the Estimote beacons from the lab and zip-tied it to Bean’s collar. Usually, beacons are attached in stationary physical locations, but Bean is now a mobile beacon transmitting a polling signal everywhere she goes.</p>
<p>“I put a Bluetooth USB dongle into three Raspberry Pis and coded them to listen for Bean’s Unique Beacon ID,” reveals Matt.</p>
<div id="attachment_1734" style="width: 1510px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/Sniffur_Beacon.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/Sniffur_Beacon.jpg" alt="The bluetooth ping from this beacon is picked up by the Raspberry Pis in the office" width="1500" height="1067" class="size-full wp-image-1734" /></a><p class="wp-caption-text">The bluetooth ping from this beacon is picked up by the Raspberry Pis in the office</p></div>
<p>One value transmitted by a beacon is RSSI (received signal strength indicator). This is the distance of a beacon from the antenna. “I’ve referred to it as triangulation because everyone knows what that means,” says Matt, “but I’ve recently learned on Hackaday that ‘trilateration’ is the correct term, because I’m calculating distance instead of geometry.” </p>
<p>Matt built an app for the iPad to display Bean’s location. “It’s just an HTML, JavaScript and CSS page that connects over the local WiFi network to the three Raspberry Pis,” he explains.</p>
<p>“I think this could be a fun project for anyone looking to familiarise themselves with beacons. A cheaper version would be to use one Pi to generate a single radius distance from that antenna. </p>
<p>You could also set an antenna by an exit and just throw an alarm, flash lights or lock the door, whenever the roaming beacon comes within range. </p>
<p>“Hmm,” ponders Matt, “that is actually not a bad idea. I think Sniffur is fun from a visualisation standpoint, but from a practical standpoint something more proactive might be better.”</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/sniffur-dog-tracker/">Sniffur &#8211; dog tracker</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/sniffur-dog-tracker/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>LCD Control Case review</title>
		<link>https://www.raspberrypi.org/magpi/lcd-control-case-review/</link>
		<comments>https://www.raspberrypi.org/magpi/lcd-control-case-review/#disqus_thread</comments>
		<pubDate>Tue, 15 Mar 2016 10:38:16 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[case]]></category>
		<category><![CDATA[lcd screen]]></category>
		<category><![CDATA[sb components]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1725</guid>
		<description><![CDATA[<p>A simple case for mini-LCD Raspberry Pi screens - how does it hold up under proper use?</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/lcd-control-case-review/">LCD Control Case review</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>We reviewed the <a href="https://www.raspberrypi.org/magpi/spi-box-review/">SPI-Box from SB Components</a> recently, a custom case for the Raspberry Pi 2 and B+ (although it would probably fit a Pi 3 just fine) that allows for a motion sensor and a Pi Camera Module to poke out of the case. With the bundled software, this means you have a functional and cheap security camera, with plenty of software bells and whistles to make it genuinely useful. Using a similar design ethos, SB Components has also created a special case for using a 3.2˝ LCD touchscreen with the Pi in a proper enclosure: the <a href="http://www.sbcshop.co.uk/32-tft-lcd-transparent-case-for-raspberry-pi-3-and-raspberry-pi-2-clear-391-p.asp">LCD Control Case</a>. It’s very inexpensive as well.</p>
<p><em>The full article can be found in <a href="/magpi/issues/42">The MagPi 42</a></em></p>
<p>The case comes in three parts: a base that’s near enough identical to the SPI-Box’s design, along with an interstitial layer to protect some of the Pi components from the screen, and finally a top part that fits snugly over the Pi and screen. Like the SPI-Box, the base has the Pi snapped very firmly in place; possibly a little too firmly, as removing it again can be a little bit of an undertaking.</p>
<div id="attachment_1727" style="width: 1010px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/lcd2.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/lcd2.jpg" alt="The Raspberry Pi fits snugly in the case" width="1000" height="665" class="size-full wp-image-1727" /></a><p class="wp-caption-text">The Raspberry Pi fits snugly in the case</p></div>
<p>Putting an LCD screen over the interstitial layer and then enclosing it with the top is very easy – a lot of Pi mini TFT screens only use the first 26 GPIO pins, a legacy from the original Raspberry Pi design. The interstitial layer only opens up these pins, meaning there’s no confusion. The entire screen is then accessible through the case, and even the usual array of microswitches (like on the Adafruit screen) can be accessed via little pinprick holes. Think a reset switch on an old piece of electronics – just try to avoid using something sharp.</p>
<p>With the case alone, you have an excellent addition to a Raspberry Pi you’re using with a touch LCD screen. It’s sturdy, very easy to construct, and microswitch access is quite neat as well – normally those sort of switches are forgotten in these cases. Crucially, there’s also more than enough room to use the full screen. In addition, it has mounts to fix to the wall, much like the SPI-Box does. As it technically only needs power and maybe a wireless dongle, it can be a great portable Pi or a cheap home automation controller on the wall – the only thing really hampering that is the depth of the full unit, although that’s not the case’s fault.</p>
<p>If you like the idea of the screen and case but are baulking at the idea of buying a screen, assembling it, and then making the whole setup work on your Raspberry Pi, then SB Components also offers a <a href="http://www.sbcshop.co.uk/32-tft-lcd-with-transparent-case-bundle-8gb-card-power-supply--wifi-adaptor-black-400-p.asp">bundle kit</a>. At only £29.99 ($43) on top of the Raspberry Pi, you basically get the kit to create a portable Pi for just over £50 in total.</p>
<div id="attachment_1728" style="width: 1010px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/lcd1.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/lcd1.jpg" alt="Everything is snug in the case, and it doesn&#039;t look half-bad either" width="1000" height="665" class="size-full wp-image-1728" /></a><p class="wp-caption-text">Everything is snug in the case, and it doesn&#8217;t look half-bad either</p></div>
<p>The bundle comes with a compatible mini touchscreen that works with the Pi and the case, a power supply, a WiFi dongle, and a pre-prepared SD card. As it’s the exact same case, construction is the same; the real treat, however, is the SD card.</p>
<p>In the past, preparing Raspbian to work with these touchscreens was not a quick process. It’s slightly easier now, thanks to more readily available images. Even so, it’s nice to have one that just works out of the box. It still runs modern Raspbian, which includes the interface update from just over a year ago. It’s a little tricky to use on this size of touchscreen, but it’s not completely unusable. At the very least, it leaves it open for you to create your own custom interface and it can also access the SPI-Box, which is a nice little addition.</p>
<p>Both versions of the LCD case are great value for money, especially as they fill a slightly niche market for people using or wanting to use this type of screen. It’s easy to modify the microswitch holes to be slightly more usable as well, so you can improve it with the right know-how. Whether you want the beginnings of a portable Pi or a touchscreen remote, you can’t go far wrong with this.</p>
<h3>Last word</h3>
<p>4/5</p>
<p>A sturdy and well-presented box that is as good as any other for using one of the small touchscreen displays, opening up a world of possibilities for other projects and uses.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/lcd-control-case-review/">LCD Control Case review</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/lcd-control-case-review/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweet from Raspberry Pi with Wolfram</title>
		<link>https://www.raspberrypi.org/magpi/tweet-from-raspberry-pi-with-wolfram/</link>
		<comments>https://www.raspberrypi.org/magpi/tweet-from-raspberry-pi-with-wolfram/#disqus_thread</comments>
		<pubDate>Mon, 14 Mar 2016 10:17:13 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Step by Step]]></category>
		<category><![CDATA[automation]]></category>
		<category><![CDATA[twitter]]></category>
		<category><![CDATA[wolfram]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1718</guid>
		<description><![CDATA[<p>How to easily send tweets in the Wolfram Language, using the SendMessage function</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/tweet-from-raspberry-pi-with-wolfram/">Tweet from Raspberry Pi with Wolfram</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>The Wolfram Language is a powerful knowledge-based language that makes computation accessible to everyone, and is an easy language to dip your toes into as a first-time programmer. To send tweets from Twitter on your Raspberry Pi, all you need is a single function. We’ll be using SendMessage, which is a multipurpose function in the Wolfram Language that gives Raspberry Pi users the ability to seamlessly tweet from their device.</p>
<p><em>The full article can be found in <a href="/magpi/issues/42">The MagPi 42</a> and was written by Dana Flinn and Brett Haines</em></p>
<p>Using the SendMessage function, we&#8217;ll walk you through how to apply the symbolic language and tweet using your Raspberry Pi. Don’t feel limited to just tweeting with this function, though! SendMessage can also be used to generate an email, update a Facebook or LinkedIn status, and generate a beep.</p>
<h3>You&#8217;ll need</h3>
<p>A Twitter account<br />
<a href="http://reference.wolfram.com/language/">The Wolfram Language Documentation Center</a><br />
Internet access</p>
<p><strong>STEP-01</strong> Prepare the syntax</p>
<p>First, you need to launch your copy of Mathematica on your Raspberry Pi and open a blank notebook. With over 5,000 functions built into the Wolfram Language, it can seem intimidating at first. However, using the Documentation Center will make it simple to find the right function for your project.</p>
<p>In the Wolfram Language, all functions use square brackets and have names that start with capital letters. The function needed for this project is SendMessage, which is rather straightforward. It’s used to send a message to a specified channel, which in our case is Twitter.</p>
<p><strong>STEP-02</strong> Setting up your code</p>
<p>To set up your code, open Mathematica on your Pi and type the SendMessage function, then the text you want your tweet to say. So, from the Documentation Center, we know it should be set up like this:</p><pre class="crayon-plain-tag">SendMessage["Twitter", "Tweet text"]</pre><p>Where it says “Tweet text”, the text can be changed to anything you want posted to your Twitter account.</p>
<p><strong>STEP-03</strong> Evaluate your code</p>
<p>Once you’ve typed that in, press SHIFT+ENTER. This will run your code in Mathematica and prompt an authorisation dialogue to allow the Wolfram Language to send tweets on your behalf. Once authorised, a tweet is sent to your account. Select ‘Done’ after entering the access key, and the tweet will appear in your Twitter stream.</p>
<p><strong>STEP-04</strong> Create a variable</p>
<p>The previous example showed a static string being tweeted. However, this is far from all the Wolfram Language is capable of. Much like other programming languages, it allows users to set variables, in which we can store whatever we like. To create a variable, just type the name you want to give it, an equals sign, then whatever you want to assign to the variable, like so:</p><pre class="crayon-plain-tag">myVariable = "Some string here!"</pre><p>Unlike several other programming languages, you don’t need to specify what kind of data is being stored in your variables – the Wolfram Language is smart enough to figure out what it is and how to use it on its own!</p>
<p><strong>STEP-05</strong> Using StringJoin</p>
<p>You can combine strings using the StringJoin function. Just like SendMessage, StringJoin is used by putting the strings you want to join in between square brackets ([ and ]), separated by commas. So, to join “Hello ” and “world”, you’d enter:</p><pre class="crayon-plain-tag">StringJoin["Hello ", "world"]</pre><p>This isn’t limited to static strings – variables can be joined to strings too, like so:</p><pre class="crayon-plain-tag">StringJoin["Hello ", myVariable]</pre><p></p>
<p><strong>STEP-06</strong> Combining it all</p>
<p>Now it’s time to put it all together. We can take a variable, store a string to it, join it to another string, then send it to Twitter:</p><pre class="crayon-plain-tag">myName = "WolframLanguage"
SendMessage["Twitter", StringJoin["This tweet brought to you by ", myName]]</pre><p>Now that you know how functions work in the Wolfram Language, it’s easy to dive into the documentation and explore the thousands of functions built in. Now go forth and code!</p>
<div id="attachment_1720" style="width: 1690px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/ExampleImage2.png"><img class="size-full wp-image-1720" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/ExampleImage2.png" alt="The full code is very simple, as shown here" width="1680" height="1050" /></a><p class="wp-caption-text">The full code is very simple, as shown here</p></div>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/tweet-from-raspberry-pi-with-wolfram/">Tweet from Raspberry Pi with Wolfram</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/tweet-from-raspberry-pi-with-wolfram/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Strato Pi makes Raspberry Pi more professional</title>
		<link>https://www.raspberrypi.org/magpi/strato-pi-makes-raspberry-pi-more-professional/</link>
		<comments>https://www.raspberrypi.org/magpi/strato-pi-makes-raspberry-pi-more-professional/#disqus_thread</comments>
		<pubDate>Fri, 11 Mar 2016 12:01:21 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[add-on board]]></category>
		<category><![CDATA[professional]]></category>
		<category><![CDATA[strato pi]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1714</guid>
		<description><![CDATA[<p>Pi add-on boards from Strato Pi add RTC, serial interfaces, buzzers, more LEDs and a hardware watchdog for maximum reliability</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/strato-pi-makes-raspberry-pi-more-professional/">Strato Pi makes Raspberry Pi more professional</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>At the launch event for the Raspberry Pi 3, Eben Upton revealed that there were plenty of industry customers for the Raspberry Pi, making up a significant percentage of those who have contributed to the eight million total of Raspberry Pis sold. Recently, Sfera Labs has launched a new line of Raspberry Pi add-on boards called <a href="http://www.sferalabs.cc/strato/">Strato Pi</a> designed for the professional applications these Pis are being used for.</p>
<p>The Strato Pi comes in two forms, the Base Board and the UPS. The Base Board has a long list of features so instead of editorialising them we&#8217;re just going to list them out:</p>
<ul>
<li>9-28Vdc power supply, with surge and reverse polarity protection</li>
<li>real time clock with on-board lithium back-up battery</li>
<li>standard RS-232 and RS-485 interfaces to the Raspberry Pi serial line, with opto-isolator and electrostatic discharge protection</li>
<li>on-board buzzer, connected to an I/O pin of the Raspberry Pi board, for acoustic feedback</li>
<li>on-board LEDs for power supply and serial line activity</li>
<li>power supply and serial connections on a screw terminal block</li>
</ul>
<p>Which is a lot of great stuff you don&#8217;t usually get on the Pi. The UPS board also adds an integrated uninterruptible power supply, UPS status and controls and a hardware watchdog. The watchdog is fully integrated into the board and independent of the Pi.</p>
<p>There&#8217;s also a pre-assembled server versions of the Strato Pis that come fully tested on Pi.</p>
<p>You can find out more information on the <a href="http://www.sferalabs.cc/strato/">Strato Pi website</a>. It&#8217;s definitely worth a look for more high-end uses of the Raspberry Pi.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/strato-pi-makes-raspberry-pi-more-professional/">Strato Pi makes Raspberry Pi more professional</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/strato-pi-makes-raspberry-pi-more-professional/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Location-tracking mountain model project</title>
		<link>https://www.raspberrypi.org/magpi/location-tracking-mountain-model-project/</link>
		<comments>https://www.raspberrypi.org/magpi/location-tracking-mountain-model-project/#disqus_thread</comments>
		<pubDate>Thu, 10 Mar 2016 11:14:32 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[3d printing]]></category>
		<category><![CDATA[kilimanjaro]]></category>
		<category><![CDATA[mountain]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1704</guid>
		<description><![CDATA[<p>When Kurt Hunter wanted to create a smart 3D model to show family and colleagues his progress while climbing Mount Kilimanjaro, he turned to the Raspberry Pi</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/location-tracking-mountain-model-project/">Location-tracking mountain model project</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>An LED lights up on a scale model placed on a kitchen counter in Washington State, USA, to signify that over 9,000 miles away in Tanzania, <a href="http://madisonmountaineering.com/">Kurt Hunter</a> has reached the summit of Mount Kilimanjaro. Climbing Africa’s highest peak had been a long-held ambition for Kurt. “Ever since moving to Seattle 20 years ago, I would look up at Mount Rainier and dream of climbing it,” he tells us. “After getting myself in shape in 2004, I did indeed climb it and got hooked on climbing. That year I set a goal of climbing Kilimanjaro, but never got around to it until [2015].”</p>
<p><em>The full article can be found in <a href="/magpi/issues/42">The MagPi 42</a></em></p>
<div id="attachment_1707" style="width: 2010px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/IMG_1250.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/IMG_1250.jpg" alt="Mount Kilimanjaro from a distance" width="2000" height="1333" class="size-full wp-image-1707" /></a><p class="wp-caption-text">Mount Kilimanjaro from a distance</p></div>
<p>In preparing for the two-week expedition, Kurt set himself another challenge. He wanted to combine his passion for 3D printing and programming in an interesting way, to enable his family and co-workers to follow along with his climb in a fun, visual experience. To this end, he set about creating a Raspberry Pi 2-powered 1:100,000 scale model of Kilimanjaro, complete with LEDs to mark the spots of all his planned camps, along with the summit itself. The location data would be supplied by a personal GPS locator device, via his own RainOn web-based tracking solution.</p>
<h3>Model making</h3>
<p>Kurt spent a weekend designing the 3D model in the Blender CAD program, using accurate elevation data for Kilimanjaro gleaned from <a href="http://viewfinderpanoramas.org/dem3.html">Viewfinder Panoramas</a> – with some extra tips from <a href="http://www.the3dprintedfuture.com/shapespeare/?cat=3">All&#8217;s Well That Prints Well</a> – and calculating the physical offsets for the surface holes required for the LEDs. The model needed to be tall enough to contain the Raspberry Pi, mounted on a removable base panel, and include cut-outs for its power and Ethernet connections (via extension cables). The final 150×150mm model was then 3D printed using a PrintrBot Metal Simple, a process that took 26.5 hours to complete.</p>
<div id="attachment_1708" style="width: 2458px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/Hollowed-out-model.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/Hollowed-out-model.jpg" alt="The printed out model" width="2448" height="2448" class="size-full wp-image-1708" /></a><p class="wp-caption-text">The printed out model</p></div>
<p>Once the support scaffolding was removed to hollow out the model, it was time to wire it up. “The biggest labour component was soldering up the individual LEDs and resistors to the GPIO ribbon cable,” reveals Kurt. “The LEDs are held in place on the model by friction and silicon sealant.” While he didn’t encounter any major problems getting it working, since he’d already made a simple prototype with a breadboard, Kurt did discover a difference between the GPIO pin assignments on Windows IoT Core and Raspbian.</p>
<h3>Trip tracking</h3>
<p>When developing the Pi code for the project, Kurt was keen to evolve the RainOn Adventure Tech (rainon.com) web-based tracking system he’d developed for previous adventures as a Microsoft Azure solution. “Essentially, the system acquires real-time location data from a personal locator device, such as DeLorme inReach or SPOT, for a provisioned ‘trip’ like the Kilimanjaro expedition. It then provides geofence-based waypoint proximity notifications, among other features.”</p>
<div id="attachment_1709" style="width: 1510px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/boxout-1-step01.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/boxout-1-step01.jpg" alt="Mapping out the route" width="1500" height="1016" class="size-full wp-image-1709" /></a><p class="wp-caption-text">Mapping out the route</p></div>
<p>Each trip is a combination of an objective (typically the latitude/longitude of a mountain summit), a route (which can include a list of waypoints), and a start and end date/time. “The system polls the services of the personal locator manufacturer and retrieves the last reported location for each device assigned to an active trip. That retrieved location is tested against the geofence for each of the registered set of waypoints associated with the trip.”</p>
<p>The trips and waypoint information are created in advance. “For example, Kilimanjaro using the Machame Route that we climbed has six camps (in fixed locations) and the summit, plus the start and end locations, so that trip has nine associated waypoints, seven of which are on my 3D model. All of the data is stored in a SQL Server database which also supports spatial data, so geofence tests and other geospatial calculations are super easy.”</p>
<h3>Coding the Pi</h3>
<p>When it came to programming the Raspberry Pi to process the location data, Kurt ended up using the Windows 10 IoT Core operating system. As a senior partner engagement manager in his day job at Microsoft, Kurt was already well versed in Windows and its Visual Studio developer tools. Even so, he tells us he also developed a Python version of the code under Raspbian, but found the Windows 10 IoT Core / Visual Studio route much easier. “Three things were very attractive about using Windows 10 IoT Core: 1) Visual Studio is awesome (and familiar), 2) I could develop in C#, and 3) the remote debugging/deployment was super easy to set up and use.”</p>
<p>Based largely on Microsoft’s <a href="http://magpi.cc/1ndOkcN">Blinky example code</a>, Kurt’s program calls the RainOn Azure service API every ten minutes to obtain JSON location data. If this is within a geofence, set at a 200m radius, for one of the camps or the summit, the corresponding LED is lit.</p>
<h3>Testing it out</h3>
<p>To check everything was working properly before leaving for Tanzania, Kurt used the Postman test tool to call on his RainOn APIs and simulate data from the personal locator device. “I also use Google Earth quite a bit to find the lat/long of various places and measure distances. So I tested the system by sending simulated locations near the waypoints. When I first developed the geofence/waypoint feature, I did actually use local locations and drive around in my car with the device to test it.”</p>
<div id="attachment_1710" style="width: 1440px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/Model-lit-up.png"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/Model-lit-up.png" alt="The model lit up the way it should do as Kurt reached each way point" width="1430" height="1073" class="size-full wp-image-1710" /></a><p class="wp-caption-text">The model lit up the way it should do as Kurt reached each way point</p></div>
<p>When it came to the actual Kilimanjaro climb, everything worked, although Kurt admits he could have used more error checking and recovery. “The system worked in real-time and the waypoint LEDs stay lit after I had reached that location. However, if the power went out then only future waypoints would light up, as I didn’t store the previously reached waypoints in the Pi, nor did I report the history in my web APIs. So, sometime between camp three and four, this happened to the setup I had in my office window, but the one at home worked for the whole climb.”</p>
<h3>Always another mountain</h3>
<p>Kurt admits that a few shortcuts and compromises had to be made in the last-minute rush to get the project completed in time for the Kilimanjaro trip. Given more time, Kurt says he would have liked to use the Pi’s HDMI output to provide an animated map view and real-time data and graph displays. He plans to make improvements to the system for future expeditions. “I would very much like to figure out a way to show more discrete climbing progress on the model, rather than a single LED per day. I’ve thought about a number of ways that I’ve found to be impractical: light pipe projector from an LCD panel, laser, tight string of tiny LEDs… I’m looking for an idea!”</p>
<p>As for the experience of climbing Kilimanjaro, Kurt tells us it was awesome. “The climb itself takes seven days and you hike through four climatic zones before reaching the summit: rainforest, heather and moorland, alpine desert, and finally arctic above 5,000m &#8211; the summit is 5,895m. It’s really quite amazing and the local staff make the experience so enjoyable. Every afternoon, when we reached camp, the staff would sing and dance with us… The view from the summit is spectacular as you arrive at sunrise, well above the clouds, and can see for miles and miles.”</p>
<div id="attachment_1711" style="width: 1010px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/IMG_1152.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/IMG_1152.jpg" alt="A successful climb" width="1000" height="1500" class="size-full wp-image-1711" /></a><p class="wp-caption-text">A successful climb</p></div>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/location-tracking-mountain-model-project/">Location-tracking mountain model project</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/location-tracking-mountain-model-project/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Ubuntu Pi Flavour Maker review</title>
		<link>https://www.raspberrypi.org/magpi/ubuntu-pi-flavour-maker-review/</link>
		<comments>https://www.raspberrypi.org/magpi/ubuntu-pi-flavour-maker-review/#disqus_thread</comments>
		<pubDate>Wed, 09 Mar 2016 10:14:29 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Reviews]]></category>
		<category><![CDATA[kubuntu]]></category>
		<category><![CDATA[lubuntu]]></category>
		<category><![CDATA[mate]]></category>
		<category><![CDATA[operating system]]></category>
		<category><![CDATA[ubuntu]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1697</guid>
		<description><![CDATA[<p>More flavours of Ubuntu for your Raspberry Pi. Does the Pi provide enough power for them, though?</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/ubuntu-pi-flavour-maker-review/">Ubuntu Pi Flavour Maker review</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>If you’ve been following Raspberry Pi long enough, you may know that early on in its life there was a call for Ubuntu to be used as an operating system for it. As one of, if not the most popular, version of Linux for home users, this distro was wanted by many seeking something familiar for their new tiny computer. It never came to be. However, as Ubuntu is based on Debian, Raspbian was basically the next best thing.</p>
<p><em>The full article can be found in <a href="/magpi/issues/42">The MagPi 42</a>. Ubuntu Pi was tested on the Raspberry Pi 2 before Raspberry Pi 3&#8217;s release</em></p>
<p>When the Raspberry Pi 2 came out, this changed with the release of Ubuntu MATE for the Pi, and this opened the door to more ‘versions’ of Ubuntu &#8211; or, at least, different desktop environments running on Ubuntu. <a href="https://ubuntu-pi-flavour-maker.org/">Ubuntu Pi Flavour Maker</a> is one of the results of this.</p>
<p>At its core, Flavour Maker is a series of scripts that allow you to build a slightly custom version of Ubuntu for the Raspberry Pi. It uses the all-important armhf build of Ubuntu that’s optimised for the type of chip running on the Pi 2, giving you options for different software and desktops, and even the choice between server and desktop versions depending on your needs.</p>
<p>That may sound a little complicated for some more novice users, but don’t worry – the kind folk who make the software have created a series of images you can install to an SD card, much like any Raspberry Pi operating system. On tap are two versions of Ubuntu Server: one a very minimal install for maximum speed, and a regular install if you need more software. There are also three ‘spins’ that use different desktops: LXDE, Xfce, and MATE. LXDE and Xfce are common lightweight desktop interfaces used on low-powered PCs; Raspbian has used LXDE, or at least a version of it, since it came out.</p>
<div id="attachment_1701" style="width: 1290px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/mate.png"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/mate.png" alt="There various versions you can get, from server to different desktop environments" width="1280" height="719" class="size-full wp-image-1701" /></a><p class="wp-caption-text">There various versions you can get, from server to different desktop environments</p></div>
<h3>Booting up</h3>
<p>How do they actually run, then? Much like the normal Ubuntu, there are a few setup steps on your first boot, although the main installation has already occurred so it’s a little truncated. Settings such as locale and keyboard are sorted before booting you into the desktop, although this does take a few minutes to actually occur. Each successive boot is much faster, though, albeit nowhere near the speed of booting into Raspbian.</p>
<p>The OS is presented in a very different way from Raspbian. Whereas much of Raspbian is optimised for the Raspberry Pi, with a lot of educational tools in there as well, the Ubuntu spins are more a traditional desktop – no programming tools installed as standard, and using normal programs as well.</p>
<p>A novelty compared to Raspbian is the addition of a graphical package manager. Both Software Centres and classic Synaptic are available, giving users a way to search for software they may want, which Raspbian currently doesn’t let you do easily. As this is based on Ubuntu armhf, the selection isn’t as broad as in the full version of Ubuntu, but it’s still very good. A lot of major software is available, with the only real limit being the power and performance of the Raspberry Pi 2 running Ubuntu.</p>
<div id="attachment_1699" style="width: 1834px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/ubuntu1.png"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/ubuntu1.png" alt="You can install software slightly easier on Ubuntu Pi" width="1824" height="984" class="size-full wp-image-1699" /></a><p class="wp-caption-text">You can install software slightly easier on Ubuntu Pi</p></div>
<p>Due to its use of more standard software, Ubuntu can lag a bit on the Raspberry Pi 2. Firefox is the default browser, and while a lightweight alternative like Midori is available, it’s not always fast and responsive. It feels like how the browser used to be on the original Raspberry Pi – functional, but a little frustrating to use after a while. Video on YouTube seems right out as well, if you want to watch anything larger than 360p.</p>
<p>It’s not all slow, though. With the right selection of packages and the right use case, it can be just fine. Ubuntu is a slightly more resource-heavy base than Debian as it is, so for anything requiring the extra power, it was never going to be the operating system or distro of choice. The Xfce version does run the best out of the three, but Raspbian is still better in terms of performance.</p>
<p>As a desktop system, though, it’s better. With a few modifications to the default apps, it’s perfectly usable as one, and looks a bit more the part than Raspbian as well. For projects and more niche uses, however, it looks like Raspbian is still king.</p>
<h3>Last word</h3>
<p>3/5</p>
<p>It was never going to be as quick as Raspbian, but it’s a fantastic effort that adds some more variety to the operating systems available for the Raspberry Pi.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/ubuntu-pi-flavour-maker-review/">Ubuntu Pi Flavour Maker review</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/ubuntu-pi-flavour-maker-review/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Build a binary clock</title>
		<link>https://www.raspberrypi.org/magpi/binary-clock/</link>
		<comments>https://www.raspberrypi.org/magpi/binary-clock/#disqus_thread</comments>
		<pubDate>Tue, 08 Mar 2016 10:05:21 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Walkthrough]]></category>
		<category><![CDATA[binary clock]]></category>
		<category><![CDATA[everyday engineering]]></category>
		<category><![CDATA[sense hat]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1686</guid>
		<description><![CDATA[<p>Solve real-world electronic and engineering problems with your Raspberry Pi and the help of renowned technology hacker<br />
and author, Simon Monk</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/binary-clock/">Build a binary clock</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>This is a very simple project to make. In fact, all you really need to do is plug the Sense or Unicorn HAT onto the Raspberry Pi’s GPIO header and install the software.</p>
<p>This project displays the current time in binary. The rows of the display are (from top to bottom) the last two digits of the year (e.g. 15), the month number, the day of the month, the hour (24-hour format), the minute, the second, and finally hundredths of a second.</p>
<p><em>The full article can be found in <a href="/magpi/issues/42">The MagPi 42</a> and was written by Simon Monk</em></p>
<h3>You&#8217;ll Need</h3>
<p>Raspberry Pi with 40-pin GPIO header (A+, B+, 2 and 3)</p>
<p><a href="https://www.raspberrypi.org/products/sense-hat/">Sense HAT</a> or <a href="https://shop.pimoroni.com/products/unicorn-hat">Pimoroni Unicorn HAT</a></p>
<p>USB WiFi adaptor or Ethernet connection</p>
<h3>Reading the binary clock</h3>
<p>To read a binary clock, you either need to be good at recognising binary numbers or use a bit of arithmetic to calculate the time, by adding up the binary digit values for the LEDs that are lit on a particular row.</p>
<p>For example, the first row displays the year in two-digit format. So, if LEDs at positions 8, 4, 2, and 1 are all lit, then the year is 8+4+2+1 = 15. In 2016, just the digit position 16 will be lit.</p>
<p>The colours of the LEDs have no significance – they are different to make the display more interesting.</p>
<div id="attachment_1688" style="width: 2010px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/binary_clock.jpg"><img class="size-full wp-image-1688" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/binary_clock.jpg" alt="How to read the binary clock" width="2000" height="1333" /></a><p class="wp-caption-text">How to read the binary clock</p></div>
<p>If you’re using the Sense HAT, you’ll need to install the software for the HAT using the following commands:</p><pre class="crayon-plain-tag">sudo apt-get update
sudo apt-get install sense-hat
sudo pip-3.2 install pillow</pre><p>If you’re using a Unicorn HAT, then run the following commands:</p><pre class="crayon-plain-tag">sudo apt-get install python-pip python-dev
sudo pip install unicornhat</pre><p>There are two versions of the software for this project – one for the Sense HAT and one for the Pimoroni Unicorn HAT – so be sure to use the right version of the program for your hardware. The Sense HAT version is called binary_clock_sh.py, and the Unicorn version binary_clock_uni.py.</p>
<p>You can download the programs for this project from your Raspberry Pi command line using the command:</p><pre class="crayon-plain-tag">git clone https://github.com/simonmonk/pi_magazine.git</pre><p>This command will actually bring down the code for all the projects in Simon’s The MagPi series, so if you’ve already issued this command for one of the earlier articles, change directory to pi_magazine and run the following command to update your directory with this project (12_binary_clock):</p><pre class="crayon-plain-tag">git pull</pre><p>We&#8217;re also listing the code at the bottom of the page.</p>
<p>To run the program, change to the directory where the code for this project lives and then run the program using the commands below:</p><pre class="crayon-plain-tag">cd /home/pi/pi_magazine/12_binary_clock
sudo python binary_clock_sh.py</pre><p>Or, if you are using the Unicorn HAT:</p><pre class="crayon-plain-tag">sudo python binary_clock_uni.py</pre><p></p>
<h3>How the code works</h3>
<p>The two versions are actually very similar to each other. Both start by importing the libraries that they need for their displays. They then define a number of colour variables that you can change, if you like, in order to set different colours for each row of the clock.</p>
<p>Most of the action takes place in the display_binary function. This takes three parameters. The first is the value to be displayed as binary, the second is the row on which it should be displayed (0 to 7), and the final parameter is the colour to be displayed.</p>
<p>The value is converted into a binary string representation using String’s format function. The for loop then iterates over each column (x value) and if that digit contains a 1, turns on the pixel in that row and column to the colour specified, otherwise the pixel is cleared.</p>
<p>The main loop fetches the current time and then splits it into its component parts, displaying each on a separate row. To display the year in two-digit format, we use modulo 100 (t.year % 100), which is the remainder after dividing it by 100.</p>
<h3>Using your binary clock</h3>
<p>Having a keyboard, mouse and monitor attached to your clock is fine while you are constructing it, but it would be better to have the program start automatically when the Raspberry Pi first boots up. To do this, run the following command to make the program executable:</p><pre class="crayon-plain-tag">sudo chmod +x binary_clock_*.py</pre><p>Then, edit the file /etc/rc.local with the command:</p><pre class="crayon-plain-tag">sudo nano /etc/rc.local</pre><p>Add the following line after the first block of comment lines that begin with #. Change the line to the _uni version if you are using a Unicorn HAT.</p><pre class="crayon-plain-tag">sudo /home/pi/pi_magazine/12_binary_clock/binary_clock_sh.py &amp;</pre><p>Restart your Raspberry Pi and this time the program should start up automatically.</p>
<p>Note that you will still need an internet connection for the Pi to pick up the correct time.</p>
<h3>Code listing</h3>
<p>binary_clock_sh.py</p><pre class="crayon-plain-tag">#!/usr/bin/env python

from sense_hat import SenseHat
import time, datetime

hat = SenseHat()

year_color = (0, 255, 0)
month_color = (0, 0, 255)
day_color = (255, 0, 0)
hour_color = (0, 255, 0)
minute_color = (0, 0, 255)
second_color = (255, 0, 0)
hundrefths_color = (127, 127, 0)
off = (0, 0, 0)

hat.clear()

def display_binary(value, row, color):
	binary_str = “{0:8b}”.format(value)
	for x in range(0, 8):
		if binary_str[x] == ‘1’:
			hat.set_pixel(x, row, color)
		else:
			hat.set_pixel(x, row, off)

while True:
	t = datetime.datetime.now()
	display_binary(t.year % 100, 0, year_color)
	display_binary(t.month, 1, month_color)
	display_binary(t.day, 2, day_color)
	display_binary(t.hour, 3, hour_color)
	display_binary(t.minute, 4, minute_color)
	display_binary(t.second, 5, second_color)
	display_binary(t.microsecond / 10000, 6, hundrefths_color)
	time.sleep(0.0001)</pre><p>binary_clock_uni.py</p><pre class="crayon-plain-tag">#!/usr/bin/env python

import unicornhat as hat
import time, datetime

year_color = (0, 255, 0)
month_color = (0, 0, 255)
day_color = (255, 0, 0)
hour_color = (0, 255, 0)
minute_color = (0, 0, 255)
second_color = (255, 0, 0)
hundrefths_color = (127, 127, 0)
off = (0, 0, 0)

hat.clear()
hat.brightness(0.5)

def display_binary(value, row, color):
	binary_str = “{0:8b}”.format(value)
	for x in range(0, 8):
		if binary_str[x] == ‘1’:
			hat.set_pixel(x, row, color[0], color[1], color[2])
		else:
			hat.set_pixel(x, row, 0, 0, 0)

while True:
    t = datetime.datetime.now()
    display_binary(t.year % 100, 0, year_color)
    display_binary(t.month, 1, month_color)
    display_binary(t.day, 2, day_color)
    display_binary(t.hour, 3, hour_color)
    display_binary(t.minute, 4, minute_color)
    display_binary(t.second, 5, second_color)
    display_binary(t.microsecond / 10000, 6, hundrefths_color)
    hat.show()
    time.sleep(0.0001)</pre><p></p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/binary-clock/">Build a binary clock</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/binary-clock/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zoe the Zero quadcopter</title>
		<link>https://www.raspberrypi.org/magpi/zoe-the-zero-quadcopter/</link>
		<comments>https://www.raspberrypi.org/magpi/zoe-the-zero-quadcopter/#disqus_thread</comments>
		<pubDate>Mon, 07 Mar 2016 10:05:55 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Projects]]></category>
		<category><![CDATA[drone]]></category>
		<category><![CDATA[pi zero]]></category>
		<category><![CDATA[quadcopter]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1678</guid>
		<description><![CDATA[<p>The first in what will more than likely be a swarm of Pi Zero-powered drones, Zoe the Zero is the continuation of a long-held dream</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/zoe-the-zero-quadcopter/">Zoe the Zero quadcopter</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>When we were planning issue 40 of The MagPi with its cover-mounted Pi Zero, we had a big brainstorm about the kind of projects we could do for features, and maybe also as future covers. One thing that we noted was that the Pi Zero could be great for powering quadcopters and other drones. In just over a month since the issue hit shelves, Andy Baker managed to start the trend and create his own drone.</p>
<p><em>The full article can be found in <a href="/magpi/issues/42">The MagPi 42</a></em></p>
<p>“I completed my first Pi project (a wheeled ‘Turtle’ robot) in December 2012,” Andy tells us. “I wanted to move on to something that was a real challenge, and quadcopters were just starting to appear commercially. I was completely ignorant of how they worked, so I wanted to fill that gap in my understanding and have some fun at the same time.”</p>
<div id="attachment_1680" style="width: 2494px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/step2.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/step2.jpg" alt="Hovering gently above the ground" width="2484" height="1268" class="size-full wp-image-1680" /></a><p class="wp-caption-text">Hovering gently above the ground</p></div>
<p>Andy has spent the last few years building, testing, and experimenting to create his very own quadcopter from scratch: “I haven’t finished yet, primarily because I actually wanted to work it out all by myself, without borrowing anyone else’s code or guidance. There was a lot of experimentation and learning involved, including a lot of wasted time taking the wrong direction and backing up when I hit a metaphorical brick wall &#8211; or, more precisely, when I couldn’t stop the quad from hitting a physical brick wall.”</p>
<p>The Raspberry Pi Zero helped Andy bring Zoe back and make it operational again after a few tweaks. The years-long creation wasn’t always so quick or simple, though.</p>
<p>“Other than having a custom HAT PCB, the physical build is very simple due to the off-the-shelf combination of frame, motors, and props,” says Andy. “But the software interfacing to hardware was a major challenge and the testing is expensive; the innate instability of a quadcopter means any imperfections ultimately end with a crash and corresponding hardware damage. Despite it ‘only’ costing about £200 to build the Pi Zero quadcopter from scratch, it’s cost me more than ten times that over the last few years to reach this stage.”</p>
<div id="attachment_1681" style="width: 2042px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/Zoe1.jpg"><img src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/Zoe1.jpg" alt="The Pi Zero looks a bit dwarfed by Zoe, but powers it just fine" width="2032" height="1116" class="size-full wp-image-1681" /></a><p class="wp-caption-text">The Pi Zero looks a bit dwarfed by Zoe, but powers it just fine</p></div>
<p>Interestingly enough, Andy doesn’t plan to really use the drone as such, instead treating it as a challenge to just make it work.</p>
<p>“If it ever reaches that stage, I’ll almost certainly shelve the project as complete and start on something new – perhaps a fusion reactor, or infinite improbability drive. But at the moment, there’s plenty of interesting stuff I can add to the very basic quad I have now to keep me interested for a long time yet.”</p>
<p>While it may have taken Andy years, there’s now a lot more info and kits available to take a few shortcuts with. Hopefully, in the future, we can show you how to create your own quadcopter.</p>
<p><em>You can read all about the development of Zoe on Andy&#8217;s blog, <a href="http://blog.pistuffing.co.uk/category/qcpi/">PiStuffing</a></em></p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/zoe-the-zero-quadcopter/">Zoe the Zero quadcopter</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/zoe-the-zero-quadcopter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Learn all about the Raspberry Pi 3 in The MagPi 43!</title>
		<link>https://www.raspberrypi.org/magpi/learn-all-about-the-raspberry-pi-3-in-the-magpi-43/</link>
		<comments>https://www.raspberrypi.org/magpi/learn-all-about-the-raspberry-pi-3-in-the-magpi-43/#disqus_thread</comments>
		<pubDate>Thu, 03 Mar 2016 10:42:27 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[astro pi]]></category>
		<category><![CDATA[eben upton]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[new issue]]></category>
		<category><![CDATA[raspberry pi 3]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1661</guid>
		<description><![CDATA[<p>We have Pi 3 interviews, specs, facts and tutorials to get you started with the latest, greatest Raspberry Pi. All this as well as a huge Astro Pi update and lots of new tutorials and projects.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/learn-all-about-the-raspberry-pi-3-in-the-magpi-43/">Learn all about the Raspberry Pi 3 in The MagPi 43!</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>As you may remember from earlier in the week, the Raspberry Pi 3 is here! The latest version of the Raspberry Pi is the most powerful one yet, and brings with it a whole host of new features such as wireless LAN, Bluetooth Classic and Bluetooth Low Energy. In <a href="https://www.raspberrypi.org/magpi/issues/43/">issue 43 of The MagPi</a>, we go in depth into all the changes, upgrades and differences that you can expect from the Raspberry Pi 3.</p>
<div id="attachment_1640" style="width: 1201px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/issues/43/"><img class="size-full wp-image-1640" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/008-009_TheMagPi43-SAMPLE.jpg" alt="Learn all about what's new with the Raspberry Pi 3" width="1191" height="842" /></a><p class="wp-caption-text">Learn all about what&#8217;s new with the Raspberry Pi 3</p></div>
<p>We also have an interview with Eben Upton and James Adams on the creation of the Raspberry Pi 3 and the wireless radio that makes the new headline features possible. There are tips and tutorials on how to get started with Raspberry Pi 3 and finally a full suite of benchmarks so you know just how much more powerful the Pi 3 is than its predecessors.</p>
<p><a href="https://www.raspberrypi.org/magpi/issues/43/">Issue 43</a> has more than just Raspberry Pi 3 though: there&#8217;s a big Astro Pi update as Ed and Izzy are turned on up in space, we look at an amazing Pi Zero cluster board, hack Minecraft with the Bedrock Challenge, and all our usual array of projects, tutorials and reviews.</p>
<div id="attachment_1639" style="width: 1201px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/issues/43/"><img class="wp-image-1639 size-full" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/03/052-053_TheMagPi43-SAMPLE.jpg" alt="Make a musical rhythm game in Python with Clef Hero" width="1191" height="842" /></a><p class="wp-caption-text">Make a musical rhythm game in Python with Clef Hero</p></div>
<p>The MagPi 43 is out right now in WH Smith, Asda, Tesco, and Sainsburys. It&#8217;s also available for purchase <a href="http://thepihut.com/collections/magpi/products/the-magpi-43">online</a> and you can download it in our <a href="https://play.google.com/store/apps/details?id=com.raspberry.magpi">Android</a> and <a href="https://itunes.apple.com/us/app/the-magpi-magazine/id972033560">iOS</a> app as well.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/learn-all-about-the-raspberry-pi-3-in-the-magpi-43/">Learn all about the Raspberry Pi 3 in The MagPi 43!</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/learn-all-about-the-raspberry-pi-3-in-the-magpi-43/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi 3 launch &#8211; as told by the community!</title>
		<link>https://www.raspberrypi.org/magpi/raspberry-pi-3-launch-community/</link>
		<comments>https://www.raspberrypi.org/magpi/raspberry-pi-3-launch-community/#disqus_thread</comments>
		<pubDate>Wed, 02 Mar 2016 12:38:26 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[adafruit]]></category>
		<category><![CDATA[lady ada]]></category>
		<category><![CDATA[pi 3]]></category>
		<category><![CDATA[raspberry pi 3]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1625</guid>
		<description><![CDATA[<p>We're firmly in the age of YouTube, so here's some of the best videos regarding the brand new Raspberry Pi 3</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/raspberry-pi-3-launch-community/">Raspberry Pi 3 launch &#8211; as told by the community!</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>The Raspberry Pi 3 launch on Monday was huge and a lot of people were very excited to see the brand new Raspberry Pi. Fans, educators and makers alike took to the internet to discuss it, causing Raspberry Pi 3 to be a Twitter moment! Some of you also went to YouTube with videos of unboxings and tests of the Pi 3, and we&#8217;ve rounded up some of our favourites.</p>
<p>First up is Alex Eames of RasPi.TV, taking you around the board of the new Pi 3.</p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/wTTa-24whdw?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>An unboxing from Average Man vs Pi that compares the Pi 3 to the Pi 2.</p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/ppbsaLZyF9E?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>The Raspberry Pi Guy shows us some gorgeous close-ups of the Raspberry Pi 3 in their video.</p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/Y2Z6b64eh2E?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>Lady Ada of Adafruit introduces the Raspberry Pi 3 with this very indepth, lengthy video</p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/DNM8EFbcNKk?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>Matt Richardson from the US Raspberry Pi offices shows off how the Bluetooth can be used to stream audio from videos</p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/q7WHSxBW3M4?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>See how well the Pi 3 performs with Kodi, even if the onboard wifi is working from inside a metal case</p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/w2z5UHCeu6o?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>The pi-top team shows how the Pi 3 compares to the Pi 2 on its own and in their hardware</p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/-XtxE7EZqug?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>Finally, Microsoft has a fantastic demo involving a powered-wheel and feedback loops with Pi 3 and Windows 10 IoT</p>
<p><iframe width="500" height="281" src="https://www.youtube.com/embed/p4vw3taOVyM?feature=oembed" frameborder="0" allowfullscreen></iframe></p>
<p>We hope you enjoy these videos, and remember, The MagPi 43 with even more Raspberry Pi 3 content is out tomorrow!</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/raspberry-pi-3-launch-community/">Raspberry Pi 3 launch &#8211; as told by the community!</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/raspberry-pi-3-launch-community/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi Zero production getting on track</title>
		<link>https://www.raspberrypi.org/magpi/raspberry-pi-zero-production-getting-on-track/</link>
		<comments>https://www.raspberrypi.org/magpi/raspberry-pi-zero-production-getting-on-track/#disqus_thread</comments>
		<pubDate>Tue, 01 Mar 2016 10:17:58 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[eben upton]]></category>
		<category><![CDATA[pi zero]]></category>
		<category><![CDATA[production]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1616</guid>
		<description><![CDATA[<p>First-party production led to scaling challenges for the Raspberry Pi Zero</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/raspberry-pi-zero-production-getting-on-track/">Raspberry Pi Zero production getting on track</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>The launch of the <a href="https://www.raspberrypi.org/products/pi-zero/">Raspberry Pi Zero</a>, the world’s first fully functional microcomputer to cost just £4/$5, caused quite a stir. Unsurprisingly, given the precedent of the Foundation’s other launches, initial stock sold out within minutes. What has been more surprising is that stock continues to be elusive, with small batches appearing in the official sales channel only to immediately disappear again under a flood of demand.</p>
<p>The scarcity of the Pi Zero has led to a ‘black market’ of sorts appearing. When we gave away a cover-mounted Zero with issue 40, we were disappointed to see auction sites filled with opportunists trying to profit from purchases from supermarket shelves.</p>
<p>Even now, there are unscrupulous outlets looking to profit from the high demand for the device. Some retailers have taken to buying up stock from the official outlets in order to resell at a substantial mark-up; one seller was recently found to be adding a pair of cheap adaptor cables to the Pi Zero in order to attempt to justify a £36 selling price.</p>
<div id="attachment_945" style="width: 1510px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2015/11/DSC_0517-crop.jpg"><img class="wp-image-945 size-full" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2015/11/DSC_0517-crop.jpg" alt="Production scaling has proven a challenge for the Raspberry Pi Foundation’s first in-house board, the Pi Zero" width="1500" height="746" /></a><p class="wp-caption-text">Production scaling has proven a challenge for the Raspberry Pi Foundation’s first in-house board, the Pi Zero</p></div>
<p>Buyers are disappointed that they can’t easily get their hands on one or more Pi Zeros for their planned projects, and doubly so when they see rampant profiteering. Fortunately, there’s light at the end of the tunnel: production is being ramped up to meet demand.</p>
<p>“I placed another 150,000 POs [production orders] – well, a pair of POs, a 50K and a 100K – in the last couple of days,” Raspberry Pi Foundation co-founder Eben Upton explained during an interview in early February. “It’d be good to get to a point where we’re doing at least 50,000 a month for Zero. I think we could do 50,000 a month on Zero pretty comfortably.”</p>
<p>But, given the tradition for new Pi models to sell out at launch, why is it taking so long to ramp up production on the Zero? The answer lies in the board’s unique position, Eben reveals. “This isn’t quite the same as the other Pis, because the other Pis are made by RS and Farnell. We make these Pis, so you’re actually looking at a small company trying to scale.”</p>
<p>“We’ve got good resources and good engineers, but you’re looking at a small company trying to scale production,” Eben continues. “It’s not quite realistic to compare the [Pi Zero] throughput to the throughput of the big Pis, because the big Pis are being made by billion-dollar, billion-pound companies; the Zero’s being made by us.”</p>
<p>The launch of the <a href="https://www.raspberrypi.org/magpi/raspberry-pi-3-specs-benchmarks/">Pi 3</a> won’t see the Zero put on the back-burner, though. “If we can get it stable at 50,000 a month,” Eben promises, “then we can look at how we can scale up from that.”</p>
<p><em>This news piece will be published in The MagPi 43, out this Thursday, and was written by Gareth Halfacree</em></p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/raspberry-pi-zero-production-getting-on-track/">Raspberry Pi Zero production getting on track</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/raspberry-pi-zero-production-getting-on-track/feed/</wfw:commentRss>
		<slash:comments>36</slash:comments>
		</item>
		<item>
		<title>Eben Upton talks Raspberry Pi 3</title>
		<link>https://www.raspberrypi.org/magpi/pi-3-interview/</link>
		<comments>https://www.raspberrypi.org/magpi/pi-3-interview/#disqus_thread</comments>
		<pubDate>Mon, 29 Feb 2016 12:50:02 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[eben upton]]></category>
		<category><![CDATA[interview]]></category>
		<category><![CDATA[pi 3]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1593</guid>
		<description><![CDATA[<p>We speak to Eben Upton to find out what makes the Raspberry Pi 3 tick....</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/pi-3-interview/">Eben Upton talks Raspberry Pi 3</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>It&#8217;s been four years since the launch of the original Raspberry Pi, and project co-founder Eben Upton has but one word to describe that period: “Packed!”he laughs from his home in a small Cambridgeshire village. “Just sort of non-stop.”</p>
<p>“There’s just this sense of not really having stopped,” he tells us on behalf of the growing Raspberry Pi team. “Of just having worked continuously.”</p>
<p><em>The full interveiew, including comments from James Adams, will be available in The MagPi 43, out Thursday.</em></p>
<p>The culmination of the team’s ambitions, the <a href="https://www.raspberrypi.org/blog/raspberry-pi-3-on-sale/">Raspberry Pi 3</a> excites Eben for one main reason: “Connectivity. The other stuff is just quantitative change, it’s just faster, more,” he explains. “The wireless and Bluetooth is the big step change on this device. It’s something people have asked us for for a long time. It’s been this missing element of the platform.</p>
<div id="attachment_1609" style="width: 950px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/wirelessradio.jpg"><img class="size-full wp-image-1609" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/wirelessradio.jpg" alt="The radio chip that makes the Pi 3 wireless" width="940" height="574" /></a><p class="wp-caption-text">The radio chip that makes the Pi 3 wireless</p></div>
<p>“It wasn’t on the original device because it was a million miles beyond us at the kind of scale we were at back then,” Eben admits, thinking back to the early days of the Foundation. “We sold 800,000 Raspberry Pis before we hired our first employee. There’s no way you could do this sort of stuff with no employees. It’s eaten a couple of man-years, probably, getting radio onto the device.”</p>
<h3>Testing</h3>
<p>Conformance testing, too, would have been difficult. “You can do all the testing for an unintentional radiator in a couple of days. Pete [Lomas] and I did the original one; Pete, James [Adams], Gordon[Hollingworth], and I did the subsequent products,” Eben recalls. “The radio stuff, you give it to a guy and he takes six weeks and just rams through all of these tests. The test campaign for Pi 3 has cost us, basically, £100,000,” some ten times that of its radiofree predecessors.</p>
<p>The radio chip isn’t the only new feature, of course. The new BCM2837 system-on-chip has been developed specifically for the project by Broadcom. “It’s kind of a mixture of being able to make a business case for it, and then all those people at Broadcom whobelieved in the mission and were prepared to do the work to get it over the line,” Eben explains of how the Foundation was able to convince the multinational chip giant to build custom chips for the project. “That’s people from fresh graduate engineers all the way up to people in the C-suite at the top. Tricky, though!”</p>
<h3>USB and PXE network boot</h3>
<p>Even with the chip designed and taped out in March of last year, the Foundation had some final input for Broadcom in order to add twonew features: direct USB massstorage and PXE network boot capabilities. “Gordon rewrote the boot ROM for the chip and then provided an updated boot ROM to Broadcom, saying ‘shove this in the chip, it’ll work’,” Eben laughs. “And it does!</p>
<div id="attachment_1611" style="width: 1510px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/RaspberryPi3.jpg"><img class="size-full wp-image-1611" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/RaspberryPi3.jpg" alt="The Raspberry Pi 3 in its full glory" width="1500" height="980" /></a><p class="wp-caption-text">The Raspberry Pi 3 in its full glory</p></div>
<p>“The other interesting thing about the chip is for all other ones the implementation work was done entirely in Cambridge; this one was a collaboration with Broadcom’s settop box engineering group in Aztec West [business park] in Bristol.”</p>
<p>Eben readily admits that not all the capabilities of the new parts are going to be used at launch, however. “Although it is a 64‑bit core, we’re using it as just a faster 32-bit core,” he reveals aboutthe Pi 3’s central processing unit. “I can imagine there’d be some real benefits [to 64-bit code]. The downside is that you do really create a separate world. To access that benefit, you’d have to have two operating systems. I’m hoping that someone will come and demonstrate to me that this is a good idea. But there are some really compelling advantages to still being basically ARMv6, and because it’s [Cortex-]A53 it’s a really good 32‑bit processor.”</p>
<p>Aware of the high demand that a Raspberry Pi launch typically encounters, talk turns to production. “We’ve already made 30,000 of it,” Eben discloses, still some weeks ahead of the release. “I’d like to do at least three million units, and that requires you to build, say, 60,000 a week. We’ll probably build around 100,000 a week in the UK, plus whatever Embest builds in China, for a month or two, then you back off to maybe 60,000 a week.”</p>
<div id="attachment_1591" style="width: 734px" class="wp-caption aligncenter"><a href="http://magpi.cc/Subs1"><img class="size-full wp-image-1591" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/2016-02-27-17_36_31-018_TheMagPi43.pdf.png" alt="Subscribe now and get a code to order Pi 3 first!" width="724" height="467" /></a><p class="wp-caption-text">Subscribe now and get a code to order Pi 3 first!</p></div>
<p>Excited by all this and the possibilites of the Raspberry Pi 3? Want to get one right now? Subscribers to the print version of The MagPi can jump the queue at The Pi Hut to get priority handling on your orders. The good news is, if you&#8217;re already a print subscriber, you should be getting an email about it right now. The better news is, if you <a href="https://magpi.cc/Subs1">subscribe to The MagPi</a> before Sunday 13 March 2016 you too can get a code to jump the queue. <a href="https://magpi.cc/Subs1">Subscribe today</a>, jump the queue and never miss another issue.</p>
<p>Find out more about the Raspberry Pi 3 on the <a href="https://www.raspberrypi.org/blog/raspberry-pi-3-on-sale/">Raspberry Pi website</a>, including other places you can try to buy it from.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/pi-3-interview/">Eben Upton talks Raspberry Pi 3</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/pi-3-interview/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Raspberry Pi 3 is out now! Specs, benchmarks &amp; more</title>
		<link>https://www.raspberrypi.org/magpi/raspberry-pi-3-specs-benchmarks/</link>
		<comments>https://www.raspberrypi.org/magpi/raspberry-pi-3-specs-benchmarks/#disqus_thread</comments>
		<pubDate>Mon, 29 Feb 2016 07:01:00 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[3]]></category>
		<category><![CDATA[benchmarks]]></category>
		<category><![CDATA[specs]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1572</guid>
		<description><![CDATA[<p>Get the low down on the brand new Raspberry Pi 3 and see how its new features compare to previous Raspberry Pis</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/raspberry-pi-3-specs-benchmarks/">Raspberry Pi 3 is out now! Specs, benchmarks &#038; more</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>The <a href="https://www.raspberrypi.org/blog/raspberry-pi-3-on-sale/">Raspberry Pi 3</a> is here! Hopefully some of you were still surprised by the announcement today. Over the past four years, the Raspberry Pi has sold eight million units &#8211; three million in the last year alone &#8211; and now on its fourth birthday a brand new upgraded Pi has been released. You can read absolutely everything you&#8217;d want to know about it in issue 43 of the magazine coming out on Thursday but for now we thought we&#8217;d give you the hard facts about this brand new Raspberry Pi.</p>
<p>And yes, it has wireless internet.</p>
<h3>Specifications</h3>
<p><strong>SoC:</strong> Broadcom BCM2837<br />
<strong>CPU:</strong> 4× ARM Cortex-A53, 1.2GHz<br />
<strong>GPU:</strong> Broadcom VideoCore IV<br />
<strong>RAM:</strong> 1GB LPDDR2 (900 MHz)<br />
<strong>Networking:</strong> 10/100 Ethernet, 2.4GHz 802.11n wireless<br />
<strong>Bluetooth:</strong> Bluetooth 4.1 Classic, Bluetooth Low Energy<br />
<strong>Storage:</strong> microSD<br />
<strong>GPIO:</strong> 40-pin header, populated<br />
<strong>Ports:</strong> HDMI, 3.5mm analogue audio-video jack, 4× USB 2.0, Ethernet, Camera Serial Interface (CSI), Display Serial Interface (DSI)</p>
<h2>Wireless radio</h2>
<p>So small, its markings can only be properly seen through a microscope or magnifying glass, the Broadcom BCM43438 chip provides 2.4GHz 802.11n wireless LAN, Bluetooth Low Energy, and Bluetooth 4.1 Classic radio support. Cleverly built directly onto the board to keep costs down, rather than the more common fully qualified module approach, its only unused feature is a disconnected FM radio receiver.</p>
<div id="attachment_1576" style="width: 581px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Radiospec.png"><img class="size-full wp-image-1576" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Radiospec.png" alt="Wireless radio" width="571" height="434" /></a><p class="wp-caption-text">Wireless radio</p></div>
<h2>Antenna</h2>
<p>There’s no need to connect an external antenna to the Raspberry Pi 3. Its radios are connected to this chip antenna soldered directly to the board, in order to keep the size of the device to a minimum. Despite its diminutive stature, this antenna should be more than capable of picking up wireless LAN and Bluetooth signals – even through walls.</p>
<div id="attachment_1577" style="width: 582px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Antennaspec.png"><img class="size-full wp-image-1577" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Antennaspec.png" alt="Antenna" width="572" height="434" /></a><p class="wp-caption-text">Antenna</p></div>
<h2>SoC</h2>
<p>Built specifically for the new Pi 3, the Broadcom BCM2837 system-on-chip (SoC) includes four high-performance ARM Cortex-A53 processing cores running at 1.2GHz with 32kB Level 1 and 512kB Level 2 cache memory, a VideoCore IV graphics processor, and is linked to a 1GB LPDDR2 memory module on the rear of the board.</p>
<div id="attachment_1575" style="width: 596px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/SOCspec.png"><img class="size-full wp-image-1575" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/SOCspec.png" alt="SOC" width="586" height="445" /></a><p class="wp-caption-text">SOC</p></div>
<h2>GPIO</h2>
<p>The Raspberry Pi 3 features the same 40-pin general-purpose input-output (GPIO) header as all the Pis going back to the Model B+ and Model A+. Any existing GPIO hardware will work without modification; the only change is a switch to which UART is exposed on the GPIO’s pins, but that’s handled internally by the operating system.</p>
<div id="attachment_1579" style="width: 579px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/GPIOspec.png"><img class="size-full wp-image-1579" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/GPIOspec.png" alt="GPIO" width="569" height="487" /></a><p class="wp-caption-text">GPIO</p></div>
<h2>USB chip</h2>
<p>The Raspberry Pi 3 shares the same SMSC LAN9514 chip as its predecessor, the Raspberry Pi 2, adding 10/100 Ethernet connectivity and four USB channels to the board. As before, the SMSC chip connects to the SoC via a single USB channel, acting as a USB-to-Ethernet adaptor and USB hub.</p>
<div id="attachment_1578" style="width: 579px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/USBChipspec.jpg"><img class="size-full wp-image-1578" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/USBChipspec.jpg" alt="USB Chip" width="569" height="487" /></a><p class="wp-caption-text">USB Chip</p></div>
<h3>Benchmarks</h3>
<p>Want to know just how much faster the new Raspberry Pi 3 is? See it pitted against its siblings in our benchmark series.</p>
<div id="attachment_1584" style="width: 630px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Sysbench.png"><img class="wp-image-1584 size-full" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Sysbench.png" alt="Sysbench" width="620" height="680" /></a><p class="wp-caption-text">Sysbench</p></div>
<p>Offering support for multi-threaded operation – taking advantage of the four processing cores on the Pi 2 and Pi 3 – SysBench reveals just how far we’ve come since the original Raspberry Pi design. While single-threaded performance has improved greatly, the biggest gains go to multi‐threaded programs.</p>
<div id="attachment_1582" style="width: 792px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/PythonGPIO.png"><img class="wp-image-1582 size-full" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/PythonGPIO.png" alt="PythonGPIO" width="782" height="581" /></a><p class="wp-caption-text">Python GPIO</p></div>
<p>The Raspberry Pi’s GPIO pins are most commonly used with Python, but this leads to a CPU bottleneck. In this test, a simple RPi.GPIO program toggles a pin as rapidly as possible while a frequency counter measures how quickly it actually switches.</p>
<div id="attachment_1580" style="width: 710px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/QuakeIII.png"><img class="wp-image-1580 size-full" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/QuakeIII.png" alt="QuakeIII" width="700" height="541" /></a><p class="wp-caption-text">Quake III Arena timedemo</p></div>
<p>The classic twitch shooter from industry pioneer id Software, Quake III Arena is heavily tied to the CPU performance of the Pi. The standard ‘timedemo’ was run at 1280×1024, high geometric, maximum texture detail, 32-bit texture quality, and trilinear filtering to obtain these results.</p>
<div id="attachment_1583" style="width: 816px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Whetstone.png"><img class="wp-image-1583 size-full" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Whetstone.png" alt="Whetstone" width="806" height="625" /></a><p class="wp-caption-text">Whetstone</p></div>
<p>Developed by B.A. Wichman in the 1970s as a means of measuring a computer’s speed, the Whetstone benchmark concentrates on floating-point performance. Despite its age, the benchmark offers a good insight into the peak floating-point performance of a processor.</p>
<div id="attachment_1581" style="width: 720px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Dhrystone.png"><img class="wp-image-1581 size-full" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Dhrystone.png" alt="Dhrystone" width="710" height="579" /></a><p class="wp-caption-text">Dhrystone</p></div>
<p>Where Whetstone measures floating-point performance, Dhrystone was developed in the 1980s by Reinhold P Weicker to measure integer – or whole-number – performance. As with its floating-point equivalent, Dhrystone is still a useful synthetic benchmark for comparing different chips.</p>
<div id="attachment_1585" style="width: 698px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Powerdraw.png"><img class="wp-image-1585 size-full" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/Powerdraw.png" alt="Powerdraw" width="688" height="666" /></a><p class="wp-caption-text">Power draw</p></div>
<p>You can’t get extra performance without a few sacrifices. The Pi 3 draws the most power of the test group, but its extra performance means it spends more time at idle. Those looking for maximum battery life should look at the Model A+ or the Pi Zero as an alternative.</p>
<div id="attachment_1591" style="width: 734px" class="wp-caption aligncenter"><a href="https://magpi.cc/Subs1"><img class="wp-image-1591 size-full" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/2016-02-27-17_36_31-018_TheMagPi43.pdf.png" alt="2016-02-27 17_36_31-018_TheMagPi#43.pdf" width="724" height="467" /></a><p class="wp-caption-text">Subscribe now and get a code to order Pi 3 first!</p></div>
<p>Excited by all this and the possibilites of the Raspberry Pi 3? Want to get one right now? Subscribers to the print version of The MagPi can jump the queue at The Pi Hut to get priority handling on your orders. The good news is, if you&#8217;re already a print subscriber, you should be getting an email about it right now. The better news is, if you <a href="https://magpi.cc/Subs1">subscribe to The MagPi</a> before Sunday 13 March 2016 you too can get a code to jump the queue. <a href="https://magpi.cc/Subs1">Subscribe today</a>, jump the queue and never miss another issue.</p>
<p>Find out more about the Raspberry Pi 3 on the <a href="https://www.raspberrypi.org/blog/raspberry-pi-3-on-sale/">Raspberry Pi website</a>, including other places you can try to buy it from.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/raspberry-pi-3-specs-benchmarks/">Raspberry Pi 3 is out now! Specs, benchmarks &#038; more</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/raspberry-pi-3-specs-benchmarks/feed/</wfw:commentRss>
		<slash:comments>110</slash:comments>
		</item>
		<item>
		<title>Become a maestro with Code Music with Sonic Pi</title>
		<link>https://www.raspberrypi.org/magpi/sonic-pi-essentials/</link>
		<comments>https://www.raspberrypi.org/magpi/sonic-pi-essentials/#disqus_thread</comments>
		<pubDate>Fri, 26 Feb 2016 12:57:13 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[News]]></category>
		<category><![CDATA[ebook]]></category>
		<category><![CDATA[essentials]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[sonic pi]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1565</guid>
		<description><![CDATA[<p>The Sonic Pi Essentials ebook is out right now, with everything you need to learn how to use Sonic Pi and become the next most important living artist</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/sonic-pi-essentials/">Become a maestro with Code Music with Sonic Pi</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Sonic Pi is the fantastic music coding software available on the Raspberry Pi, allowing you to code and create your very own music. Sonic Pi is very powerful and flexible, even allowing for modifying the code on the fly to create interactive and amazing live sets. So with all that in mind, we&#8217;re very proud to announce that our fourth Essentials book is <a href="/magpi/issues/essentials-sonic-pi-v1/">Code Music with Sonic Pi</a>!</p>
<div id="attachment_1543" style="width: 410px" class="wp-caption aligncenter"><a href="/magpi/issues/essentials-sonic-pi-v1/"><img class="wp-image-1543" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/SonicPi-thumb-cover.png" alt="SonicPi-thumb-cover" width="400" height="565" /></a><p class="wp-caption-text">Amen breaks, Bizet beats, Mincraft VJs and more in Sonic Pi Essentials</p></div>
<p>Written by the creator of Sonic Pi himself, Sam Aaron, the book teaches you how to go from Sonic Pi novice to Sonic Pi MC. The book teaches you how to master live loops for your live shows, create classic drum breaks, compose your own melodies and random riffs, and even hook Sonic Pi up to Minecraft to create amazing visualisations along with your shows.</p>
<p>You can grab the new ebook from our <a href="https://play.google.com/store/apps/details?id=com.raspberry.magpi">Android</a> and <a href="https://itunes.apple.com/us/app/the-magpi-magazine/id972033560?ls=1&amp;mt=8">iOS</a> app, or of course you can always grab the free PDF from the <a href="/magpi/issues/essentials-sonic-pi-v1/">issue page</a>. A lot of people have also been asking if we&#8217;ll be printing this and other Essentials books – we&#8217;ve heard you and you should probably watch this space for news about that very soon.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/sonic-pi-essentials/">Become a maestro with Code Music with Sonic Pi</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/sonic-pi-essentials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minecraft Mashups part three</title>
		<link>https://www.raspberrypi.org/magpi/minecraft-mashups-part-three/</link>
		<comments>https://www.raspberrypi.org/magpi/minecraft-mashups-part-three/#disqus_thread</comments>
		<pubDate>Thu, 25 Feb 2016 09:30:35 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Walkthrough]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[sense hat]]></category>
		<category><![CDATA[sonic pi]]></category>
		<category><![CDATA[vj]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1529</guid>
		<description><![CDATA[<p>Use Minecraft with a Sense HAT and music-making software Sonic Pi in our final mashups</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/minecraft-mashups-part-three/">Minecraft Mashups part three</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Finish off mashing up Minecraft with part three of our guide, following up on natural disasters and libraries in <a href="/magpi/minecraft-mashups-part-one/">part one</a> and Node-RED in <a href="/magpi/minecraft-mashups-part-two/">part two</a>.</p>
<p><em>The full article can be found in <a href="/magpi/issues/41">The MagPi 41</a></em></p>
<h3>Walking with Steve</h3>
<p>One of the cool things about the console edition of Minecraft is that you can use a controller instead of a keyboard. The Pi edition might sometimes seem a little basic, but you can make your game more like the console edition by deploying your Sense HAT as a tiltable controller instead of using a keyboard. If you don’t know which way to tilt it, the arrows appearing on the LED matrix will help you.</p>
<div id="attachment_1534" style="width: 755px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/steve.png"><img class="size-full wp-image-1534" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/steve.png" alt="Walking Steve with a Sense HAT" width="745" height="413" /></a><p class="wp-caption-text">Walking Steve with a Sense HAT</p></div>
<p>The first thing you need to do is to install all the necessary modules. An obvious one is the Sense HAT library: if you have Raspbian Jessie, this comes bundled with it; if not, you can install it by typing:</p><pre class="crayon-plain-tag">sudo pip install sense_hat</pre><p>You&#8217;ll also need another Python module, which in turn requires the Xlib library:</p><pre class="crayon-plain-tag">sudo apt-get install python-xlib
sudo pip install pyautogui</pre><p>Using the pyautogui functions, you can simulate keys as if they were actually pressed. This is how you make Steve walk around his blocky world.</p>
<p>Instead of pressing keys, we&#8217;ll use the Sense HAT’s accelerometer to find out which direction the HAT is being tilted. Each time we measure, we get values representing the acceleration intensity of the x, y, and z axes (in Gs). These are sometimes called roll, pitch, and yaw, like on an aeroplane or a spaceship. We only need the x and y axes, as the z axis is rotation and we’re not using that.</p>
<h3>How to use it</h3>
<p>Download or type up the code from the listing (right) into IDLE, then press F5 to run it. Make sure Minecraft is running and you’ve entered a world when you run it, otherwise lots of errors will appear! If you tilt the Sense HAT forward, the pyautogui module will trigger a W key and move Steve forward; make sure your mouse is clicked in the Minecraft window when this happens, otherwise it will just generate a ‘w’ in the Python shell. The same thing happens when you tilt it backwards, but it will generate an S. If you tilt it to the side, it will generate a D or an A, depending on which direction you’ve tilted. You still need to use the mouse to look around, and the E key to open your inventory. So, the idea is for you to get all the items you need in your hotbar, then hold the mouse in one hand and the Sense HAT in the other.</p>
<div id="attachment_1535" style="width: 175px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/stop.jpg"><img class="size-full wp-image-1535" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/stop.jpg" alt="None shall pass!" width="165" height="190" /></a><p class="wp-caption-text">None shall pass!</p></div>
<h3>Using Minecraft</h3>
<p>When the program is running, you’ll only be able to walk (or fly) around using the keys when the Sense HAT is in the level position (all the LEDs will be red). Even then, you’ll only move if you tap the key repeatedly instead of holding it down. So you’re better off sticking to the Sense HAT!</p>
<p>Once you have written and understood this program, you could try to improve it by making the Sense HAT’s joystick open your inventory or something awesome like that.</p>
<h3>Code listing</h3>
<p>You can download WalkingWithSteve.py from GitHub, or copy it in from below:</p><pre class="crayon-plain-tag">import pyautogui as pag
import time
from sense_hat import SenseHat
sh = SenseHat()

def unpress():# unpresses all the keys
    for key in ['s','w','a','d']:
        pag.keyUp(key)

def move(direction):# presses the correct key
    unpress()
    pag.keyDown(direction)

def displayArrow(c,rot):# the arrow
    arrow = [
    e,e,e,c,c,e,e,e,
    e,e,c,c,c,c,e,e,
    e,c,c,c,c,c,c,e,
    c,c,e,c,c,e,c,c,
    c,e,e,c,c,e,e,c,
    e,e,e,c,c,e,e,e,
    e,e,e,c,c,e,e,e,
    e,e,e,c,c,e,e,e]
    sh.set_rotation(rot)
    sh.set_pixels(arrow)
    
r = [255,0,0]# define the colours
e = [0,0,0]
g = [0,255,0]
b = [0,0,255]
stop = [# the stop sign
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r,
r,r,r,r,r,r,r,r]

mot = 'SSSS'
while True:# main loop
    x, y, z = sh.get_accelerometer_raw().values()
    x = round(x, 0)
    y = round(y, 0)
    if x  == -1  and abs(y) == 0 and mot != 'rrrr': 
        displayArrow(b,0)
        move('d')# right
        mot = 'rrrr'
    elif  x == 1  and abs(y) == 0 and mot != 'llll': 
        displayArrow(b,180)
        move('a')# left
        mot = 'llll'
    elif y == -1  and mot != 'wwww': 
        displayArrow(g,270)
        move('w')# fwd
        mot = 'wwww'
    elif y == 1  and mot != 'bbbb':
        displayArrow(g,90)
        move('s')# back
        mot = 'bbbb'
    elif abs(x) == 0 and abs(y) == 0:
        unpress()# stop
        sh.set_pixels(stop)
        mot = 'SSSS'</pre><p></p>
<h3>Become A Minecraft VJ</h3>
<p>Everyone has built amazing structures, designed cunning traps, and even created elaborate cart tracks in Minecraft. How many of you have performed with Minecraft? We bet you didn’t know that you could use Minecraft to create amazing visuals, just like a professional VJ.</p>
<p>As well as coding with Python, you can also program Minecraft with an app called Sonic Pi, which makes the coding not only easy but also incredibly fun. In this article, we’ll be showing you some of the tips and tricks that we’ve used to create performances in nightclubs and music venues around the world.</p>
<div id="attachment_1536" style="width: 2010px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/MinecraftVJ.png"><img class="size-full wp-image-1536" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/MinecraftVJ.png" alt="Become a VJ with Sonic Pi and Minecraft" width="2000" height="1096" /></a><p class="wp-caption-text">Become a VJ with Sonic Pi and Minecraft</p></div>
<p>Enter a new world in Minecraft and open Sonic Pi. When we’re using Minecraft to create visuals, we try to think about what will both look interesting and also be easy to generate from code. One nice trick is to create a sandstorm by dropping sand blocks from the sky. For that, all we need are a few basic fns (Sonic Pi functions):</p>
<p>• <pre class="crayon-plain-tag">sleep</pre> &#8211; for inserting a delay between actions<br />
• <pre class="crayon-plain-tag">mc_location</pre> &#8211; to find our current location<br />
• <pre class="crayon-plain-tag">mc_set_block</pre> &#8211; to place sand blocks at a specific location<br />
• <pre class="crayon-plain-tag">rrand</pre> &#8211; to allow us to generate random values within a range<br />
• <pre class="crayon-plain-tag">live_loop</pre> &#8211; to allow us to continually make it rain sand</p>
<p>Let’s make it rain a little first, before unleashing the full power of the storm. Grab your current location and use it to create a few sand blocks up in the sky nearby:</p><pre class="crayon-plain-tag">x, y, z = mc_location
mc_set_block :sand, x, y + 20, z + 5
sleep 2
mc_set_block :sand, x, y + 20, z + 6
sleep 2
mc_set_block :sand, x, y + 20, z + 7
sleep 2
mc_set_block :sand, x, y + 20, z + 8</pre><p>When you press Run, you might have to look around a little, as the blocks may start falling down behind you depending on which direction you’re currently facing. Don’t worry: if you missed them, just press Run again for another batch of sand rain &#8211; just make sure you’re looking the right way!</p>
<p>Let’s quickly review what’s going on here. On the first line, we grabbed Steve’s location as coordinates with the fn <pre class="crayon-plain-tag">mc_location</pre> and placed them into the vars x, y, and z. Then, on the next lines, we used the <pre class="crayon-plain-tag">mc_set_block</pre> fn to place some sand at the same coordinates as Steve, but with some modifications. We chose the same x coordinate, a y coordinate 20 blocks higher, and then successively larger z coordinates so the sand dropped in a line away from Steve.</p>
<p>Why don’t you take that code and start playing around with it yourself? Try adding more lines, changing the sleep times, try mixing <pre class="crayon-plain-tag">:sand</pre><br />
with <pre class="crayon-plain-tag">:gravel</pre>, and choose different coordinates. Just experiment and have fun!</p>
<h3>Live loops unleashed</h3>
<p>OK, it’s time to get the storm raging by unleashing the full power of the live_loop, Sonic Pi’s magical ability, which unleashes the full power of live-coding: changing code on the fly while it’s running!</p><pre class="crayon-plain-tag">live_loop :sand_storm do
  x, y, z = mc_location
  xd = rrand(-10, 10)
  zd = rrand(-10, 10)
  co = rrand(70, 130)
  synth :cnoise, attack: 0, release: 0.125, cutoff: co
  mc_set_block :sand, x + xd, y+20, z+zd
  sleep 0.125
end</pre><p>What fun! We’re looping round pretty quickly (eight times a second), and during each loop we’re finding Steve’s location like before but then generating three random values:</p>
<p>• <pre class="crayon-plain-tag">xd</pre> &#8211; the difference for x, which will be between -10 and 10<br />
• <pre class="crayon-plain-tag">zd</pre> &#8211; the difference for z, also between -10 and 10<br />
• <pre class="crayon-plain-tag">co</pre> &#8211; a cutoff value for the low pass filter, between 70 and 130</p>
<p>We then use those random values in the fns <pre class="crayon-plain-tag">synth</pre> and <pre class="crayon-plain-tag">mc_set_block</pre><br />
, giving us sand falling in random locations around Steve, along with a percussive rain-like sound from the <pre class="crayon-plain-tag">:cnoise</pre> synth.</p>
<p>For those of you new to live loops, this is where the fun really starts with Sonic Pi. While the code is running and the sand is pouring down, try changing one of the values, perhaps the <pre class="crayon-plain-tag">sleep</pre> time to <pre class="crayon-plain-tag">0.25</pre> or the <pre class="crayon-plain-tag">:sand</pre> block type to <pre class="crayon-plain-tag">:gravel</pre>. Now press the Run button again. Hey presto! Things have changed without the code even stopping. This is your gateway to performing like a real VJ. Keep practising and changing things around. How different can you make the visuals without stopping the code?</p>
<h3>Epic block patterns</h3>
<p>Finally, another great way of creating interesting visuals is to generate huge patterned walls to fly towards and get close to. For this effect, we’ll need to move from placing the blocks randomly to placing them in an ordered manner. We can do this by nesting two sets of iteration; press the Help button and navigate to section 5.2 of the tutorial, ‘Iteration and Loops’, for more background on iteration. The funny <pre class="crayon-plain-tag">|xd|</pre> after the <pre class="crayon-plain-tag">do</pre> means that <pre class="crayon-plain-tag">xd</pre> will be set for each value of the iteration. So, the first time it will be 0, then 1, then 2 and so on. By nesting two lots of iteration together like this, we can generate all the coordinates for a square. We can then randomly choose block types from a ring of blocks for an interesting effect:</p><pre class="crayon-plain-tag">x, y, z = mc_location
bs = (ring :gold, :diamond, :glass)
10.times do |xd|
  10.times do |yd|
    mc_set_block bs.choose, x + xd, y + yd, z
  end
end</pre><p>Pretty neat. Whilst we’re having fun here, try changing <pre class="crayon-plain-tag">bs.choose</pre> to <pre class="crayon-plain-tag">bs.tick</pre> to move from a random pattern to a more regular one. Try changing the block types – the more adventurous of you might want to try sticking this within a <pre class="crayon-plain-tag">live_loop</pre> so that the patterns keep changing automatically.</p>
<p>Now, for the VJ finale. Change the two <pre class="crayon-plain-tag">10.times</pre> to <pre class="crayon-plain-tag">100.times</pre> and press Run. Kaboom!… A gigantic wall of randomly placed bricks. Imagine how long it would take you to build that manually with your mouse! Double-tap SPACE to enter fly-mode and start swooping by for some great visual effects. Don’t stop here, though – use your imagination to conjure up some cool ideas and then use the coding power of Sonic Pi to make it real. When you’ve practised enough, dim the lights and put on a VJ show for your friends!</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/minecraft-mashups-part-three/">Minecraft Mashups part three</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/minecraft-mashups-part-three/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Minecraft Mashups part two</title>
		<link>https://www.raspberrypi.org/magpi/minecraft-mashups-part-two/</link>
		<comments>https://www.raspberrypi.org/magpi/minecraft-mashups-part-two/#disqus_thread</comments>
		<pubDate>Wed, 24 Feb 2016 12:05:07 +0000</pubDate>
		<dc:creator><![CDATA[Russell Barnes]]></dc:creator>
				<category><![CDATA[Walkthrough]]></category>
		<category><![CDATA[frozen]]></category>
		<category><![CDATA[led]]></category>
		<category><![CDATA[minecraft]]></category>
		<category><![CDATA[node-red]]></category>

		<guid isPermaLink="false">https://www.raspberrypi.org/magpi/?p=1517</guid>
		<description><![CDATA[<p>Continue learning how to use Minecraft with other coding languages and the real world</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/minecraft-mashups-part-two/">Minecraft Mashups part two</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></description>
				<content:encoded><![CDATA[<p>Continuing on from <a href="/magpi/minecraft-mashups-part-one/">Minecraft Mashups part one</a>, we start having Minecraft interact with and effect the real world.</p>
<p><em>The full article can be found in <a href="/magpi/issues/41">The MagPi 41</a></em></p>
<h3>Control an LED with Minecraft</h3>
<p>Using GPIO Zero in conjunction with the Minecraft Python API, we can do some amazing things very simply. GPIO Zero is the new Python coding library that allows you to quickly and easily connect and control physical electronics in the real world with Python.</p>
<div id="attachment_1522" style="width: 1651px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/ledfritz.png"><img class="size-full wp-image-1522" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/ledfritz.png" alt="Wire up your LED to work with Minecraft" width="1641" height="855" /></a><p class="wp-caption-text">Wire up your LED to work with Minecraft</p></div>
<p>In this code, you need to hunt down a specific block; your only guide is an LED light. It blinks as you head in the right direction, blinking faster as you get close, before becoming a solid light when you’re extremely close to it.</p>
<p>This code keeps track of the player’s position, with a set block as the target. As the player gets nearer and the distance to the block shortens, the distance is used to alter the time delay in the LED flashing. There are four levels to the flashing: the slowest indicates you’re generally heading in the right direction, the next step up is close, the following is near, and the final one is within ten blocks. The solid light occurs within four blocks of the target, and the game lets you know when you’ve found it by displaying a message on the screen.</p>
<div id="attachment_1525" style="width: 1930px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/led.png"><img class="size-full wp-image-1525" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/led.png" alt="Find the block in the LED game!" width="1920" height="1080" /></a><p class="wp-caption-text">Find the block in the LED game!</p></div>
<p>The code for this game is <a href="https://github.com/robthez/LightTheWay">available on GitHub</a></p>
<h3>Control Minecraft with a button</h3>
<p>We have an example of an output from Minecraft that controls an LED using GPIO Zero; now to talk about how an input can be used. Using a project designed by Richard Hayler, you can create the effect of having ice powers, freezing blocks in your path at the touch of a physical push button you’ve added to a breadboard. You can also change the range of the power’s effect using a potentiometer, also known as a variable resistor.</p>
<div id="attachment_1524" style="width: 1648px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/frozenfritz.png"><img class="size-full wp-image-1524" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/frozenfritz.png" alt="Wire up the Frozen circuit with this diagram" width="1638" height="853" /></a><p class="wp-caption-text">Wire up the Frozen circuit with this diagram</p></div>
<p>The code uses the input reading of the GPIO pin and converts it to a number usable by the code. This then generates the range of blocks that will be affected by the player when the button is pressed. When it&#8217;s pressed, the selection of blocks in the range that aren&#8217;t made of air have their coordinates saved so they can all be set to ice blocks.</p>
<p>The code lets you know the power of your ice blast, so you can tweak the resistor and figure out how to get it configured perfectly.</p>
<p><div id="attachment_1523" style="width: 1764px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/frozen.png"><img class="size-full wp-image-1523" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/frozen.png" alt="[Insert Frozen reference here]" width="1754" height="992" /></a><p class="wp-caption-text">[Insert Frozen reference here]</p></div>Grab the code <a href="https://github.com/topshed/PiClubSushi/blob/master/15-minecraft-frozen-mini.pdf">from GitHub</a> and have a play.</p>
<h3>Node-RED and controlling Minecraft with JavaScript</h3>
<p>This article should give you a taste of a workshop taught at a recent CamJam by Boris Adryan. Here, we&#8217;ll show you just how easy Node-RED is to use. You can refer to the <a href="https://magpi.cc/1jLWFST">original tutorial</a> for a lot more detail and theory.</p>
<div id="attachment_1519" style="width: 1832px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/main-image.png"><img class="size-full wp-image-1519" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/main-image.png" alt="Find Steve's position is only the start of using Minecraft with Node-RED" width="1822" height="983" /></a><p class="wp-caption-text">Find Steve&#8217;s position is only the start of using Minecraft with Node-RED</p></div>
<p><strong>Preparation</strong></p>
<p>Start Minecraft and open a new world. Fire up Node-RED from the Programming submenu on the Raspbian desktop. After a few moments, Node-RED is going to run as a service in the background. Open a web browser (Iceweasel works best with Node-RED) and direct it to 127.0.01:1880 to see the programming environment. On the left, there’s a panel with nodes. These are visual components that you can use to build your flow. In the middle is the flow editor where you can simply drag and drop your flow together. On the right, you can switch between the help panel and the debug panel. Note that while ‘debug’ often has some negative connotation, it’s your default text output in Node-RED.</p>
<p><strong>Hello World in Minecraft</strong></p>
<p>Drag and drop an inject node from the nodes panel into the flow editor. Once you’ve selected that inject node, you should see a general explanation about its functionality in the help panel – this is especially useful info when you select complex nodes with many different options.</p>
<p>Double-click your inject node in the flow editor. Once the associated dialog opens, change the Payload to type ‘string’ and write ‘Hello World’ in the empty text field below.</p>
<p>The flow of information is modelled through the exchange of messages in Node-RED, which happens by passing along a variable called msg. It has two main properties: topic and payload. In simple terms, these could be interpreted like the subject and body of an email. Drag and drop a debug node from the nodes library into the flow editor.</p>
<p>Drag and drop a function node into the editor. This is the node type that allows you to directly interact with the msg object in JavaScript. In your function node, write <pre class="crayon-plain-tag">msg.payload = "chat.post("+msg.payload+")\n"; before the line with ‘return msg;’</pre>. This line is going to take the incoming payload ‘Hello World’, and assign the new content <pre class="crayon-plain-tag">chat.post(Hello World)\n</pre> to the variable. chat.post is a command from the Minecraft API, which you can read about in a file called mcpi_protocol_spec.txt in the Minecraft API directory. The end of our command is indicated by a line break, the Unix character <pre class="crayon-plain-tag">\n</pre>.</p>
<div id="attachment_1520" style="width: 980px" class="wp-caption aligncenter"><a href="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/image-2.png"><img class="size-full wp-image-1520" src="https://www.raspberrypi.org/magpi/wp-content/uploads/2016/02/image-2.png" alt="Hello World, Node-RED style" width="970" height="603" /></a><p class="wp-caption-text">Hello World, Node-RED style</p></div>
<p>Drag and drop a TCP request node from the function section of the node panel. The server is 127.0.0.1, and the port is 4711. As we’re not expecting a return value, we&#8217;ll Return ‘after a fixed timeout’ of 0ms. This connects Node‑RED to the Minecraft TCP socket – if you&#8217;re keen to understand what a socket is, have a look at the <a href="http://magpi.cc/1jLWFST">original workshop material</a>.</p>
<p>Connect the nodes by drawing connections, as in the screenshots here. Start your flow by pressing the red Deploy button in the upper-right corner. Trigger your flow by pressing the rounded rectangle to the immediate left of your inject button. Do you see your message in Minecraft?</p>
<p><strong>Retrieve values from Minecraft</strong></p>
<p>So far, our interaction with Minecraft has been rather one-directional. We just sent a command string that had an effect on the Minecraft world. Now we’re going to modify our flow so we can query values like our own position via the API.</p>
<p>In the function node, set <pre class="crayon-plain-tag">msg.payload = "player.getPos()\n";</pre> before the line with ‘return msg;’. Instead of leaving the TCP request node after some time, we expect our Return ‘when character is received’, namely <pre class="crayon-plain-tag">\n</pre>.</p>
<p>By default, the TCP request node returns a buffer, and we need to convert the information from Node-RED using <pre class="crayon-plain-tag">msg.payload = msg.payload.toString();</pre> in a new function node. The result of this new function node goes straight to our debug node.</p>
<p>Deploy your Node-RED flow. Now have a walk around Minecraft and trigger your flow with the inject node. Do you see what you expected in the debug panel?</p>
<p>You can get the flows for the <a href="http://flows.nodered.org/flow/a9d5463774700b30156a">Hello World from the Node-RED website</a>, which also contains the flow for the <a href="http://flows.nodered.org/flow/e1ea40f5658f40a060ea">Player Position code</a>.</p>
<p>Continue on to <a href="https://www.raspberrypi.org/magpi/minecraft-mashups-part-three/">Minecraft Mashups part three</a>.</p>
<p>The post <a rel="nofollow" href="https://www.raspberrypi.org/magpi/minecraft-mashups-part-two/">Minecraft Mashups part two</a> appeared first on <a rel="nofollow" href="https://www.raspberrypi.org/magpi">The MagPi Magazine</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://www.raspberrypi.org/magpi/minecraft-mashups-part-two/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
