{"id":26,"date":"2013-07-31T14:57:34","date_gmt":"2013-07-31T14:57:34","guid":{"rendered":"http:\/\/blog.soton.ac.uk\/pi\/?page_id=26"},"modified":"2013-08-23T14:46:59","modified_gmt":"2013-08-23T14:46:59","slug":"berry-clip","status":"publish","type":"page","link":"https:\/\/blog.soton.ac.uk\/pi\/modules-available\/berry-clip\/","title":{"rendered":"Berry Clip"},"content":{"rendered":"<h1>BerryClip 6 LED Add-on Board Instructions<\/h1>\n<div>\n<p><a href=\"http:\/\/www.raspberrypi-spy.co.uk\/wp-content\/uploads\/2012\/11\/berryclip_2013_03_06.jpg\"><img loading=\"lazy\" decoding=\"async\" alt=\"berryclip_2013_03_#06\" src=\"http:\/\/www.raspberrypi-spy.co.uk\/wp-content\/uploads\/2012\/11\/berryclip_2013_03_06-150x150.jpg\" width=\"150\" height=\"150\" \/><\/a><\/p>\n<p>The BerryClip is a simple, cheap and easy to use add-on board for the Raspberry Pi. It plugs directly onto the Pi\u2019s GPIO header and provides 6 coloured LEDs, 1 Buzzer and 1 Switch.<\/p>\n<p>It can be controlled using any programming language that can manipulate the GPIO pins.<\/p>\n<h2>Raspberry Pi Setup<\/h2>\n<p>Boot the Raspberry Pi and login with default username and password (\u2018pi\u2019 and \u2018raspberry\u2019). You will now be located in the \u2018pi\u2019 user home directory (\u2018\/home\/pi\/\u2019).<\/p>\n<p>Type the following commands in a terminal, pressing the Enter key at the end of each line :<\/p>\n<div>\n<div id=\"highlighter_308698\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>1<\/div>\n<div>2<\/div>\n<div>3<\/div>\n<div>4<\/div>\n<\/td>\n<td>\n<div>\n<div><code>mkdir<\/code> <code>berryclip<\/code><\/div>\n<div><code>cd<\/code> <code>berryclip<\/code><\/div>\n<div><code>wget http:<\/code><code>\/\/www<\/code><code>.raspberrypi-spy.co.uk<\/code><code>\/berryclip\/6_led\/install<\/code><code>.sh<\/code><\/div>\n<div><code>sh <\/code><code>install<\/code><code>.sh<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>The above lines perform the following functions :<br \/>\n&#8211; Make a new directory called \u2018berryclip\u2019<br \/>\n&#8211; Move into that directory<br \/>\n&#8211; Grab a script from the website<br \/>\n&#8211; Run the script<\/p>\n<p>The script will download an instruction file and a set of example Python scripts.<\/p>\n<p>Type :<\/p>\n<div>\n<div id=\"highlighter_645383\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>1<\/div>\n<\/td>\n<td>\n<div>\n<div><code>ls<\/code> <code>-l<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>to list the downloaded files.<\/p>\n<h2>Run Some Example Python Scripts<\/h2>\n<p>The following example Python scripts are available :<\/p>\n<ul>\n<li>berryclip_01.py \u2013 Test LEDs only<\/li>\n<li>berryclip_02.py \u2013 Test Buzzer only<\/li>\n<li>berryclip_03.py \u2013 Test Switch only<\/li>\n<li>berryclip_04.py \u2013 Test LEDs and Switch<\/li>\n<li>berryclip_05.py \u2013 Test LEDs, Buzzer and Switch<\/li>\n<li>berryclip_06.py \u2013 LED sequence<\/li>\n<li>berryclip_07.py \u2013 Dice Simulator<\/li>\n<li>berryclip_08.py \u2013 Reaction time game<\/li>\n<li>berryclip_09.py \u2013 Random LEDs<\/li>\n<\/ul>\n<p>Now plug the BerryClip onto the Raspberry Pi using the 26-pin GPIO header, such that the BerryClip will sit above the Raspberry Pi, as shown below:<\/p>\n<p><a href=\"http:\/\/blog.soton.ac.uk\/pi\/files\/2013\/07\/BerryClip.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-118\" alt=\"BerryClip\" src=\"http:\/\/blog.soton.ac.uk\/pi\/files\/2013\/07\/BerryClip-300x161.png\" width=\"300\" height=\"161\" srcset=\"https:\/\/blog.soton.ac.uk\/pi\/files\/2013\/07\/BerryClip-300x161.png 300w, https:\/\/blog.soton.ac.uk\/pi\/files\/2013\/07\/BerryClip.png 748w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>To run a script you can use the following command :<\/p>\n<div>\n<div id=\"highlighter_635710\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>1<\/div>\n<\/td>\n<td>\n<div>\n<div><code>sudo<\/code> <code>python berryclip_01.py<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>To quit a running Python script use [CTRL-C].<\/p>\n<p>To view or edit a Python script you can use the command:<\/p>\n<div>\n<div id=\"highlighter_866405\">\n<table border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n<tbody>\n<tr>\n<td>\n<div>1<\/div>\n<\/td>\n<td>\n<div>\n<div><code>nano<\/code> <code>berryclip_01.py<\/code><\/div>\n<\/div>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<\/div>\n<div><\/div>\n<div>To save changes and quit use <strong>Ctrl+x <\/strong>then <strong>Y<\/strong> and <strong>ENTER<\/strong><\/p>\n<h2>Hardware Reference<\/h2>\n<p>The following list shows the mapping between the components, the header pins and the GPIO references :<\/p>\n<pre>LED 1  - Pin 7  - GPIO4\r\nLED 2  - Pin 11 - GPIO17\r\nLED 3  - Pin 15 - GPIO22\r\nLED 4  - Pin 19 - GPIO10\r\nLED 5  - Pin 21 - GPIO9\r\nLED 6  - Pin 23 - GPIO11\r\nBuzzer - Pin 24 - GPIO8\r\nSwitch - Pin 26 - GPIO7<\/pre>\n<p><a href=\"http:\/\/www.raspberrypi-spy.co.uk\/berryclip-6-led-add-on-board\/berryclip-6-led-add-on-board-instructions\/\">http:\/\/www.raspberrypi-spy.co.uk\/berryclip-6-led-add-on-board\/berryclip-6-led-add-on-board-instructions\/<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>In case the buzzer is continuously biping once you attach the BerryClip onto the Raspberry Pi, it means that the Pi`s GPIO8 was left high from a previous application. In order to manually set it to low, install the wiringPi tool as per <b>https:\/\/projects.drogon.net\/raspberry-pi\/wiringpi\/download-and-install\/<\/b> and then use the command:<\/p>\n<p><b>gpio mode 10 in<\/b><\/p>\n<p>This command will set the GPIO 10 according to the WiringPi (corresponding to GPIO8 on the Raspberry Pi) to low and will stop the annoying sound done by the BerryClip.<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>BerryClip 6 LED Add-on Board Instructions The BerryClip is a simple, cheap and easy to use add-on board for the Raspberry Pi. It plugs directly onto the Pi\u2019s GPIO header and provides 6 coloured LEDs, 1 Buzzer and 1 Switch. It can be controlled using any programming language that can manipulate the GPIO pins. Raspberry &hellip; <\/p>\n<p><a class=\"more-link block-button\" href=\"https:\/\/blog.soton.ac.uk\/pi\/modules-available\/berry-clip\/\">Continue reading &raquo;<\/a><\/p>\n","protected":false},"author":84718,"featured_media":0,"parent":8,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-26","page","type-page","status-publish","hentry","nodate"],"_links":{"self":[{"href":"https:\/\/blog.soton.ac.uk\/pi\/wp-json\/wp\/v2\/pages\/26","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.soton.ac.uk\/pi\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/blog.soton.ac.uk\/pi\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/pi\/wp-json\/wp\/v2\/users\/84718"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/pi\/wp-json\/wp\/v2\/comments?post=26"}],"version-history":[{"count":12,"href":"https:\/\/blog.soton.ac.uk\/pi\/wp-json\/wp\/v2\/pages\/26\/revisions"}],"predecessor-version":[{"id":27,"href":"https:\/\/blog.soton.ac.uk\/pi\/wp-json\/wp\/v2\/pages\/26\/revisions\/27"}],"up":[{"embeddable":true,"href":"https:\/\/blog.soton.ac.uk\/pi\/wp-json\/wp\/v2\/pages\/8"}],"wp:attachment":[{"href":"https:\/\/blog.soton.ac.uk\/pi\/wp-json\/wp\/v2\/media?parent=26"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}