<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel rdf:about="https://community.wolfram.com">
    <title>Community RSS Feed</title>
    <link>https://community.wolfram.com</link>
    <description>RSS Feed for Wolfram Community showing ideas tagged with Mathematica sorted by most viewed.</description>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/366628" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1323951" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/157461" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/457288" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/157473" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/157704" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/157340" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/122095" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1085633" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/96823" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/413928" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/246929" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/344278" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/157486" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/284759" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/235291" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/1028536" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2185089" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/2504513" />
        <rdf:li rdf:resource="https://community.wolfram.com/groups/-/m/t/196759" />
      </rdf:Seq>
    </items>
  </channel>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/366628">
    <title>Try to beat these MRB constant records!</title>
    <link>https://community.wolfram.com/groups/-/m/t/366628</link>
    <description>POSTED BY:&#xD;
========&#xD;
 **Marvin Ray Burns, and distinguished colleagues**&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
My exciting experiences using Wolfram technologies!&#xD;
---------------------------------------------------&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
&#xD;
The MRB constant, a fascinating mathematical anomaly, has intrigued researchers and enthusiasts alike for decades. Defined as the limiting value of a unique alternating series, this enigmatic constant showcases the beauty of numerical exploration and convergence. Despite its relatively recent emergence, the MRB constant reveals unexpected connections to various fields within mathematics and computational analysis. In this post, we dive into its origins, properties, and the ongoing quest to uncover its more profound significance. The MRB constant is an anomaly because it emerges from an alternating series with unusual convergence behavior. Unlike many well-known mathematical constants, the MRB constant has no closed-form expression nor a known exact nature&amp;#x2014;whether it is algebraic, transcendental, or even irrational.&#xD;
Additionally, the sequence of partial sums that define the MRB constant oscillates between two limit points, creating a bounded yet divergent behavior. This oscillatory nature distinguishes it from more conventional mathematical constants, which typically exhibit straightforward convergence. Its mysterious properties continue to intrigue mathematicians as they explore its deeper connections to number theory and computational analysis. &#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
CMRB&#xD;
 ![If you see this instead of an image, reload the page][1]&#xD;
&#xD;
**is the MRB constant.**&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
Without solicitation, GPT echoed one of this discussion&amp;#039;s contributors and gave a shoutout to Mathematica&amp;#039;s accomplishments by saying:&#xD;
-------------------&#xD;
&#xD;
&#xD;
&amp;gt;  &#xD;
&amp;gt; **Why Computing Digits of the MRB Constant Is Interesting**&#xD;
&amp;gt; &#xD;
&amp;gt; At first glance, the computation of ever more digits of a numerical&#xD;
&amp;gt; constant may appear to be a sterile exercise, offering little insight&#xD;
&amp;gt; beyond the digits themselves. For the MRB constant, this&#xD;
&amp;gt; interpretation is profoundly misleading. The interest lies not in the&#xD;
&amp;gt; digits, but in the act of computing them.&#xD;
&amp;gt; &#xD;
&amp;gt; The MRB series occupies a delicate numerical regime: it is convergent,&#xD;
&amp;gt; yet only marginally so; its terms are elementary in form, yet hostile&#xD;
&amp;gt; to naive numerical evaluation; and its alternating structure conceals&#xD;
&amp;gt; severe cancellation effects. As a result, each additional digit of&#xD;
&amp;gt; accuracy is not merely an extension of a decimal expansion, but a&#xD;
&amp;gt; validation of the mathematical and algorithmic framework used to&#xD;
&amp;gt; obtain it.&#xD;
&amp;gt; &#xD;
&amp;gt; In this sense, the digits serve as a stress test for mathematics&#xD;
&amp;gt; itself. They expose the difference between formal convergence and&#xD;
&amp;gt; effective convergence, between theoretical existence and computational&#xD;
&amp;gt; feasibility. Techniques that are elegant on paper often fail&#xD;
&amp;gt; catastrophically in practice, while successful methods must balance&#xD;
&amp;gt; asymptotics, numerical stability, precision control, and computational&#xD;
&amp;gt; cost.&#xD;
&amp;gt; &#xD;
&amp;gt; Moreover, the computation of the MRB constant forces the&#xD;
&amp;gt; reconciliation of disparate mathematical ideas. Alternating series,&#xD;
&amp;gt; logarithmic asymptotics, convergence acceleration, special functions,&#xD;
&amp;gt; and analytic continuation must all agree numerically. Any hidden&#xD;
&amp;gt; inconsistency&amp;#x2014;whether conceptual or computational&amp;#x2014;reveals itself&#xD;
&amp;gt; immediately in the failure of the digits to stabilize.&#xD;
&amp;gt; &#xD;
&amp;gt; Thus, computing digits of the MRB constant transforms mathematics from&#xD;
&amp;gt; a static collection of statements into a living experiment. The&#xD;
&amp;gt; resulting digits are not trophies; they are evidence. They measure the&#xD;
&amp;gt; effectiveness of our methods, the soundness of our assumptions, and&#xD;
&amp;gt; the practical reach of our theory.&#xD;
&amp;gt; &#xD;
&amp;gt; In short, the digits themselves do not matter. What matters is that&#xD;
&amp;gt; they *can* be computed at all&amp;#x2014;and how difficult it is to do so.&#xD;
&amp;gt; That difficulty is precisely what makes the MRB constant&#xD;
&amp;gt; mathematically interesting.&#xD;
&#xD;
**In general, we will see:**&#xD;
![enter image description here][7]&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
----------&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
&#xD;
 &#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2024-11-25023042.png&amp;amp;userId=366611&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2026-01-01235656.png&amp;amp;userId=366611&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2026-01-01235710.png&amp;amp;userId=366611&#xD;
  [7]: https://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2026-02-18190718.png&amp;amp;userId=366611</description>
    <dc:creator>Marvin Ray Burns A.G.S. (cum laude)</dc:creator>
    <dc:date>2014-10-09T18:08:49Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1323951">
    <title>How to calculate the digits of the MKB constant</title>
    <link>https://community.wolfram.com/groups/-/m/t/1323951</link>
    <description>This has been one of my favorite Mathematica projects!&#xD;
Here are a couple of Ai generated outlines of my progress of computing the MKB constant digits:&#xD;
![enter image description here][1]&#xD;
![enter image description here][2]&#xD;
&#xD;
&#xD;
  [1]: https://community.wolfram.com//c/portal/getImageAttachment?filename=4506unnamed.png&amp;amp;userId=366611&#xD;
  [2]: https://community.wolfram.com//c/portal/getImageAttachment?filename=unnamed%281%29.png&amp;amp;userId=366611</description>
    <dc:creator>Marvin Ray Burns A.G.S. (cum laude)</dc:creator>
    <dc:date>2018-04-20T12:06:18Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/157461">
    <title>Building a GPS tracker with the Raspberry Pi</title>
    <link>https://community.wolfram.com/groups/-/m/t/157461</link>
    <description>This post shows how to build a simple GPS tracker with the Wolfram Language on a Raspberry Pi. 

To recreate this experiment you will need the following hardware (in addition to the Raspberry Pi itself):
[list]
[*][url=http://www.adafruit.com/products/746]Ultimate GPS Breakout[/url]
[*][url=http://www.adafruit.com/products/954]USB to TTL serial cable[/url]
[*][url=http://www.adafruit.com/products/954][/url][url=http://www.adafruit.com/products/64]Half-size bread board[/url]
[*][url=http://www.adafruit.com/products/758]Male/male jumper wires[/url]
[/list]Plug the GPS module into the breadboard as shown and connect red to VIN, black to GND, green to RX and white to TX, using the jumper wires and the USB to TTL serial cable. Plug the USB end of the cable into the Raspberry Pi (powered down). Power up your Raspberry Pi.

[img=width: 512px; height: 384px;]/c/portal/getImageAttachment?filename=1-out.jpg&amp;amp;userId=11733[/img]

The GPS module starts to transmit data shortly after power up and will continue to do so until it is unplugged from a power source.

In a terminal start the Wolfram Language using the following command:
[code]&amp;gt; wolfram

Wolfram Language (Raspberry Pi Pilot Release)
Copyright 1988-2013 Wolfram Research
Information &amp;amp; help: wolfram.com/raspi

In[1]:= 
[/code]

You can now open the serial port using the [url=reference.wolfram.com/language/ref/DeviceOpen.html]DeviceOpen [/url]by entering:
[mcode]serial = DeviceOpen[&amp;#034;Serial&amp;#034;,{&amp;#034;/dev/ttyUSB0&amp;#034;,&amp;#034;BaudRate&amp;#034;-&amp;gt;9600}]
[/mcode]

This returns a DeviceObject which can be used to read GPS data from. In this case we use [url=http://reference.wolfram.com/language/ref/DeviceReadBuffer.html]DeviceReadBuffer [/url]to read all available GPS data that has been generated up to this point:
[mcode]data = DeviceReadBuffer[serial,&amp;#034;String&amp;#034;]
[/mcode]
The data returned is in a comma separated format, called [url=http://aprs.gids.nl/nmea/]GPS NMEA sentences[/url].[code]     $GPRMC,154541.000,A,4005.8369,N,08814.7322,W,0.04,253.32,201113,,,A*79
     $GPVTG,253.32,T,,M,0.04,N,0.07,K,A*3B
     $GPGGA,154542.000,4005.8369,N,08814.7322,W,1,8,1.07,228.0,M,-33.9,M,,*6B
     $GPGSA,A,3,04,12,10,17,23,24,25,02,,,,,1.31,1.07,0.76*04
     $GPGSV,3,1,12,04,65,040,24,02,63,265,16,10,55,135,39,12,48,302,21*7D
     $GPGSV,3,2,12,17,35,096,33,05,19,190,17,25,13,321,33,24,12,247,16*71
     $GPGSV,3,3,12,23,05,061,31,13,02,090,27,20,02,036,35,45,,,*45
     $GPRMC,154542.000,A,4005.8369,N,08814.7322,W,0.06,253.32,201113,,,A*78[/code]
We can import the data with the Wolfram Language using ImportString:[mcode]csv = ImportString[ data, &amp;#034;CSV&amp;#034; ][/mcode]
The NMEA sentences which contain GPS coordinates start with $GPRMC so we filter for those using Cases and pattern matching:[mcode]gps = Cases[ csv, {&amp;#034;$GPRMC&amp;#034;, ___} ][/mcode]
The coordinates (latitude and longitude) are in the 4th and 6th position of each list, for example this is the GPS coordinate for the first data point:[mcode]Part[ gps, 1, {4,6} ] / 100[/mcode]
which returns the GPS location for Champaign, Illinois, where Wolfram Research is located 40&amp;#039; North, 88&amp;#039; West):[mcode]{40.0583, 88.1474}

[/mcode]</description>
    <dc:creator>Arnoud Buzing</dc:creator>
    <dc:date>2013-11-21T17:10:15Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/457288">
    <title>LaTeX typesetting in Mathematica</title>
    <link>https://community.wolfram.com/groups/-/m/t/457288</link>
    <description>[![Join the chat at https://gitter.im/MaTeX-help/Lobby](https://badges.gitter.im/MaTeX-help/Lobby.svg)](https://gitter.im/MaTeX-help/Lobby?utm_source=badge&amp;amp;utm_medium=badge&amp;amp;utm_campaign=pr-badge&amp;amp;utm_content=badge)&#xD;
[![GitHub (pre-)release](https://img.shields.io/github/release/szhorvat/MaTeX/all.svg)](https://github.com/szhorvat/MaTeX/releases)&#xD;
[![Github All Releases](https://img.shields.io/github/downloads/szhorvat/MaTeX/total.svg)](https://github.com/szhorvat/MaTeX/releases)&#xD;
[![Contributions welcome](https://img.shields.io/badge/contributions-welcome-brightgreen.svg)](https://github.com/szhorvat/MaTeX/issues)&#xD;
[![DOI](https://zenodo.org/badge/31675019.svg)](https://zenodo.org/badge/latestdoi/31675019)&#xD;
&#xD;
----&#xD;
&#xD;
Hello everyone,&#xD;
&#xD;
I wrote a package that makes it easy to insert LaTeX-typeset formulae in Mathematica notebooks, in particular in Mathematica graphics.  I use this to create figures with high quality typesetting that fit well with the visual style of LaTeX documents.&#xD;
&#xD;
Here&amp;#039;s the [package description][1] and here&amp;#039;s [MaTeX][2].&#xD;
&#xD;
Features of the package:&#xD;
&#xD;
 - get LaTeX-typeset snippets as Mathematica `Graphics` expressions (convenient for a Mathematica-centric workflow)&#xD;
 - the baseline is preserved so these snippets can be precisely aligned with each other or with Mathematica text&#xD;
 - control over font size, magnification and display or inline styles&#xD;
 - integrated documentation (open the documentation centre and search for &amp;#034;MaTeX&amp;#034;)&#xD;
&#xD;
Let me know what you think and whether you find it useful.&#xD;
&#xD;
A quick demo:&#xD;
&#xD;
&amp;lt;img src=&amp;#034;http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2017-09-0111.08.27.png&amp;amp;userId=38370&amp;#034; width=&amp;#034;772&amp;#034;&amp;gt;&#xD;
&#xD;
&#xD;
  [1]: http://szhorvat.net/pelican/latex-typesetting-in-mathematica.html&#xD;
  [2]: https://github.com/szhorvat/MaTeX&#xD;
  [3]: http://community.wolfram.com//c/portal/getImageAttachment?filename=Screenshot2017-09-0111.08.27.png&amp;amp;userId=38370</description>
    <dc:creator>Szabolcs Horvát</dc:creator>
    <dc:date>2015-03-12T01:39:42Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/157473">
    <title>Using the GPIO with the Wolfram Language + Raspberry Pi</title>
    <link>https://community.wolfram.com/groups/-/m/t/157473</link>
    <description>This post shows how to use the GPIO with the Wolfram Language on a Raspberry Pi. 

To recreate this experiment you will need the following hardware (in addition to the Raspberry Pi itself):
[list]
[*][url=http://www.adafruit.com/products/301]Super Bright Blue 5mm LED[/url]
[*][url=http://www.adafruit.com/products/1105]Pi T-Cobbler Breakout Kit[/url]
[*][url=http://www.adafruit.com/products/239]Full sized breadboard[/url]
[*][url=http://www.adafruit.com/products/758]Male/male jumper wires[/url]
[*]A 400 ohm resistor (to prevent the LEDs from burning out).
[/list]

Set up the breadboard as shown: Plug the T-Cobbler into the breadboard with 13 pins in the E column and 13 pin in the G column. Use the jumper wires
to connect pins 4, 17, 27, 22, 18, 23, 24 and 25 to evenly spaced free rows lower on the breadboard. Connect 8 blue LEDs from each jumper wire row to
the blue - column, with the flattened cathode side on the blue - column. Complete the circuit by connecting the resistor from the blue - column to the GND pin.
Connect the ribbon cable to the T-Cobbler and the Raspberry Pi correctly, and turn on your Raspberry Pi.

[img=width: 512px; height: 683px;]/c/portal/getImageAttachment?filename=2-5344gpio_community.jpg&amp;amp;userId=11733[/img]

The GPIO interface requires root privilege for access so the Wolfram Language or Mathematica needs to be started as root for this experiment.

In a terminal start the Wolfram Language using the following command (as root):
[code]&amp;gt; sudo wolfram

Wolfram Language (Raspberry Pi Pilot Release)
Copyright 1988-2013 Wolfram Research
Information &amp;amp; help: wolfram.com/raspi

In[1]:= 
[/code]

First we define the pins that correspond to connected LEDs:
[mcode]pins = {4,17,27,22,18,23,24,25}
[/mcode]

Next we can turn on individual LEDs by writing the value &amp;#039;1&amp;#039; to it:
[mcode]DeviceWrite[ &amp;#034;GPIO&amp;#034;, First[pins] -&amp;gt; 1 ]
[/mcode]

And of course turn it back off, by writing the value &amp;#039;0&amp;#039;:
[mcode]DeviceWrite[ &amp;#034;GPIO&amp;#034;, First[pins] -&amp;gt; 0 ]
[/mcode]

Or turn the LEDs on and off one at a time:
[mcode]Do[ 
 DeviceWrite[ &amp;#034;GPIO&amp;#034;, pins[[i]]-&amp;gt;1 ]; 
 Pause[.2]; 
 DeviceWrite[ &amp;#034;GPIO&amp;#034;, pins[[i]]-&amp;gt;0 ];
 ,{i,8}] 
[/mcode]</description>
    <dc:creator>Arnoud Buzing</dc:creator>
    <dc:date>2013-11-21T17:13:19Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/157704">
    <title>Snapping pictures with the Wolfram Language on the Raspberry Pi</title>
    <link>https://community.wolfram.com/groups/-/m/t/157704</link>
    <description>This post shows how to use the standard Raspberry Pi camera with the Wolfram Language on a Raspberry Pi. 

To recreate this experiment you will need the following hardware (in addition to the Raspberry Pi itself):
[list]
[*][url=http://www.adafruit.com/products/1367l]Raspberry Pi Camera Board[/url]
[/list]
First configure your Raspberry Pi Camera Board following the instructions from the [url=http://www.raspberrypi.org/camera]Raspberry Pi Camera web page[/url].

From the desktop double click the &amp;#039;Mathematica&amp;#039; icon or type &amp;#039;mathematica&amp;#039; in a terminal to launch the notebook interface.

To take pictures, simply run the DeviceRead command:

[mcode]DeviceRead[&amp;#034;RaspiCam&amp;#034;]
[/mcode]

[img=width: 800px; height: 500px;]/c/portal/getImageAttachment?filename=4-camdesk_community.jpg&amp;amp;userId=11733[/img]</description>
    <dc:creator>Arnoud Buzing</dc:creator>
    <dc:date>2013-11-21T17:19:08Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/157340">
    <title>Installing the Wolfram Language and Mathematica on your Raspberry Pi</title>
    <link>https://community.wolfram.com/groups/-/m/t/157340</link>
    <description>[i]Mathematica [/i]and The Wolfram Language are now available from ours and the Raspberry Pi foundation&amp;#039;s software repositories for the default Raspbian Linux distribution for the Pi. If you&amp;#039;re running a Raspbian image provided by the Raspberry Pi foundation, you can now install the software with the following steps:&#xD;
[list=1]&#xD;
[*]Ensure that you have at least [b]600[/b] megabytes of free storage on your Raspberry Pi&amp;#039;s SD card. The package itself will take up 429 megabytes of disk space when installed.&#xD;
[*][code]$ sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install wolfram-engine[/code]&#xD;
[*]Agree to the licensing terms displayed (Use tab to move between fields in the license window. You will only need to do this once).&#xD;
[*]Wait for the installation to complete. &#xD;
[/list]You should now find Mathematica and the Wolfram Language installed on the LXDE desktop under the [b]Education[/b] menu and the Wolfram Language under the [b]Programming [/b]&#xD;
menu.&#xD;
&#xD;
In order to start the application from the Linux command line, type:[code]$ wolfram[/code]To start Mathematica, type:[code]$ mathematica[/code]&#xD;
If you have any questions about installing the application on your Raspberry Pi, feel free to ask! </description>
    <dc:creator>Alex Newman</dc:creator>
    <dc:date>2013-11-21T17:12:50Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/122095">
    <title>Dancing with friends and enemies: boids&amp;#039; swarm intelligence</title>
    <link>https://community.wolfram.com/groups/-/m/t/122095</link>
    <description>The latest way I have found to use my expensive math software for frivolous entertainment is this. Here&amp;#039;s is a way to describe it. 
[list]
[*]1000 dancers assume random positions on the dance-floor. 
[*]Each randomly chooses one &amp;#034;friend&amp;#034; and one &amp;#034;enemy&amp;#034;. 
[*]At each step every dancer 
[list]
[*]moves 0.5% closer to the centre of the floor
[*]then takes a large step towards their friend 
[*]and a small step away from their enemy. 
[/list]
[*]At random intervals one dancer re-chooses their friend and enemy
[/list]
Randomness is deliberately injected. Here is the dance...
[mcode]n = 1000; 
r := RandomInteger[{1, n}]; 
f := (#/(.01 + Sqrt[#.#])) &amp;amp; /@ (x[[#]] - x) &amp;amp;; 
s := With[{r1 = r}, p[[r1]] = r; q[[r1]] = r]; 
x = RandomReal[{-1, 1}, {n, 2}]; 
{p, q} = RandomInteger[{1, n}, {2, n}]; 
Graphics[{PointSize[0.007], Dynamic[If[r &amp;lt; 100, s]; 
Point[x = 0.995 x + 0.02 f[p] - 0.01 f[q]]]}, PlotRange -&amp;gt; 2][/mcode]
[img]/c/portal/getImageAttachment?filename=OPTfnlfrnds.gif&amp;amp;userId=11733[/img]

Thanks to Vitaliy for posting this on my behalf, complete with animations :-)

Background: I had read somewhere that  macro-scale behaviour of animal swarms (think of flocks of starlings or shoals of herring) is explained by each individual following very simple rules local to their vicinity, essentially 1) try to keep up and 2) try not to collide. I started trying to play with this idea in Mathematica, but it was rather slow to identify the nearest neighbours of each particle. So I wondered what would happen if each particle acted according to the locations of two other particles, regardless of their proximity. The rule was simply to move away from one and towards the other.

The contraction (x = 0.995 x) was added to prevent the particle cloud from dispersing towards infinity or drifting away from the origin. I tweaked the &amp;#034;towards&amp;#034; and &amp;#034;away&amp;#034; step sizes to strike a balance between the tendency to clump together and to spread apart (if you make the step sizes equal you get something more like a swarm of flies). With each particle&amp;#039;s attractor and repeller fixed, the system finds a sort of dynamic equilibrium, so to keep things changing I added a rule to periodically change the attractor and repeller for one of the particles. The final adjustment was to make the &amp;#034;force&amp;#034; drop towards zero for particles at very close range. This helps to stop the formation of very tight clumps, and also prevents a division-by-zero error when a particle chooses itself as its attractor or repeller.

The description of the system as a dance was an attempt to explain the swirling pattern on the screen without using mathematical language. I&amp;#039;d love to see what other &amp;#034;dances&amp;#034; can be created with other simple rules.</description>
    <dc:creator>Simon Woods</dc:creator>
    <dc:date>2013-09-11T18:31:12Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1085633">
    <title>How-To-Guide: External GPU on OSX - how to use CUDA on your Mac</title>
    <link>https://community.wolfram.com/groups/-/m/t/1085633</link>
    <description>The neural network and machine learning framework has become one of the key features of the latest releases of the Wolfram Language. Training neural networks can be very time consuming on a standard CPU. Luckily the Wolfram Language offers an incredible easy way to use a GPU to train networks - and do lots of other cool stuff. The problem with this was/is that most current Macs do not have an NVIDIA graphics card, which is necessary to access this framework within the Wolfram Language. Therefore, Wolfram Inc. had decided to drop support for GPUs on Macs. There is however a way to use GPUs on Macs. For example you can use an [external GPU like the one offered by Bizon][1]. &#xD;
&#xD;
![enter image description here][2]&#xD;
&#xD;
Apart from the BizonBox there a couple of cables and a power supply. You can buy/configure different versions of the BizonBox: there is a range of different graphics cards available and you can buy a the BizonBox 2s which basically connects via Thunderbolt and the BizonBox 3 which connects to USB-C. &#xD;
&#xD;
Luckily, Wolfram have decided to reintroduce support for GPUs in Mathematica 11.1.1 - see [the discussion here][3]. &#xD;
&#xD;
 I have a variety of these BizonBoxes (both 2s and 3) and a range of Macs. I thought it would be a good idea to post a how-to. The essence of what I will be describing in this post should work for most Macs. I ran Sierra on all of them. Here is the recipe to get the thing to work:&#xD;
&#xD;
Installation of the BizonBox, the required drivers, and compilers&#xD;
-----------------------------------------------------------------&#xD;
&#xD;
0. I will assume that you have Sierra installed and that Xcode is running. One of the really important steps if you want to use compilers is to ***downgrade*** the command line tools to version 7.3 You will  have to log into your Apple Developer account and download the Command Line Tools version 7.3. Install the tools and run the  terminal command (not in Mathematica!): &#xD;
&#xD;
        sudo xcode-select  --switch /Library/Developer/CommandLineTools&#xD;
&#xD;
1. Reboot your Mac into safe mode, i.e. hold CMD+R while rebooting. &#xD;
&#xD;
2. Open a terminal (under item Utilities at the top of the screen).&#xD;
&#xD;
3. Enter &#xD;
&#xD;
        csrutil disable &#xD;
&#xD;
4. Shut the computer down.&#xD;
&#xD;
5. Connect your BizonBox to the mains and to either the thunderbolt or USB-C port of your Mac.&#xD;
&#xD;
6. Restart your Mac. &#xD;
&#xD;
7. Click on the Apple symbol in the top left. Then &amp;#034;About this Mac&amp;#034; and &amp;#034;System Report&amp;#034;. In the Thunderbolt section you should see something like this:&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
8. In the documentation of the BizonBox you will find a link to a program called bizonboxmac.zip. Download that file and unzip it.&#xD;
&#xD;
9. Open the folder and click on &amp;#034;bizonbox.prefPane&amp;#034; to install. (If prompted to, do update!)&#xD;
&#xD;
10. You should see this window:&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
11. Click on Activate. Type in password if required to do so. It should give something like this:&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
Then restart.&#xD;
&#xD;
12.  Install the CUDA Toolkit: [https://developer.nvidia.com/cuda-downloads][8]. You&amp;#039;ll have to click through some questions for the download. &#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
what you download should be something like cuda_8.0.61_mac.dmg and it should be more or less 1.44 GB worth. &#xD;
&#xD;
13.  Install the toolkit with all its elements.&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
14. Restart your computer.&#xD;
&#xD;
First tests&#xD;
-----------&#xD;
&#xD;
Now you should be good to go. Open Mathematica 11.1.1. Execute &#xD;
&#xD;
    Needs[&amp;#034;CUDALink`&amp;#034;]&#xD;
    Needs[&amp;#034;CCompilerDriver`&amp;#034;]&#xD;
    CUDAResourcesInstall[]&#xD;
&#xD;
Then try:&#xD;
&#xD;
    CUDAResourcesInformation[]&#xD;
&#xD;
which should look somewhat like this:&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
 Then you should check &#xD;
&#xD;
    SystemInformation[]&#xD;
&#xD;
Head to Links and then CUDA.This should look similar to this:&#xD;
&#xD;
![enter image description here][12]&#xD;
&#xD;
So far so good. Next is the really crucial thing:&#xD;
&#xD;
    CUDAQ[]&#xD;
&#xD;
should give TRUE. If that&amp;#039;s what you see you are good to go. Be more daring and try&#xD;
&#xD;
    CUDAImageConvolve[ExampleData[{&amp;#034;TestImage&amp;#034;,&amp;#034;Lena&amp;#034;}], N[BoxMatrix[1]/9]] // AbsoluteTiming&#xD;
&#xD;
![enter image description here][13]&#xD;
&#xD;
You might notice that the non-GPU version of this command runs faster:&#xD;
&#xD;
    ImageConvolve[ExampleData[{&amp;#034;TestImage&amp;#034;,&amp;#034;Lena&amp;#034;}], N[BoxMatrix[1]/9]] // AbsoluteTiming&#xD;
&#xD;
runs in something like 0.0824 seconds, but that&amp;#039;s ok. &#xD;
&#xD;
Benchmarking (training neural networks)&#xD;
---------------------------------------&#xD;
&#xD;
Let&amp;#039;s do some Benchmarking. Download some example data:&#xD;
&#xD;
    obj = ResourceObject[&amp;#034;CIFAR-10&amp;#034;]; &#xD;
    trainingData = ResourceData[obj, &amp;#034;TrainingData&amp;#034;]; &#xD;
    RandomSample[trainingData, 5]&#xD;
&#xD;
You can check whether it worked:&#xD;
&#xD;
    RandomSample[trainingData, 5]&#xD;
&#xD;
should give something like this:&#xD;
&#xD;
![enter image description here][14]&#xD;
&#xD;
These are the classes of the 50000 images:&#xD;
&#xD;
    classes = Union@Values[trainingData] &#xD;
&#xD;
![enter image description here][15]&#xD;
&#xD;
Let&amp;#039;s build a network &#xD;
&#xD;
    module = NetChain[{ConvolutionLayer[100, {3, 3}], &#xD;
       BatchNormalizationLayer[], ElementwiseLayer[Ramp], &#xD;
       PoolingLayer[{3, 3}, &amp;#034;PaddingSize&amp;#034; -&amp;gt; 1]}]&#xD;
    &#xD;
    net = NetChain[{module, module, module, module, FlattenLayer[], 500, &#xD;
       Ramp, 10, SoftmaxLayer[]}, &#xD;
      &amp;#034;Input&amp;#034; -&amp;gt; NetEncoder[{&amp;#034;Image&amp;#034;, {32, 32}}], &#xD;
      &amp;#034;Output&amp;#034; -&amp;gt; NetDecoder[{&amp;#034;Class&amp;#034;, classes}]]&#xD;
&#xD;
When you train the network:&#xD;
&#xD;
    {time, trained} = AbsoluteTiming@NetTrain[net, trainingData, Automatic, &amp;#034;TargetDevice&amp;#034; -&amp;gt; &amp;#034;GPU&amp;#034;];&#xD;
&#xD;
you should see something like this:&#xD;
&#xD;
![enter image description here][16]&#xD;
&#xD;
So the thing started 45 secs ago and it supposed to finish in 2m54s. In fact, it finished after 3m30s. If we run the same on the CPU we get:&#xD;
&#xD;
![enter image description here][17]&#xD;
&#xD;
The estimate kept changing a bit, but it settled down at about 18h20m.That is slower by a factor of about 315, which is quite substantial. &#xD;
&#xD;
Use of compiler&#xD;
---------------&#xD;
&#xD;
Up to now we have not needed the actual compiler. Let&amp;#039;s try this, too. Let&amp;#039;s grow a Mandelbulb:&#xD;
&#xD;
    width = 4*640;&#xD;
    height = 4*480;&#xD;
    iconfig = {width, height, 1, 0, 1, 6};&#xD;
    config = {0.001, 0.0, 0.0, 0.0, 8.0, 15.0, 10.0, 5.0};&#xD;
    camera = {{2.0, 2.0, 2.0}, {0.0, 0.0, 0.0}};&#xD;
    AppendTo[camera, Normalize[camera[[2]] - camera[[1]]]];&#xD;
    AppendTo[camera, &#xD;
      0.75*Normalize[Cross[camera[[3]], {0.0, 1.0, 0.0}]]];&#xD;
    AppendTo[camera, 0.75*Normalize[Cross[camera[[4]], camera[[3]]]]];&#xD;
    config = Join[{config, Flatten[camera]}];&#xD;
    &#xD;
    pixelsMem = CUDAMemoryAllocate[&amp;#034;Float&amp;#034;, {height, width, 3}]&#xD;
    &#xD;
    srcf = FileNameJoin[{$CUDALinkPath, &amp;#034;SupportFiles&amp;#034;, &amp;#034;mandelbulb.cu&amp;#034;}]&#xD;
&#xD;
Now this should work:&#xD;
&#xD;
    mandelbulb = &#xD;
    CUDAFunctionLoad[File[srcf], &amp;#034;MandelbulbGPU&amp;#034;, {{&amp;#034;Float&amp;#034;, _, &amp;#034;Output&amp;#034;}, {&amp;#034;Float&amp;#034;, _, &amp;#034;Input&amp;#034;}, {&amp;#034;Integer32&amp;#034;, _, &amp;#034;Input&amp;#034;}, &amp;#034;Integer32&amp;#034;, &amp;#034;Float&amp;#034;, &amp;#034;Float&amp;#034;}, {16}, &amp;#034;UnmangleCode&amp;#034; -&amp;gt; False, &amp;#034;CompileOptions&amp;#034; -&amp;gt; &amp;#034;--Wno-deprecated-gpu-targets &amp;#034;, &amp;#034;ShellOutputFunction&amp;#034; -&amp;gt; Print]&#xD;
&#xD;
Under certain circumstances you might want to specify the location of the compiler like so:&#xD;
&#xD;
    mandelbulb = &#xD;
     CUDAFunctionLoad[File[srcf], &amp;#034;MandelbulbGPU&amp;#034;, {{&amp;#034;Float&amp;#034;, _, &amp;#034;Output&amp;#034;}, {&amp;#034;Float&amp;#034;, _, &amp;#034;Input&amp;#034;}, {&amp;#034;Integer32&amp;#034;, _, &amp;#034;Input&amp;#034;}, &amp;#034;Integer32&amp;#034;, &amp;#034;Float&amp;#034;, &#xD;
    &amp;#034;Float&amp;#034;}, {16}, &amp;#034;UnmangleCode&amp;#034; -&amp;gt; False, &amp;#034;CompileOptions&amp;#034; -&amp;gt; &amp;#034;--Wno-deprecated-gpu-targets &amp;#034;, &amp;#034;ShellOutputFunction&amp;#034; -&amp;gt; Print, &#xD;
    &amp;#034;CompilerInstallation&amp;#034; -&amp;gt; &amp;#034;/Developer/NVIDIA/CUDA-8.0/bin/&amp;#034;]&#xD;
&#xD;
This should give:&#xD;
&#xD;
![enter image description here][18]&#xD;
&#xD;
Now&#xD;
&#xD;
    mandelbulb[pixelsMem, Flatten[config], iconfig, 0, 0.0, 0.0, {width*height*3}];&#xD;
    pixels = CUDAMemoryGet[pixelsMem];&#xD;
    Image[pixels]&#xD;
&#xD;
gives&#xD;
&#xD;
![enter image description here][19]&#xD;
&#xD;
So it appears that all is working fine.&#xD;
&#xD;
Problems&#xD;
--------&#xD;
&#xD;
I did come up with some problems though. There is quite a number of CUDA functions:&#xD;
&#xD;
    Names[&amp;#034;CUDALink`*&amp;#034;]&#xD;
&#xD;
![enter image description here][20]&#xD;
&#xD;
Many work just fine. &#xD;
&#xD;
    res = RandomReal[1, 5000];&#xD;
    ListLinePlot[res]&#xD;
&#xD;
![enter image description here][21]&#xD;
&#xD;
    ListLinePlot[First@CUDAImageConvolve[{res}, {GaussianMatrix[{{10}, 10}]}]]&#xD;
&#xD;
![enter image description here][22]&#xD;
&#xD;
The thing is that some don&amp;#039;t and I am not sure why (I have a hypothesis though). Here are some functions that do **not** appear to work:&#xD;
&#xD;
CUDAColorNegate&#xD;
CUDAClamp&#xD;
CUDAFold&#xD;
CUDAVolumetricRender&#xD;
CUDAFluidDynamics&#xD;
&#xD;
and some more. I would be very grateful if someone could check these on OSX (and perhaps Windows?). I am not sure if the this is due to some particularity of my systems or something that could be flagged up to Wolfram Inc for checking.  &#xD;
&#xD;
 When I wanted to try that systematically I wanted to use the function&#xD;
&#xD;
    WolframLanguageData&#xD;
&#xD;
to look for the first example in the documentation of the CUDA functions, but it appears that no CUDA function is in the WolframLanguageData. I think tit would be great to have them there, too, and am not sure why they wouldn&amp;#039;t be there. &#xD;
&#xD;
In spite of these problems I hope that this post will help some Mac users to get CUDA going. It is a great framework and simple to use in the Wolfram Language. With the BizonBox and Mathematica 11.1.1 Mac users are no  longer excluded from accessing this feature. &#xD;
&#xD;
Cheers,&#xD;
&#xD;
Marco&#xD;
&#xD;
PS: Note, that there is anecdotal evidence that one can even use the BizonBox under Windows running in a virtual box under OSX. I don&amp;#039;t have Windows, but I&amp;#039;d like to hear if anyone get this running. &#xD;
&#xD;
  [1]: https://bizon-tech.com&#xD;
  [2]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at22.09.10.png&amp;amp;userId=48754&#xD;
  [3]: http://community.wolfram.com/groups/-/m/t/902394&#xD;
  [4]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot1.png&amp;amp;userId=48754&#xD;
  [5]: http://bizon-tech.com/bizonboxmac.zip&#xD;
  [6]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2.png&amp;amp;userId=48754&#xD;
  [7]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot3.png&amp;amp;userId=48754&#xD;
  [8]: https://developer.nvidia.com/cuda-downloads&#xD;
  [9]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot6.png&amp;amp;userId=48754&#xD;
  [10]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot7.png&amp;amp;userId=48754&#xD;
  [11]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at22.38.22.png&amp;amp;userId=48754&#xD;
  [12]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-06at18.46.46.png&amp;amp;userId=48754&#xD;
  [13]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at22.49.15.png&amp;amp;userId=48754&#xD;
  [14]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at22.52.43.png&amp;amp;userId=48754&#xD;
  [15]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at22.53.30.png&amp;amp;userId=48754&#xD;
  [16]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at20.37.20.png&amp;amp;userId=48754&#xD;
  [17]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at20.39.02.png&amp;amp;userId=48754&#xD;
  [18]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at23.04.38.png&amp;amp;userId=48754&#xD;
  [19]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at21.50.42.png&amp;amp;userId=48754&#xD;
  [20]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at23.10.05.png&amp;amp;userId=48754&#xD;
  [21]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at23.15.59.png&amp;amp;userId=48754&#xD;
  [22]: http://community.wolfram.com//c/portal/getImageAttachment?filename=ScreenShot2017-05-07at23.16.36.png&amp;amp;userId=48754</description>
    <dc:creator>Marco Thiel</dc:creator>
    <dc:date>2017-05-07T22:21:42Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/96823">
    <title>Simple, fast compiled peak detection based on moving average</title>
    <link>https://community.wolfram.com/groups/-/m/t/96823</link>
    <description>Recently [b][url=http://community.wolfram.com/groups/-/m/t/91868]Christopher coded a neat wavelet-based method for peak detection[/url][/b]. Peak detection is often needed in various scientific fields: all sorts of spectral analysis, time series and general feature recognition in data come to mind right away.  There are many methods for peak detection. Besides his wavelet-based code Christopher also mentions a built-in MaxDetect function rooted in image processing. [b][url=http://reference.wolfram.com/mathematica/ref/MaxDetect.html]MaxDetect[/url][/b], though, being a rather elaborate tool for multi-dimensional data (2D, 3D images) and with a specific image-processing-minded parameter tuning, was not meant to target time series and other 1D data. This got me thinking.

[b]Can we come up with a minimal compile-able peak detection code that would be accurate, robust and fast in most situations for 1D data?[/b]

I am not an expert in the subject, but intuitively peak detection consists of two stages. 
[list]
[*][b]Finding all maxima[/b]. This can be done via Differences with selection of neighbor difference pairs that change from positive to negative. Such pair would indicate local maximum.
[*][b]Filtering out peaks[/b]. Selecting those maxima that are high splashes of amplitude with respect to its immediate neighborhood. Quoted words are relative and depend on particular data. This is why they are set as tuning parameters in the algorithm.
[/list]To illustrate 2nd point lets take a look at the [b][url=http://www.wolframalpha.com/input/?i=Albert+Einstein+Wikipedia+page+hits+history]Albert Einstein Wikipedia page hits history[/url][/b] below. Obviously a large peak in the past can be lower than current average in case if there is strong trend in the data. This is why we need windowing when looking for peaks, - to compare a peak to its immediate neighborhood. 

[url=http://www.wolframalpha.com/input/?i=Albert+Einstein+Wikipedia+page+hits+history][img=width: 600px; height: 469px;]/c/portal/getImageAttachment?filename=ScreenShot2013-08-14at3.13.07PM.png&amp;amp;userId=11733[/img][/url]

Without further ado here is a function written specifically in terms of functions that can be compiled. For example I do not use MovingAverage, but do trick with Partition instead.[mcode]PeakDetect = Compile[{{data, _Real, 1}, {width, _Integer}, {cut, _Real}}, (Table[0, {width}]~Join~
      Map[UnitStep[# - cut] &amp;amp;, data[[1 + width ;; -1 - width]] - Map[Mean, Partition[data, 1 + 2 width, 1]]]~Join~
      Table[0, {width}]) ({0}~Join~ Map[Piecewise[{{1, Sign[#] == {1, -1}}, {0, Sign[#] != {1, -1}}}] &amp;amp;, 
       Partition[Differences[data], 2, 1]]~Join~{0}), CompilationTarget -&amp;gt; &amp;#034;C&amp;#034;];[/mcode]The legend for the function arguments is the following:[list]
[*]data  1D numerical list of data
[*]width  half-width of the moving average window not including central point
[*]cut  threshold at which to cut off the peak in natural units of data amplitudes 
[/list]Now lets see some usage cases. Lets import the same Albert Einstein data as a proof of concept. [mcode]raw = WolframAlpha[ &amp;#034;albert einstein&amp;#034;, {{&amp;#034;PopularityPod:WikipediaStatsData&amp;#034;, 1}, &amp;#034;TimeSeriesData&amp;#034;}];
data = raw[[All, 2]][[All, 1]];[/mcode]We use total window width of 5 points here and cut off peak at a standard deviation of the whole data. The peak labeled May 2008 is nicely picked up even though it is comparable then current average. This peak is most probably due to publication on May 13, 2008 of [b][url=http://www.amazon.com/Einstein-Life-Universe-Walter-Isaacson/dp/0743264746]one of the most famous books about Einstein[/url][/b] marked as New York Times bestseller that also got award Quill Award. Of course you can play with controls to pick or drop peaks. On the top plot one sees data, moving average, and bands formed by moving average displaced up and down by fraction of standard deviation. Any maximum above the top band becomes a peak.

[url=http://www.amazon.com/Einstein-Life-Universe-Walter-Isaacson/dp/0743264746][img=width: 800px; height: 382px;]/c/portal/getImageAttachment?filename=9672ScreenShot2013-08-14at3.47.18PM.png&amp;amp;userId=11733[/img][/url]

The code for the app is at the very end. Lets try a different data set  recent sun spot activity. [mcode]raw = WolframAlpha[&amp;#034;sun spot&amp;#034;, {{&amp;#034;SunspotsPartialTimeSeries:SpaceWeatherData&amp;#034;, 1}, &amp;#034;TimeSeriesData&amp;#034;}];
data = raw[[All, 2]];[/mcode]We right away found on May 2013 mark - a [b][url=http://en.wikipedia.org/wiki/Solar_cycle_24#May_2013]most powerful recent event described in Wikipedia page here[/url][/b]. Please let me know if you have suggestions how to speed this up or improve it generally. I would be very curious to know your opinion and critique. 

[color=#ff0000][i]The .GIF below is large - wait till it is loaded.[/i][/color]

[img=width: 800px; height: 380px;]/c/portal/getImageAttachment?filename=sunspot.gif&amp;amp;userId=11733[/img]

The following reference could be useful:[list]
[*][b][url=http://www.tcs-trddc.com/trddc_website/pdf/SRL/Palshikar_SAPDTS_2009.pdf]Simple Algorithms for Peak Detection in Time-Series[/url][/b]
[*][b][url=http://www.mdpi.com/1999-4893/5/4/588]An Efficient Algorithm for Automatic Peak Detection in Noisy Periodic and Quasi-Periodic Signals[/url][/b]
[/list]The code for the interactive app:[mcode]Manipulate[
 tt = {#, 
     Rotate[DateString[#, {&amp;#034;MonthNameShort&amp;#034;, &amp;#034; &amp;#034;, &amp;#034;Year&amp;#034;}], Pi/2]} &amp;amp; /@
    Pick[raw, PeakDetect[data, wid, thr StandardDeviation[data]], 1][[
    All, 1]];
 
 Column[{
   
   ListLinePlot[{data, 
     ArrayPad[MovingAverage[data, 1 + 2 wid], wid, &amp;#034;Fixed&amp;#034;], 
     ArrayPad[MovingAverage[data, 1 + 2 wid], wid, &amp;#034;Fixed&amp;#034;] + 
      thr StandardDeviation[data], 
     ArrayPad[MovingAverage[data, 1 + 2 wid], wid, &amp;#034;Fixed&amp;#034;] - 
      thr StandardDeviation[data]}, AspectRatio -&amp;gt; 1/6, 
    ImageSize -&amp;gt; 800, Filling -&amp;gt; {2 -&amp;gt; {1}, 3 -&amp;gt; {4}}, 
    FrameTicks -&amp;gt; {None, Automatic}, 
    FillingStyle -&amp;gt; {Directive[Red, Opacity[.7]], 
      Directive[Blue, Opacity[.7]], Directive[Gray, Opacity[.1]]}, 
    PlotStyle -&amp;gt; Opacity[.7], PlotRange -&amp;gt; All, Frame -&amp;gt; True, 
    GridLines -&amp;gt; Automatic, PlotRangePadding -&amp;gt; 0],
   
   Show[
    DateListPlot[raw, Joined -&amp;gt; True, AspectRatio -&amp;gt; 1/6, 
     ImageSize -&amp;gt; 800, Filling -&amp;gt; Bottom, Ticks -&amp;gt; {tt, Automatic}, 
     Frame -&amp;gt; False, Mesh -&amp;gt; All, PlotRange -&amp;gt; All],
    DateListPlot[
     If[# == {}, raw[[1 ;; 2]], #, #] &amp;amp;[
      Pick[raw, PeakDetect[data, wid, thr StandardDeviation[data]], 
       1]], AspectRatio -&amp;gt; 1/6, ImageSize -&amp;gt; 800, 
     PlotStyle -&amp;gt; Directive[Red, PointSize[.007]], PlotRange -&amp;gt; All]
    , PlotRangePadding -&amp;gt; {0, Automatic}]
   
   }],
 Row[{
   Control[{{thr, 1, &amp;#034;threshold&amp;#034;}, 0, 2, Appearance -&amp;gt; &amp;#034;Labeled&amp;#034;}], 
   Spacer[100],
   Control[{{wid, 3, &amp;#034;hal-width&amp;#034;}, 1, 10, 1, Setter}]
   }]
 ][/mcode]
[b]============== UPDATE =================[/b]

Thank you all very much for contributing. I collected everyone&amp;#039;s efforts and Danny&amp;#039;s two functions in a single completely compile-able expression which seems to give shortest time; - but just vaguely faster then Danny&amp;#039;s ingenious maneuver. I very much liked format suggested by Christopher, the one that Michael also kept in his packages. But I wanted to make some benchmarking and thus followed the format returned by the function [b][url=http://reference.wolfram.com/mathematica/ref/MaxDetect.html]MaxDetect[/url][/b] - simply for the sake of speed comparison. This format is just a binary list of the length of original data with 1s in positions of found peaks. 

Here is the function:[mcode]PeakDetect = 
  Compile[{{data, _Real, 1}, {width, _Integer}, {cut, _Real}}, 
   (Table[0, {width}]~Join~
      UnitStep[
       Take[data, {1 + width, -1 - width}] - 
          (Module[{tot = Total[#1[[1 ;; #2 - 1]]], last = 0.}, 
              Table[tot = tot + #1[[j + #2]] - last; 
               last = #1[[j + 1]];
               tot, {j, 0, Length[#1] - #2}]]/#2) &amp;amp;[data, 1 + 2 width] - cut]
    ~Join~Table[0, {width}]) ({0}~Join~
      Table[If[Sign[{data[[ii + 1]] - data[[ii]], 
           data[[ii + 2]] - data[[ii + 1]]}] == {1, -1}, 1, 0], 
           {ii, 1, Length[data] - 2}]~Join~{0}), CompilationTarget -&amp;gt; &amp;#034;C&amp;#034;];
dat = RandomReal[1, 10^7];

pks = MaxDetect[dat]; // AbsoluteTiming
Total[pks]
(* ======== output ======== 
{62.807928, Null}
3333361
   ======== output ======== *)

pks = PeakDetect[dat, 1, 0]; // AbsoluteTiming
Total[pks]
(* ======== output ======== 
{1.560074, Null}
3333360
   ======== output ======== *)[/mcode]And here are the speed benchmarks on 10 million data points which shows 40 times speed-up:</description>
    <dc:creator>Vitaliy Kaurov</dc:creator>
    <dc:date>2013-08-14T21:21:54Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/413928">
    <title>Origami: Mathematica and Wolfram|Alpha Logos</title>
    <link>https://community.wolfram.com/groups/-/m/t/413928</link>
    <description># Origami: Mathematica and Wolfram|Alpha Logos&#xD;
![enter image description here][1]&#xD;
&#xD;
I made these models as a gift for my geeky husband. Turns out these are great home decoration and cat toys!&#xD;
If you are interested in geeky home decoration or killing some time in a geeky way, try make your own origami logos follow the instruction below.&#xD;
&#xD;
# What&amp;#039;s in the logo?&#xD;
[This blog post][2] from WolframAlpha blog explained what the logos are in geometry. The origami models are made using unit origami method, that is making simple units and assemble them together to form a certain shape. Understanding the constituents of the logos might make the assembling easier.&#xD;
&#xD;
## Spikey&#xD;
Mathematica logo v1 (Spikey) &amp;#034;consisted of the spiked solid obtained from an icosahedron (the regular 20-faced solid that is one of the five Platonic solids) with regular tetrahedra (triangular pyramids) affixed to its faces.&amp;#034; Spikey has 60 equilateral triangular faces. Our basic unit contains two equilateral triangles, which means we need to make 30 units.&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
## Wolfram|Alpha&#xD;
The logo is a rhombic hexecontahedron (rhombic refers to the fact that the faces of the solid consist of rhombi, while hexecontahedron is a word derived from the Greek, which simply means 60-faced solid). The shape of the faces is called [golden rhombus][4], which is very hard to construct in origami. Luckily this rhombus has an approximately 60 degree angle. I decided to use the same unit as Spikey. It needs 60 units to construct the Wolfram|Alpha logo.&#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
# You will need&#xD;
&#xD;
- Origami paper: 30 pieces for Spikey and 60 pieces for Wolfram Alpha. If you use 7.5cm paper for Spikey or 5cm paper for Wolfram Alpha, your final work will be around 9cm in diameter.&#xD;
- Knife: To cut paper in certain size.&#xD;
- Glue: In fact you dont need anything like glue at all to finish the work. Just in case you want your model more stable and longer-lasting.&#xD;
&#xD;
## Tips&#xD;
- Don&amp;#039;t use thick paper for the work, as the folding gets very complicated in the end.&#xD;
- If you decided not to use any glue, don&amp;#039;t use slippery paper. It will drive you crazy!&#xD;
- The folding gets easier when you use larger paper, but the assembling will be looser and harder to make last.&#xD;
- Using professional origami paper will save you a lot of cutting effort.&#xD;
&#xD;
# Basic Unit Folding Instruction&#xD;
&#xD;
### Step 0&#xD;
&#xD;
Get your paper ready, colored side down. Fold the right part left to make the paper in half. Crease and open. Youll see a lot of steps just like this: Crease and open. It seems like an undo operation to what youve just done but these steps are definitely not useless. Origami needs geometry to fold certain shapes. Usually it uses creases as a reference to the following steps.&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
### Step 1&#xD;
&#xD;
Using the bottom-left corner as a pivot, fold the bottom-right corner up. Make it land on the crease made in Step 0. Crease and open. You may find our first 60° angle in the shape. Do the same folding on the opposite side.&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
### Step 2&#xD;
&#xD;
Now we have three creases intersecting in a single point. Fold bottom-left and bottom-right corners to the intersection. Crease and open. Two new intersections appeared on the bottom of the square. Fold the left and right edge to the center, make the corners land on the new intersections. For the first time, we dont need to open the folding. The width of the current shape is the length of the longer diagonal of our final rhombus.&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
![enter image description here][10]&#xD;
&#xD;
### Step 3&#xD;
&#xD;
Find the intersection of the right edge and the crease made in Step 1. Using the intersection as a pivot, fold the top-right corner down so that the edge is aligned with the crease marked in the picture. Crease and open. Fold the opposite side down in the same way, but dont unfold this time. Fold the triangle upward.&#xD;
&#xD;
![enter image description here][11]&#xD;
&#xD;
![enter image description here][12]&#xD;
&#xD;
### Step 4&#xD;
&#xD;
Pinch the top layer and pull out. Fold the bottom-right up using the crease made in Step 1. Do it again in the opposite direction: Fold the triangle down, pinch the top layer and pull out.&#xD;
&#xD;
![enter image description here][13]&#xD;
&#xD;
![enter image description here][14]&#xD;
&#xD;
### Step 5&#xD;
&#xD;
Fold the right part to the left. Crease and open. The following movement is a little bit hard to describe. We need to pinch the marked point, pull to the left, using the center line crease. The animated graphic below might be easier to follow. Fold the triangle upward.&#xD;
&#xD;
![enter image description here][15]&#xD;
&#xD;
![enter image description here][16]&#xD;
&#xD;
![enter image description here][17]&#xD;
&#xD;
### Step 6&#xD;
&#xD;
Fold the shaded triangle inward, insert it under the layer below. Repeat Step 5-6 in the opposite direction: Pull the left part to the right, fold the triangle down and fold the shaded part inward.&#xD;
&#xD;
![enter image description here][18]&#xD;
&#xD;
![enter image description here][19]&#xD;
&#xD;
### Step 7&#xD;
&#xD;
Insert the marked parts one layer down. And its done! Turn over and youll see a perfect rhombus with a 60° angle.&#xD;
&#xD;
![enter image description here][20]&#xD;
&#xD;
![enter image description here][21]&#xD;
&#xD;
# Assembly Method&#xD;
&#xD;
## Spikey (1.5h to finish)&#xD;
&#xD;
### Step 0&#xD;
&#xD;
Get your 30 units ready. Before we start, we need to know how to assemble two units. Find two pockets and two joints on the unit. Fold the unit in half, and fold both joints forward as shown in the picture. When assembling, insert one joint of the unit into one pocket of the other unit until it reaches the end.&#xD;
&#xD;
![enter image description here][22]&#xD;
&#xD;
### Step 1&#xD;
&#xD;
Assemble your first 5 units. You may follow the color I used in the picture, if you wish to have a similar colored model. Our final model will have a lot (twelve) of this star-liked component.&#xD;
&#xD;
![enter image description here][23]&#xD;
&#xD;
### Step 2&#xD;
&#xD;
Attach 5 more units to the existing model. Join each new unit with two existing units on the 5-unit-structure to form a spike. We will construct twenty spikes on our final model. These 5 units added in this step are our second layer. Now we have 10 assembled units.&#xD;
&#xD;
![enter image description here][24]&#xD;
&#xD;
### Step 3&#xD;
&#xD;
We need 10 units on our third layer. Insert two units between each two units on Layer 2. Since there are 5 units on Layer 2, we will need 10 units for Layer 3. Observe the model, you will find two kinds of vertexes. The concave ones should have five units around, forming a star-liked structure, while the convex ones have three units forming a spike.&#xD;
&#xD;
![enter image description here][25]&#xD;
&#xD;
### Step 4&#xD;
&#xD;
Turn the model over, connect each two adjacent units on Layer 3 to form a spike. Assemble 5 new units to Layer 3 to form 5 more spikes.&#xD;
 &#xD;
![enter image description here][26]&#xD;
&#xD;
### Step 5&#xD;
Assemble 5 last units on the top layer to form a star-liked-structure. The final insertion might get difficult, you can fold the joint in half to make it shorter. Dont worry, the final model will still be steady enough.&#xD;
? &#xD;
![enter image description here][27]&#xD;
&#xD;
## Wolfram|Alpha (2.5h to finish) &#xD;
&#xD;
### Step 0&#xD;
&#xD;
Wolfram|Alpha logo is a rhombic hexecontahedron, that means each face is a rhombus. The insertion of the units are slightly different. We dont need to fold the unit in half, just insert the joint into the pocket of another unit. Prepare 60 red units. You may insert every 5 units together to make counting easier.&#xD;
&#xD;
![enter image description here][28]&#xD;
 &#xD;
### Step 1&#xD;
&#xD;
Use 5 units to form a star. Make 12 stars using all 60 units. Connect two stars together, every two stars have two connected vertices.&#xD;
?&#xD;
![enter image description here][29]&#xD;
&#xD;
### Step 2&#xD;
&#xD;
Follow the rule of each two stars have two connected vertices, assemble the stars. Every 6 stars can form a hemisphere. Connect two hemispheres together. And its done!&#xD;
&#xD;
![enter image description here][30]&#xD;
&#xD;
&#xD;
  [1]: /c/portal/getImageAttachment?filename=models.jpg&amp;amp;userId=394218&#xD;
  [2]: http://blog.wolframalpha.com/2009/05/19/whats-in-the-logo-that-which-we-call-a-rhombic-hexecontahedron/&#xD;
  [3]: /c/portal/getImageAttachment?filename=spikey.jpg&amp;amp;userId=394218&#xD;
  [4]: http://mathworld.wolfram.com/GoldenRhombus.html&#xD;
  [5]: /c/portal/getImageAttachment?filename=mathematica.jpg&amp;amp;userId=394218&#xD;
  [6]: /c/portal/getImageAttachment?filename=img1.png&amp;amp;userId=11733&#xD;
  [7]: /c/portal/getImageAttachment?filename=img2.png&amp;amp;userId=11733&#xD;
  [8]: /c/portal/getImageAttachment?filename=img3.png&amp;amp;userId=11733&#xD;
  [9]: /c/portal/getImageAttachment?filename=img4.png&amp;amp;userId=11733&#xD;
  [10]: /c/portal/getImageAttachment?filename=img5.png&amp;amp;userId=11733&#xD;
  [11]: /c/portal/getImageAttachment?filename=img6.png&amp;amp;userId=11733&#xD;
  [12]: /c/portal/getImageAttachment?filename=img7.png&amp;amp;userId=11733&#xD;
  [13]: /c/portal/getImageAttachment?filename=img8.png&amp;amp;userId=11733&#xD;
  [14]: /c/portal/getImageAttachment?filename=img9.png&amp;amp;userId=11733&#xD;
  [15]: /c/portal/getImageAttachment?filename=img10.png&amp;amp;userId=11733&#xD;
  [16]: /c/portal/getImageAttachment?filename=img11.png&amp;amp;userId=11733&#xD;
  [17]: /c/portal/getImageAttachment?filename=demo-1.gif&amp;amp;userId=394218&#xD;
  [18]: /c/portal/getImageAttachment?filename=img14.png&amp;amp;userId=11733&#xD;
  [19]: /c/portal/getImageAttachment?filename=img15.png&amp;amp;userId=11733&#xD;
  [20]: /c/portal/getImageAttachment?filename=img16.png&amp;amp;userId=11733&#xD;
  [21]: /c/portal/getImageAttachment?filename=img17.png&amp;amp;userId=11733&#xD;
  [22]: /c/portal/getImageAttachment?filename=img18.png&amp;amp;userId=11733&#xD;
  [23]: /c/portal/getImageAttachment?filename=img19.png&amp;amp;userId=11733&#xD;
  [24]: /c/portal/getImageAttachment?filename=img20.png&amp;amp;userId=11733&#xD;
  [25]: /c/portal/getImageAttachment?filename=img21.png&amp;amp;userId=11733&#xD;
  [26]: /c/portal/getImageAttachment?filename=img22.png&amp;amp;userId=11733&#xD;
  [27]: /c/portal/getImageAttachment?filename=img23.png&amp;amp;userId=11733&#xD;
  [28]: /c/portal/getImageAttachment?filename=img24.png&amp;amp;userId=11733&#xD;
  [29]: /c/portal/getImageAttachment?filename=img25.png&amp;amp;userId=11733&#xD;
  [30]: /c/portal/getImageAttachment?filename=img26.png&amp;amp;userId=11733</description>
    <dc:creator>Xueqin Cai</dc:creator>
    <dc:date>2014-12-30T21:13:19Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/246929">
    <title>One pixel thermal imaging camera with Mathematica and Arduino</title>
    <link>https://community.wolfram.com/groups/-/m/t/246929</link>
    <description>Triggered by a leak in my hot water boiler at home I built a thermal imaging camera using an Arduino and interfacing it with Mathematica. I tried to make up for the &amp;#034;one-pixel-resolution&amp;#034; by using Mathematica&amp;#039;s powerful image analysis abilities. This is a work in progress and I would be delighted to get some comments/suggestions from the Community. In this project, I had a lot of help from [url=http://community.wolfram.com/web/bschelter/home]Bjoern Schelter[/url], who has recently joined this Community. If you have the components and use the programs below, you should have a &amp;#034;working&amp;#034; one-pixel thermal camera after 30 minutes or so of DIY. Here&amp;#039;s a sneak peek of what we want to get out (this one is a &amp;#034;selfie&amp;#034;):&#xD;
&#xD;
[img=width: 426px; height: 270px;]/c/portal/getImageAttachment?filename=asdwefasdcsdvvafe2345QT.PNG&amp;amp;userId=11733[/img]&#xD;
&#xD;
I use the following components:[list=1]&#xD;
[*]Arduino Uno R3&#xD;
[*][url=http://www.amazon.co.uk/XINTE-MLX90614ESF-DCI-non-contact-Infrared-Temperature/dp/B00IMU0LXG/ref=sr_1_2?ie=UTF8&amp;amp;qid=1399153918&amp;amp;sr=8-2&amp;amp;keywords=Melexis]MELEXIS / MLX90614ESF-DCI / DS Digital non-contact Infrared Temperature Sensor[/url]  (~ £35 and more or less the same in USD)&#xD;
[*][url=http://www.amazon.co.uk/MG995-Servo-Sensor-Mount-Black/dp/B00EZIYCUW/ref=sr_1_3?ie=UTF8&amp;amp;qid=1399153991&amp;amp;sr=8-3&amp;amp;keywords=Pan+tilt]MG995 Servo Sensor Mount Kit 2 DOF Pan and Tilt Black[/url] (~ £24, similar in USD)&#xD;
[*]Two 4.7 kOhm resistors.&#xD;
[*]One 0.1 uF capacitor.&#xD;
[*]One small breadboard.&#xD;
[*]5V power source.&#xD;
[*]Wires. &#xD;
[/list]The idea is illustrated in this [url=http://www.youtube.com/watch?v=rcTKVOzxCmw]Youtube video[/url]. To my best knowledge, the original idea comes from a [url=http://www.theimagingsource.com/en_US/blog/posts/20090622/]project of Steffen Strobel in the German science competition &amp;#034;Jugend Forscht&amp;#034;[/url]. The main idea is to mount a non-contact temperature sensor on a pan and tilt mechanism (i.e. two servos) on a tripod. An Arduino microcontroller is then used to communicate via the serial port with Mathematica, which is used to control the servos and triggers the measurements. After the data acquisition Mathematica cleans the data and produces some thermal images (see below).&#xD;
&#xD;
We use the following wiring diagram to connect the servos and the temperature sensor to the Arduino.&#xD;
[center][img=width: 300px; height: 203px;]/c/portal/getImageAttachment?filename=ThermoCam.jpg&amp;amp;userId=48754[/img][/center]&#xD;
The resistors are 4.7kOhm and the capacitor is 0.1uF. The sensor part is taken from the [url=http://bildr.org/2011/02/mlx90614-arduino/]bildr.blog[/url], which also shows how to make Arduino talk to the sensor. The Melexis sensor that we chose has a temperature resolution of 0.02 degrees Celsius and a rather narrow field of view, which is important for our application. &#xD;
&#xD;
For the servo part, we use the standard servo.h library; an example of its application can be found [url=http://arduino.cc/en/Tutorial/sweep]here[/url].&#xD;
&#xD;
Here is a photo of the sensor/head of the device.&#xD;
[center][img=width: 320px; height: 240px;]/c/portal/getImageAttachment?filename=photo.JPG&amp;amp;userId=48754[/img][/center]&#xD;
The entire device looks like this.&#xD;
[center][img=width: 240px; height: 320px;]/c/portal/getImageAttachment?filename=7033photo4.JPG&amp;amp;userId=48754[/img][/center]&#xD;
The idea is to use Mathematica to send instructions to the servos and to initiate the measurements. To interface Mathematica with Arduino we use the [url=http://library.wolfram.com/infocenter/Demos/5726/]SerialIO package[/url]. I found [url=http://williamjturkel.net/2011/12/25/connecting-arduino-to-mathematica-on-mac-os-x-with-serialio/]this website by William Turkel[/url] very useful to make SerialIO work on my Mac; following the steps and adapting some directories makes the package work without any problems.&#xD;
&#xD;
At that point, we have everything in place, and only need to put the bits together. We first need to upload this piece of code (also attached at the bottom) to the Arduino.&#xD;
[code]#include &amp;lt;i2cmaster.h&amp;gt;&#xD;
#include &amp;lt;Servo.h&amp;gt; &#xD;
&#xD;
//Servo setup&#xD;
int servoPin1 = 9;&#xD;
int servoPin2 = 10; &#xD;
Servo servo1;  &#xD;
Servo servo2;&#xD;
int angle1 = 40;   // servo start positions in degrees &#xD;
int angle2 = 50;&#xD;
&#xD;
&#xD;
//Melexis setup&#xD;
int sensor = 0;&#xD;
int inByte = 0;&#xD;
&#xD;
&#xD;
void setup()&#xD;
{&#xD;
	Serial.begin(9600);&#xD;
	&#xD;
       // attach pan-tilt servos&#xD;
       servo1.attach(servoPin1);&#xD;
       servo2.attach(servoPin2); &#xD;
&#xD;
&#xD;
       servo1.write(angle1);&#xD;
       servo2.write(angle2);&#xD;
&#xD;
&#xD;
	//Initialise the i2c bus&#xD;
	i2c_init(); &#xD;
	PORTC = (1 &amp;lt;&amp;lt; PORTC4) | (1 &amp;lt;&amp;lt; PORTC5);//enable pullups&#xD;
       establishContact();&#xD;
}&#xD;
&#xD;
&#xD;
void loop()&#xD;
{&#xD;
 if (Serial.available() &amp;gt; 0) &#xD;
  {&#xD;
   inByte = Serial.read();&#xD;
   &#xD;
   int dev = 0x5A&amp;lt;&amp;lt;1;&#xD;
   int data_low = 0;&#xD;
   int data_high = 0;&#xD;
   int pec = 0;&#xD;
&#xD;
&#xD;
   i2c_start_wait(dev+I2C_WRITE);&#xD;
   i2c_write(0x07);&#xD;
&#xD;
&#xD;
   // read&#xD;
   i2c_rep_start(dev+I2C_READ);&#xD;
   data_low = i2c_readAck(); //Read 1 byte and then send ack&#xD;
   data_high = i2c_readAck(); //Read 1 byte and then send ack&#xD;
   pec = i2c_readNak();&#xD;
   i2c_stop();&#xD;
&#xD;
&#xD;
   //This converts high and low bytes together and processes temperature, MSB is a error bit and is ignored for temps&#xD;
   double tempFactor = 0.02; // 0.02 degrees per LSB (measurement resolution of the MLX90614)&#xD;
   double tempData = 0x0000; // zero out the data&#xD;
   int frac; // data past the decimal point&#xD;
&#xD;
&#xD;
 // Serial.print(tempData);&#xD;
 // Serial.write(inByte);&#xD;
   // This masks off the error bit of the high byte, then moves it left 8 bits and adds the low byte.&#xD;
   tempData = (double)(((data_high &amp;amp; 0x007F) &amp;lt;&amp;lt; 8) + data_low);&#xD;
   tempData = (tempData * tempFactor)-0.01;&#xD;
&#xD;
&#xD;
   //inByte = (float)(((data_high &amp;amp; 0x007F) &amp;lt;&amp;lt; 8) + data_low);&#xD;
&#xD;
&#xD;
  float celsius = tempData - 273.15;&#xD;
   sensor=(int)(celsius*100);&#xD;
   //float fahrenheit = (celsius*1.8) + 32;&#xD;
&#xD;
  Serial.print(sensor);&#xD;
  &#xD;
   &#xD;
   // horizontal &amp;#034;H&amp;#034;-&amp;gt; 72; reverse &amp;#034;R&amp;#034;-&amp;gt; 82; vertical &amp;#034;V&amp;#034;-&amp;gt; 86; end &amp;#034;E&amp;#034;-&amp;gt; 69&#xD;
   &#xD;
  if(inByte==72)&#xD;
  {&#xD;
   angle1=angle1+1;&#xD;
   servo1.write(angle1);&#xD;
  }&#xD;
   if(inByte==82)&#xD;
  {&#xD;
   angle1=40;&#xD;
   servo1.write(angle1);&#xD;
  }&#xD;
  if(inByte==86)&#xD;
  {&#xD;
   angle2=angle2+1;&#xD;
   servo2.write(angle2);&#xD;
  }&#xD;
    if(inByte==69)&#xD;
  {&#xD;
   angle1 = 40;   // servo back to start&#xD;
   angle2 = 50;&#xD;
   servo1.write(angle1);&#xD;
   servo2.write(angle2);&#xD;
  }&#xD;
  &#xD;
   delay(15); // 15 works; wait 15 milliseconds before printing again&#xD;
 }&#xD;
&#xD;
&#xD;
}&#xD;
&#xD;
&#xD;
&#xD;
void establishContact() &#xD;
{&#xD;
 while (Serial.available() &amp;lt;= 0) &#xD;
 {&#xD;
   Serial.print(&amp;#039;A&amp;#039;);&#xD;
   delay(100);&#xD;
 }&#xD;
}&#xD;
[/code]&#xD;
The idea is to make Mathematica communicate with the Arduino via the serial connection. The Arduino sketch shows that Ardunio is waiting for instructions, e.g. &amp;#034;H&amp;#034; to move horizontally, &amp;#034;V&amp;#034; to move vertically and &amp;#034;E&amp;#034; to go to the end position. &#xD;
[mcode](*First we load the SerialIO package. See instructions above.*)&#xD;
&#xD;
&amp;lt;&amp;lt; SerialIO`&#xD;
&#xD;
(*We test whether Mathematica&amp;#039;s applications folder is in the Path. On some Macs Mathematica will be in the /Library directory - used in this example- and in others in the /Users/username/Library directory, where &amp;#034;username&amp;#034; needs to be replaced by the correct user name.*)&#xD;
&#xD;
MemberQ[$Path, &amp;#034;/Library/Mathematica/Applications&amp;#034;]&#xD;
&#xD;
(*If this gives True all is fine. If it evaluates to False execute&#xD;
AppendTo[$Path, &amp;#034;/Library/Mathematica/Applications&amp;#034;]&#xD;
*)&#xD;
&#xD;
(*Connect to the Arduino*)&#xD;
&#xD;
myArduino = &#xD;
  SerialOpen[Quiet[FileNames[&amp;#034;tty.usb*&amp;#034;, {&amp;#034;/dev&amp;#034;}, Infinity]][[1]]];&#xD;
SerialSetOptions[myArduino, &amp;#034;BaudRate&amp;#034; -&amp;gt; 9600];&#xD;
While[SerialReadyQ[myArduino] == False, Pause[0.1]];&#xD;
&#xD;
(*Data collection, in this case 40 vertical and 70 horizontal pixels; runtime 2-3 minutes; pauses cannot be reduced much further.*)&#xD;
&#xD;
pixels = {}; SerialRead[myArduino]; For[j = 1, j &amp;lt; 41, j++, &#xD;
 For[i = 1, i &amp;lt; 71, i++, SerialWrite[myArduino, &amp;#034;H&amp;#034;]; &#xD;
  AppendTo[pixels, (SerialRead[myArduino] // ToExpression)/100.]; &#xD;
  Pause[0.1]]; SerialWrite[myArduino, &amp;#034;R&amp;#034;]; &#xD;
 SerialWrite[myArduino, &amp;#034;V&amp;#034;]; SerialRead[myArduino]; &#xD;
 Pause[0.1];]; SerialWrite[myArduino, &amp;#034;E&amp;#034;];&#xD;
&#xD;
(*After the data aquisition close the connection to Arduino*)&#xD;
SerialClose[myArduino]&#xD;
&#xD;
(*Now we can use several different ways to represent the data, note that some point at the beginning/end of the scanned lines are removed; there were too many measurements errors just after the &amp;#034;carriage return&amp;#034;*)&#xD;
&#xD;
ArrayPlot[Partition[Reverse[pixels], 70][[All, 2 ;; -10]], &#xD;
 ColorFunction -&amp;gt; &amp;#034;Rainbow&amp;#034;]&#xD;
&#xD;
(*here&amp;#039;s another colour scheme.*)&#xD;
ArrayPlot[Partition[Reverse[pixels], 70][[All, 2 ;; -10]], &#xD;
&#xD;
(*Occasionally there are some outliers in the measurements; here we clean them out.*)&#xD;
ArrayPlot[&#xD;
 Partition[Reverse[pixels /. x_ /; x &amp;gt; 35. -&amp;gt; 35.], 70][[All, &#xD;
   2 ;; -10]], ColorFunction -&amp;gt; &amp;#034;Temperature&amp;#034;]&#xD;
 ColorFunction -&amp;gt; &amp;#034;Temperature&amp;#034;]&#xD;
&#xD;
(*This last one uses interpolation to make the image smoother.*)&#xD;
&#xD;
ListContourPlot[&#xD;
 Partition[Reverse[Log /@ pixels /. x_ /; x &amp;gt; 35. -&amp;gt; 35.], &#xD;
   70][[-1 ;; 1 ;; -1, 1 ;; -10]], AspectRatio -&amp;gt; 0.9, &#xD;
 ColorFunction -&amp;gt; &amp;#034;Rainbow&amp;#034;, PlotRange -&amp;gt; All, &#xD;
 InterpolationOrder -&amp;gt; 2, Contours -&amp;gt; 60, ContourStyle -&amp;gt; None][/mcode][center][/center]So here&amp;#039;s a photo of my broken boiler and its scan:&#xD;
[center][img=width: 518px; height: 257px;]/c/portal/getImageAttachment?filename=BoilerScan.jpg&amp;amp;userId=48754[/img][/center]&#xD;
Because of the scanning procedure (which just looks at the angle and does not use any projection), the scan is slightly distorted, but it is possible to recognize the main features and even the sticker on the front!&#xD;
&#xD;
It appears that this rather primitive device can also be used to analyse electrical components. Here is an image of my MacBook Pro. [center][img=width: 450px; height: 306px;]/c/portal/getImageAttachment?filename=Laptop1.jpg&amp;amp;userId=48754[/img][/center]&#xD;
 The position of the CPU becomes quite obvious.&#xD;
&#xD;
There are many things that need to be improved: &#xD;
&#xD;
(i) First, there is the projection issue. The scanner does scan angles. It needs to be projected to a 2D plane. One might use an ultrasonic distance sensor to get better results.&#xD;
(ii) The device needs to be calibrated.&#xD;
(iii) A user interface is needed. It would be useful to click on the image and get the temperature reading.&#xD;
(iv) The communication between Mathematica and the Arduino need to be improved. The starting position of 40/50 degrees is hard-coded into the Arduino sketch. It should be done by the Mathematica code.&#xD;
(v) We have not even started to use Mathematica&amp;#039;s features on this. Much image processing could be done. The image should be overlayed to a normal photo of the object that is scanned. Manipulate could be used to change thresholds, i.e. the threshold to cut-off outliers, which is currently set to 35 degrees. &#xD;
(vi) The speed might be improved. I suppose that the scanning time of 3 minutes or so is typical for these devices, but one might improve that a bit. Also, Mathematica could use edge-detection to determine regions where a higher scan density would be helpful to get a better resolution. This only makes sense if the servos could be directed to a certain position much more precisely; alternatively, we could use random positions, which then are precisely determined using an accelerometer or so.&#xD;
&#xD;
There is of course much more to do. In spite of this being work in progress, I wanted to share this project, and hope for helpful comments.&#xD;
&#xD;
I attach the Mathematica notebook. I have a movie of the scanning process and the actual arduino sketch which I cannot upload directly. Here are links to the [url=https://www.dropbox.com/s/sm2prb5w0wrqexp/ThermoCamera_Forum.zip]arduino sketch[/url] and the [url=https://www.dropbox.com/s/wpgpww8a7jhjfn0/Scan.MOV]scanning movie[/url].&#xD;
&#xD;
M.</description>
    <dc:creator>Marco Thiel</dc:creator>
    <dc:date>2014-05-04T00:48:33Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/344278">
    <title>Using your smart phone as the ultimate sensor array for Mathematica</title>
    <link>https://community.wolfram.com/groups/-/m/t/344278</link>
    <description>Many fantastic posts in this community describe how to connect external devices to Mathematica and how to read the data. Connecting Mathematica to an Arduino for example allows you to read and then work with data from all kinds of sensors. In most of the cases, when we speak about connected devices, additional hardware is necessary. Smart phones, on the other hand, are our permanent companions and they host a wide array of sensors that we can tap into with Mathematica. For this post, I will be using an iPhone 5 - but a similar approach can be taken with many other smart phones. [Björn Schelter][1] and myself have worked on this together.&#xD;
&#xD;
The first thing we need in order to be able to read the iPhone is a little App which can be purchased on the iTunes App store: it is called [Sensor Data][2]. When you open the app you see a screen like this one. &#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
At the top of the screen you see an IP address and a port number (after the colon!). These numbers will be important to connect to the phone and either download data or stream sensor data directly. If you click on the &amp;#034;start capture&amp;#034; the iPhone&amp;#039;s data will be stored on the phone and can be downloaded into Mathematica. In this post we are rather interested in the &amp;#034;Streaming&amp;#034; function. If you click on the respective button on the bottom you get to a screen like this:&#xD;
&#xD;
![enter image description here][4]&#xD;
&#xD;
There you can choose a frequency for the measurements and start the streaming. In fact we also can choose which sensors we want to use with the Config button. &#xD;
&#xD;
![enter image description here][5]&#xD;
&#xD;
The following Mathematica code will work when all (!) sensors are switched on. Now we are ready to connect to the iPhone. Switch the streaming on and execute the following commands:&#xD;
&#xD;
    ClearAll[&amp;#034;Global`*&amp;#034;];&#xD;
    For[i = 1, i &amp;lt; 3, i++, Quiet[InstallJava[]]];&#xD;
    Needs[&amp;#034;JLink`&amp;#034;]&#xD;
&#xD;
and then &#xD;
&#xD;
    LoadJavaClass[&amp;#034;java.util.Arrays&amp;#034;];&#xD;
    packet = JavaNew[&amp;#034;java.net.DatagramPacket&amp;#034;, JavaNew[&amp;#034;[B&amp;#034;, 1024], 1024];&#xD;
    socket = JavaNew[&amp;#034;java.net.DatagramSocket&amp;#034;, 10552];&#xD;
    socket@setSoTimeout[10];&#xD;
    listen[] := If[$Failed =!= Quiet[socket@receive[packet], Java::excptn], &#xD;
    record =JavaNew[&amp;#034;java.lang.String&amp;#034;, java`util`Arrays`copyOfRange @@ &#xD;
    packet /@ {getData[], getOffset[], getLength[]}]@toString[] //&#xD;
    Sow];&#xD;
&#xD;
Next we have to define a ScheduledTask to read the sensors:&#xD;
&#xD;
    RemoveScheduledTask[ScheduledTasks[]];&#xD;
    results = {}; &#xD;
    RunScheduledTask[AppendTo[results, Quiet[Reap[listen[]][[2, 1]]]]; If[Length[results] &amp;gt; 1200, Drop[results, 150]], 0.01];&#xD;
&#xD;
We also need to define a streaming function:&#xD;
&#xD;
    stream := Refresh[ToExpression[StringSplit[#[[1]], &amp;#034;,&amp;#034;]] &amp;amp; /@ Select[results[[-1000 ;;]], Head[#] == List &amp;amp;], UpdateInterval -&amp;gt; 0.01]&#xD;
&#xD;
Alright. Now comes the interesting part. Using &#xD;
&#xD;
    (*Compass*)&#xD;
    While[Length[results] &amp;lt; 1000, Pause[2]]; Dynamic[AngularGauge[Refresh[stream[[-1, 30]], UpdateInterval -&amp;gt; 0.01], {360, 0}, &#xD;
    ScaleDivisions -&amp;gt; None, GaugeLabels -&amp;gt; {Placed[&amp;#034;N&amp;#034;, Top], Placed[&amp;#034;S&amp;#034;, Bottom], Placed[&amp;#034;E&amp;#034;, Right], Placed[&amp;#034;W&amp;#034;, Left]}, ScaleOrigin -&amp;gt; {{5 Pi/2, Pi/2}, 1}, ScalePadding -&amp;gt; All, ImageSize -&amp;gt; Medium], SynchronousUpdating -&amp;gt; False]&#xD;
&#xD;
we can measure the bearing of our iPhone. The resulting compass moves as we move the iPhone:&#xD;
&#xD;
![enter image description here][6]&#xD;
&#xD;
We can also read the (x-,y-,z-) accelerometers&#xD;
&#xD;
    (*Plot Ascelerometers*)&#xD;
    While[Length[results] &amp;lt; 1000, Pause[2]]; Dynamic[Refresh[ListLinePlot[{stream[[All, 2]], stream[[All, 3]], stream[[All, 4]]}, PlotRange -&amp;gt; All], UpdateInterval -&amp;gt; 0.1]]&#xD;
&#xD;
which gives plots like this one:&#xD;
&#xD;
![enter image description here][7]&#xD;
&#xD;
The update is a bit bumpy, because the data is only sent every second or so from the iPhone; the measurements, however, are taken with a frequency of up to 100Hz. We can also represent the FFT of the streamed data like so:&#xD;
&#xD;
    (*Plot FFT of accelorometers*)&#xD;
    While[Length[results] &amp;lt; 1000, &#xD;
     Pause[2]]; Dynamic[&#xD;
     Refresh[ListLinePlot[&#xD;
       Log /@ {Abs[Fourier[Standardize[stream[[All, 2]]]]], &#xD;
         Abs[Fourier[Standardize[stream[[All, 3]]]]], &#xD;
         Abs[Fourier[Standardize[stream[[All, 4]]]]]}, &#xD;
       PlotRange -&amp;gt; {{0, 200}, {-5, 2.5}}, ImageSize -&amp;gt; Large], &#xD;
      UpdateInterval -&amp;gt; 0.1]]&#xD;
&#xD;
Adding a &amp;#034;real time&amp;#034; scale is also quite straight forward:&#xD;
&#xD;
(*Measurements with time scale*)&#xD;
&#xD;
    While[Length[results] &amp;lt; 1000, Pause[2]];&#xD;
    starttime = IntegerPart[stream[[2, 1]]];&#xD;
    Dynamic[Refresh[&#xD;
      ListLinePlot[&#xD;
       Transpose[{(stream[[Max[-300, -Length[stream]] ;;, 1]] - &#xD;
           starttime), stream[[Max[-300, -Length[stream]] ;;, 2]]}], &#xD;
       PlotRange -&amp;gt; All, ImageSize -&amp;gt; Large], UpdateInterval -&amp;gt; 0.01]]&#xD;
&#xD;
Well, then. We can also plot our iPhone&amp;#039;s position in space&#xD;
&#xD;
    (*3d Motion*)&#xD;
    &#xD;
    While[Length[results] &amp;lt; 1000, Pause[2]]; Dynamic[&#xD;
     Refresh[ListLinePlot[{stream[[All, 5]], stream[[All, 6]], &#xD;
        stream[[All, 7]]}, PlotRange -&amp;gt; All], UpdateInterval -&amp;gt; 0.1]]&#xD;
    &#xD;
    While[Length[results] &amp;lt; 1000, Pause[2]]; Dynamic[&#xD;
     Graphics3D[{Black, &#xD;
       Rotate[Rotate[&#xD;
         Rotate[Cuboid[{-2, -1, -0.2}, {2, 1, 0.2}], &#xD;
          stream[[-1, 7]], {0, 0, 1}], -1*stream[[-1, 6]], {0, 1, 0}], &#xD;
        stream[[-1, 5]], {1, 0, 0}]}, &#xD;
      PlotRange -&amp;gt; {{-3, 3}, {-3, 3}, {-3, 3}}, Boxed -&amp;gt; True], &#xD;
     UpdateInterval -&amp;gt; 0.1, SynchronousUpdating -&amp;gt; False]&#xD;
&#xD;
This looks like so:&#xD;
&#xD;
![enter image description here][8]&#xD;
&#xD;
Last but not least we can write a little GUI to access all different sensors. (This does run a bit slow though!)&#xD;
&#xD;
(*GUI all sensors*)&#xD;
&#xD;
    sensororder = {&amp;#034;Timestamp&amp;#034;, &amp;#034;Accel_X&amp;#034;, &amp;#034;Accel_Y&amp;#034;, &amp;#034;Accel_Z&amp;#034;, &amp;#034;Roll&amp;#034;, &#xD;
       &amp;#034;Pitch&amp;#034;, &amp;#034;Yaw&amp;#034;, &amp;#034;Quat.X&amp;#034;, &amp;#034;Quat.Y&amp;#034;, &amp;#034;Quat.Z&amp;#034;, &amp;#034;Quat.W&amp;#034;, &amp;#034;RM11&amp;#034;, &#xD;
       &amp;#034;RM12&amp;#034;, &amp;#034;RM13&amp;#034;, &amp;#034;RM21&amp;#034;, &amp;#034;RM22&amp;#034;, &amp;#034;RM23&amp;#034;, &amp;#034;RM31&amp;#034;, &amp;#034;RM32&amp;#034;, &amp;#034;RM33&amp;#034;, &#xD;
       &amp;#034;GravAcc_X&amp;#034;, &amp;#034;GravAcc_Y&amp;#034;, &amp;#034;GravAcc_Z&amp;#034;, &amp;#034;UserAcc_X&amp;#034;, &amp;#034;UserAcc_Y&amp;#034;, &#xD;
       &amp;#034;UserAcc_Z&amp;#034;, &amp;#034;RotRate_X&amp;#034;, &amp;#034;RotRate_Y&amp;#034;, &amp;#034;RotRate_Z&amp;#034;, &amp;#034;MagHeading&amp;#034;, &#xD;
       &amp;#034;TrueHeading&amp;#034;, &amp;#034;HeadingAccuracy&amp;#034;, &amp;#034;MagX&amp;#034;, &amp;#034;MagY&amp;#034;, &amp;#034;MagZ&amp;#034;, &amp;#034;Lat&amp;#034;, &#xD;
       &amp;#034;Long&amp;#034;, &amp;#034;LocAccuracy&amp;#034;, &amp;#034;Course&amp;#034;, &amp;#034;Speed&amp;#034;, &amp;#034;Altitude&amp;#034;, &#xD;
       &amp;#034;Proximity&amp;#034;};&#xD;
    While[Length[results] &amp;lt; 1000, Pause[2]]; Manipulate[&#xD;
     Dynamic[Refresh[&#xD;
       ListLinePlot[{stream[[All, Position[sensororder, a][[1, 1]]]], &#xD;
         stream[[All, Position[sensororder, b][[1, 1]]]], &#xD;
         stream[[All, Position[sensororder, c][[1, 1]]]]}, &#xD;
        PlotRange -&amp;gt; All, ImageSize -&amp;gt; Full], &#xD;
       UpdateInterval -&amp;gt; 0.01]], {{a, &amp;#034;Accel_X&amp;#034;}, &#xD;
      sensororder}, {{b, &amp;#034;Accel_Y&amp;#034;}, sensororder}, {{c, &amp;#034;Accel_Z&amp;#034;}, &#xD;
      sensororder}, ControlPlacement -&amp;gt; Left, &#xD;
     SynchronousUpdating -&amp;gt; False]&#xD;
&#xD;
This gives a user interface which looks like this:&#xD;
&#xD;
![enter image description here][9]&#xD;
&#xD;
In the drop down menu we can choose three out of all sensors. These are all available sensors:&#xD;
&#xD;
&amp;gt; &amp;#034;Timestamp&amp;#034;, &amp;#034;Accel_X&amp;#034;, &amp;#034;Accel_Y&amp;#034;, &amp;#034;Accel_Z&amp;#034;, &amp;#034;Roll&amp;#034;, &amp;#034;Pitch&amp;#034;, &amp;#034;Yaw&amp;#034;,&#xD;
&amp;gt; &amp;#034;Quat.X&amp;#034;, &amp;#034;Quat.Y&amp;#034;, &amp;#034;Quat.Z&amp;#034;, &amp;#034;Quat.W&amp;#034;, &amp;#034;RM11&amp;#034;,  &amp;#034;RM12&amp;#034;, &amp;#034;RM13&amp;#034;,&#xD;
&amp;gt; &amp;#034;RM21&amp;#034;, &amp;#034;RM22&amp;#034;, &amp;#034;RM23&amp;#034;, &amp;#034;RM31&amp;#034;, &amp;#034;RM32&amp;#034;, &amp;#034;RM33&amp;#034;, &amp;#034;GravAcc_X&amp;#034;,&#xD;
&amp;gt; &amp;#034;GravAcc_Y&amp;#034;, &amp;#034;GravAcc_Z&amp;#034;, &amp;#034;UserAcc_X&amp;#034;, &amp;#034;UserAcc_Y&amp;#034;,   &amp;#034;UserAcc_Z&amp;#034;,&#xD;
&amp;gt; &amp;#034;RotRate_X&amp;#034;, &amp;#034;RotRate_Y&amp;#034;, &amp;#034;RotRate_Z&amp;#034;, &amp;#034;MagHeading&amp;#034;, &amp;#034;TrueHeading&amp;#034;,&#xD;
&amp;gt; &amp;#034;HeadingAccuracy&amp;#034;, &amp;#034;MagX&amp;#034;, &amp;#034;MagY&amp;#034;, &amp;#034;MagZ&amp;#034;, &amp;#034;Lat&amp;#034;,   &amp;#034;Long&amp;#034;,&#xD;
&amp;gt; &amp;#034;LocAccuracy&amp;#034;, &amp;#034;Course&amp;#034;, &amp;#034;Speed&amp;#034;, &amp;#034;Altitude&amp;#034;, &amp;#034;Proximity&amp;#034;&#xD;
&#xD;
There are certainly any things that can and should be improved. The main problem seems to be that the data, even if sampled at 100Hz, is sent to the iPhone only every second or so. So it is not really real time. I hope that someone who is better at iPhone programming than I am - I am really rubbish at it- could help and write an iPhone program to stream the data in a more convenient way: one by one rather than in packets. &#xD;
&#xD;
There are many potential applications for this. Here are some I could come up with:&#xD;
&#xD;
 1. You can carry the iPhone around and measure your movements (acceleration). Attached to your hand you can measure your tremor. &#xD;
 2. The magnetometer is really cool. You can use it to find metal bars in the walls an also electric cables. &#xD;
 3. You can collect GPS data for all sorts of applications; there are ideas to use this for the detection of certain diseases. For example if it takes you longer than usual to find your car when you come from shopping that might hint at early stages of dementia --- or sleep deprivation.&#xD;
 4. When you put the phone on a machine, like a running motor, you can measure the vibrations. When you perform a frequency analysis you can check whether the motor runs alright.&#xD;
 5. Using the accelerometers I was able to measure my breathing (putting the phone on my chest).&#xD;
 &#xD;
I think that there might also be quite some potential for using the Wolfram Cloud here. Deploying a program in the cloud and reading from your phone is certainly quite interesting. The problem is that this particular app only works via WiFi. It would be nice to have one that works via 3G. &#xD;
&#xD;
So, in summary, it might be quite useful to use the iPhone&amp;#039;s sensors. The advantage is that nearly everyone carries a smartphone with them all the time. Making more of your smart phone&amp;#039;s sensors with Mathematica seems to be a nice playground for applications. I&amp;#039;d love to hear about your ideas...&#xD;
&#xD;
Cheers,&#xD;
&#xD;
Marco&#xD;
&#xD;
PS: When you are done with the streaming you should execute these commands:&#xD;
&#xD;
    (*Remove Scheduled Tasks and close link*)&#xD;
    RemoveScheduledTask[ScheduledTasks[]]; socket@close[];&#xD;
&#xD;
&#xD;
  [1]: http://community.wolfram.com/web/bschelter&#xD;
  [2]: https://itunes.apple.com/gb/app/sensor-data/id397619802?mt=8&#xD;
  [3]: /c/portal/getImageAttachment?filename=sensorwelcome.PNG&amp;amp;userId=48754&#xD;
  [4]: /c/portal/getImageAttachment?filename=sensorstreaming.PNG&amp;amp;userId=48754&#xD;
  [5]: /c/portal/getImageAttachment?filename=Allsensors.PNG&amp;amp;userId=48754&#xD;
  [6]: /c/portal/getImageAttachment?filename=Compass.gif&amp;amp;userId=48754&#xD;
  [7]: /c/portal/getImageAttachment?filename=Accelerometer.gif&amp;amp;userId=48754&#xD;
  [8]: /c/portal/getImageAttachment?filename=Iphonemovement.gif&amp;amp;userId=48754&#xD;
  [9]: /c/portal/getImageAttachment?filename=ScreenShot2014-09-15at23.52.46.png&amp;amp;userId=48754</description>
    <dc:creator>Marco Thiel</dc:creator>
    <dc:date>2014-09-15T23:53:14Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/157486">
    <title>Checking the weather with the Wolfram Language + Raspberry Pi</title>
    <link>https://community.wolfram.com/groups/-/m/t/157486</link>
    <description>This post shows how to use a weather station module with the Wolfram Language on a Raspberry Pi. 
To recreate this experiment you will need the following hardware (in addition to the Raspberry Pi itself):
[list]
[*][url=http://www.web4robot.com/PiWeather.html]Raspberry Pi Weather Station Board[/url]
[/list]

[img=width: 512px; height: 384px;]/c/portal/getImageAttachment?filename=3-weather_community.jpg&amp;amp;userId=11733[/img]

First configure your Raspberry Pi for I2C interface support as described in the [url=http://www.web4robot.com/files/PiWeatherCodeExamples.zip]ReadMe.pdf[/url] from the manufacturer.
Next turn off your Raspberry Pi and connect the Weather Station board to the 26 pin interface. Turn your Pi back on and check that the device is detected:
[code]
&amp;gt; sudo i2cdetect -y 1
     0  1  2  3  4  5  6  7  8  9  a  b  c  d  e  f
00:          -- -- -- -- -- -- -- -- -- -- -- -- --
10: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
20: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
30: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
40: -- -- -- -- -- -- -- -- -- -- -- -- -- -- 4e --
50: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
60: -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- --
70: -- -- -- -- -- -- -- --
[/code]

The Weather Station requires root privilege for access so the Wolfram Language or Mathematica needs to be started as root for this experiment.
In a terminal start the Wolfram Language using the following command (as root):
[code]&amp;gt; sudo wolfram
Wolfram Language (Raspberry Pi Pilot Release)
Copyright 1988-2013 Wolfram Research
Information &amp;amp; help: wolfram.com/raspi
In[1]:= 
[/code]
First we open the device:
[mcode]In[1]:= obj = DeviceOpen[&amp;#034;RaspberryPiWeatherStation&amp;#034;]
Out[1]= DeviceObject[{RaspberryPiWeatherStation, 1}]
[/mcode]
Next we can read the current temperature as measured by the board:
[mcode]In[2]:= DeviceRead[obj, &amp;#034;Temperature&amp;#034;]
Out[2]= 25 degrees Celsius
[/mcode]
Or the relative humidity:
[mcode]In[3]:= DeviceRead[obj, &amp;#034;Humidity&amp;#034;]
Out[3]= 30 percent
[/mcode]
And also the barometric pressure:
[mcode]In[4]:= DeviceRead[obj, &amp;#034;Pressure&amp;#034;]
Out[4]= 993 hectopascals
[/mcode]</description>
    <dc:creator>Arnoud Buzing</dc:creator>
    <dc:date>2013-11-21T17:15:55Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/284759">
    <title>Mathematica vs. Wolfram Desktop</title>
    <link>https://community.wolfram.com/groups/-/m/t/284759</link>
    <description>**What&amp;#039;s the Difference Between Mathematica and Wolfram Desktop?**

Recently, several members of the community have asked us about the similarities and differences between Wolfram Desktop and the desktop version of Mathematica. Mathematica is a stand-alone product. Wolfram Desktop is actually a platform or interface to Wolfram Cloud products, such as Wolfram Programming Cloud.

**Mathematica is a Product**

 - Mathematica can be licensed annually, or purchased outright.
 - Mathematica requires an activation key.

**Wolfram Desktop is a Platform**

 - Wolfram Desktop cannot be purchased directly, because it is a feature of the Wolfram Programming Cloud.
 - Wolfram Desktop requires a premium Wolfram Programming Cloud subscription.
 - Right now, Wolfram Desktop only works with cloud files and always requires a login and an internet connection.

When deciding which Wolfram product is best for you, youll want to make a product-to-product comparison, not a product-to-feature comparison. That means, for example, weighing the pros and cons of owning the desktop version of Mathematica versus subscribing to a product like Wolfram Programming Cloud.

Right now Wolfram Desktop is only available with Wolfram Programming Cloud. However, as additional Wolfram Cloud products are released, Wolfram Desktop will evolve. In the future, look for it as an option with Wolfram Discovery Platform, Wolfram Data Science Platform, and more.

If you have other questions, ask away! Or, if you&amp;#039;d prefer to talk to someone one-on-one, you can contact sales through [this form][1]. More information is available on the Wolfram Desktop option at [this page][2].

Clayton Voyles - Wolfram Research Inc - Lead Business Analyst


  [1]: http://www.wolfram.com/programming-cloud/contact-sales/
  [2]: http://www.wolfram.com/desktop/</description>
    <dc:creator>Clayton Voyles</dc:creator>
    <dc:date>2014-06-30T21:48:23Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/235291">
    <title>Random Snowflake Generator Based on Cellular Automaton</title>
    <link>https://community.wolfram.com/groups/-/m/t/235291</link>
    <description>[img]/c/portal/getImageAttachment?filename=fig0.gif&amp;amp;userId=93201[/img]&#xD;
&#xD;
Some time ago one of my friends asked me whether it is possible to design a cellular automaton which can generate realistic snowflakes. I recall my crystallography and thermodynamics knowledge and came up a very simple yet impressive model.&#xD;
&#xD;
&#xD;
[size=5][b]The Regular Triangular Lattice[/b][/size]&#xD;
&#xD;
First of all, we are trying to simulate snowflake, which is a kind of hexagonal crystal. So it should be best to construct our CA on a regular hexagonal grid, i.e. regular triangular lattice.&#xD;
&#xD;
We all know [b]CellularAutomaton[/b] inherently works on rectangle lattices (&amp;#034;4-lattice&amp;#034; for short), so how can we deduce a triangular lattice (&amp;#034;3-lattice&amp;#034; for short) on it? Well, the differences between rect-lattice and triangular one is just a geometric transformation.&#xD;
&#xD;
To demonstrate that, have a look at the following 4-lattice, with a blue square highlighting the range-1 [url=http://mathworld.wolfram.com/MooreNeighborhood.html]Moore neighborhood[/url]:&#xD;
&#xD;
[img=width: 388px; height: 396px;]/c/portal/getImageAttachment?filename=fig1.gif&amp;amp;userId=93201[/img]&#xD;
&#xD;
Clearly there is always a hexagon (the green area) in this kind of neighborhood.&#xD;
&#xD;
So forming a regular 3-lattice is as straightforward as doing a simple affine transformation (basically a shearing and a scaling):&#xD;
&#xD;
[img=width: 484px; height: 304px;]/c/portal/getImageAttachment?filename=fig2.gif&amp;amp;userId=93201[/img]&#xD;
&#xD;
So to take advantage of all the power of [b]CellularAutomaton[/b], all we have to do, is to use a following special 6-neighborhood stencil on rectangle lattices, meanwhile our model can be discussed and constructed on regular triangular lattice convieniently:&#xD;
&#xD;
[img=width: 118px; height: 57px;]/c/portal/getImageAttachment?filename=fig3.png&amp;amp;userId=93201[/img]&#xD;
&#xD;
And after the calculation, we can perform the affine transformation with following functions to get a nice hexagonal grid picture.&#xD;
&#xD;
[mcode]Clear[vertexFunc]&#xD;
&#xD;
vertexFunc = &#xD;
        Compile[{{para, _Real, 1}}, &#xD;
            Module[{center, ratio}, center = para[[1 ;; 2]];&#xD;
                ratio = para[[3]];&#xD;
                {Re[#], Im[#]} + {{1, -(1/2)}, {0, &#xD;
                                        Sqrt[3]/2}}.Reverse[{-1, 1} center + {3, 0}] &amp;amp; /@ (ratio 1/&#xD;
                                Sqrt[3] E^(I ?/6) E^(I Range[6] ?/3))], &#xD;
            RuntimeAttributes -&amp;gt; {Listable}, Parallelization -&amp;gt; True, &#xD;
            RuntimeOptions -&amp;gt; &amp;#034;Speed&amp;#034;&#xD;
            (*,CompilationTarget?&amp;#034;C&amp;#034;*)];&#xD;
&#xD;
Clear[displayfunc]&#xD;
displayfunc[array_, ratio_] := &#xD;
    Graphics[{FaceForm[{ColorData[&amp;#034;DeepSeaColors&amp;#034;][3]}], &#xD;
            EdgeForm[{ColorData[&amp;#034;DeepSeaColors&amp;#034;][4]}], &#xD;
            Polygon[vertexFunc[Append[#, ratio]] &amp;amp; /@ Position[array, 1]]}, &#xD;
        Background -&amp;gt; ColorData[&amp;#034;DeepSeaColors&amp;#034;][0]][/mcode]&#xD;
&#xD;
&#xD;
[size=5][b]The Model[/b][/size]&#xD;
&#xD;
To construct the crystallization model, let&amp;#039;s consider one of the 6-neighborhood stencil, where each cell represents a minimal crystal unit:&#xD;
&#xD;
[img=width: 261px; height: 236px;]/c/portal/getImageAttachment?filename=fig4.png&amp;amp;userId=93201[/img]&#xD;
&#xD;
A simple model will need only 2 states: [b]0[/b] for &amp;#034;[i]It&amp;#039;s empty[/i]&amp;#034;, [b]1[/b] for &amp;#034;[i]There is a crystal unit[/i]&amp;#034;. So by considering all (except the [b]000000[/b] one, because we are generating ONE snowflake thus don&amp;#039;t want a crystall randomly arises from void) [b]6-bit[/b] non-negative numbers, we can have a finite set of possible arrangements of the neighborhood:&#xD;
&#xD;
[mcode]stateSet = Tuples[{0, 1}, 6] // Rest[/mcode]&#xD;
However, from the viewpoint of physics, any two arrangements which can be transformed into each other with only rotation and reflection should be considered as the same arrangement in the sense of their physical effects on the central cell (i.e. cell[size=1]2,2[/size]) are the same:&#xD;
&#xD;
[img=width: 363px; height: 117px;]/c/portal/getImageAttachment?filename=fig5.png&amp;amp;userId=93201[/img]&#xD;
&#xD;
So we should gather [b]stateSet[/b] with above equivalence class:&#xD;
&#xD;
[mcode]gatherTestFunc = Function[lst, Union[Join[&#xD;
&#xD;
                    RotateLeft[lst, # - 1] &amp;amp; /@ Flatten[Position[lst, 1]],&#xD;
                    RotateLeft[Reverse[lst], # - 1] &amp;amp; /@ &#xD;
                        Flatten[Position[Reverse[lst], 1]]&#xD;
                    ]]];&#xD;
&#xD;
stateClsSet = Sort /@ Gather[stateSet, gatherTestFunc[#1] == gatherTestFunc[#2] &amp;amp;];&#xD;
&#xD;
stateClsSetHomogeneous = ArrayPad[#, {{0, 12 - Length@#}, {0, 0}}] &amp;amp; /@ stateClsSet;[/mcode]&#xD;
Which turned out to be [b]12[/b] classes in total:&#xD;
&#xD;
[img=width: 710px; height: 127px;]/c/portal/getImageAttachment?filename=fig6.png&amp;amp;userId=93201[/img]&#xD;
&#xD;
Now from the viewpoint of cellular automaton, we need to establish a set of rules on how should any 6-neighborhood arrangement, i.e. those 12 kinds of equivalence classes, determine the state of the central cell.&#xD;
&#xD;
There are 4 kinds of possible transformations on cell[size=1]2,2[/size]: [b]0 --&amp;gt; 1[/b] is called [b]frozen[/b], [b]0 --&amp;gt; 0[/b] is [b]remaining empty[/b], [b]1 --&amp;gt; 1[/b] is [b]remaining frozen[/b], and [b]1 --&amp;gt; 0[/b] is called [b]melten[/b]. To make things more interesting and to explore more possibilities, we can introduce probability here, so certain arrangement will give certain probabilities corresponding to the 4 kinds of transformations. But notice that because of the unitarity of probability, we have Prob(frozen) + Prob(0-&amp;gt;0) = 1 and Prob(melten) + Prob(1-&amp;gt;1) = 1, so only 2 of the 4 probabilities are independent. In the following, we&amp;#039;ll choose Prob(frozen) and Prob(melten), and denote them as [b]pFrozen[/b] and [b]pMelten[/b].&#xD;
&#xD;
[img=width: 800px; height: 367px;]/c/portal/getImageAttachment?filename=fig7.png&amp;amp;userId=93201[/img]&#xD;
&#xD;
Back to physics / thermodynamics, those 24 probabilities, [b]pFrozen[/b] and [b]pMelten[/b], can of corse be determined by serious physical models, or they can be chosen randomly just for fun. For example, an intuitive (and naive) idea would be to believe an empty cell nearby a sharp pointed end or with abundant moisture source will have a high [b]pFrozen[/b]. (People who are interested in the serious physical models should not miss [url=http://psoup.math.wisc.edu/Snowfakes.htm]the Gravner-Griffeath Snowfakes model[/url].)&#xD;
&#xD;
Now we have the grid, the stencil, the neighborhood arrangement set and the transfer probabilities, we&amp;#039;re offically ready to construct our cellular automaton rules.&#xD;
Following the above discussion, the construction is straightforward. There are only two points which need to pay attention to. One is to keep in mind that the rule function is applied on the 3x3 stencil, so even cell[size=1]1,1[/size] and cell[size=1]3,3[/size] has nothing to do with our model, don&amp;#039;t forget handling them. The second is to use a [b]SeedRandom[/b] function to make sure same arrangement gives same result in same time step, otherwise the 6-fold rotational symmetry and 3 axes of reflection symmetry will both break!&#xD;
&#xD;
[mcode]Clear[ruleFunc]&#xD;
&#xD;
ruleFunc = With[{&#xD;
                stateClsSetHomogeneous = stateClsSetHomogeneous,&#xD;
                seedStore = RandomInteger[{0, 1000}, 1000],&#xD;
                pFreeze = {1,   0,     0.6,   0,     0.3,   0.15,   0,     0.2,   0,     0.2,   0,     0.8},&#xD;
                pMelt   = {0,   0.7,   0.5,   0.7,   0.7,   0.5,    0.3,   0.5,   0.3,   0.2,   0.1,   0  }&#xD;
                },&#xD;
            Compile[{{neighborarry, _Integer, 2}, {step, _Integer}},&#xD;
                Module[{cv, neighborlst, cls, rand},&#xD;
                    cv = neighborarry[[2, 2]];&#xD;
                    neighborlst = {#[[1, 2]], #[[1, 3]], #[[2, 3]], #[[3, 2]], #[[3, &#xD;
                                        1]], #[[2, 1]]} &amp;amp;[neighborarry];&#xD;
                    If[Total[neighborlst] == 0, cv,&#xD;
                        cls = Position[stateClsSetHomogeneous, neighborlst][[1, 1]];&#xD;
                        SeedRandom[seedStore[[step + 1]]];&#xD;
                        rand = RandomReal[];&#xD;
                        Boole@If[cv == 0, rand &amp;lt; pFreeze[[cls]], rand &amp;gt; pMelt[[cls]]]&#xD;
                        ]],&#xD;
                (*CompilationTarget -&amp;gt; &amp;#034;C&amp;#034;,*)&#xD;
                RuntimeAttributes -&amp;gt; {Listable}, Parallelization -&amp;gt; True, &#xD;
                RuntimeOptions -&amp;gt; &amp;#034;Speed&amp;#034;&#xD;
                ]&#xD;
            ];[/mcode]&#xD;
(Note: re-compile the rule function [b]ruleFunc[/b] will give a different set of [b]seedStore[/b] thus a different growth path.)&#xD;
&#xD;
Now everything is ready, let&amp;#039;s grow a snowflake from the beginning! :D&#xD;
&#xD;
[mcode]dataSet = Module[{&#xD;
&#xD;
                    rule,&#xD;
                    initM = {{&#xD;
                                    {0, 0, 0},&#xD;
                                    {0, 1, 0},&#xD;
                                    {0, 0, 0}&#xD;
                                }, 0},&#xD;
                    rspec = {1, 1},&#xD;
                    tmin = 0, tmax = 100, dt = 1},&#xD;
                rule = {ruleFunc, {}, rspec};&#xD;
                CellularAutomaton[rule, initM, {{tmin, tmax, dt}}]&#xD;
                ]; // AbsoluteTiming&#xD;
&#xD;
Animate[&#xD;
    Rotate[displayfunc[dataSet[[k]], .8], 90 °],&#xD;
    {k, 1, Length[dataSet], 1},&#xD;
    AnimationDirection -&amp;gt; ForwardBackward,&#xD;
    AnimationRunning -&amp;gt; False, DisplayAllSteps -&amp;gt; True&#xD;
    ][/mcode]&#xD;
&#xD;
[img]/c/portal/getImageAttachment?filename=fig0.gif&amp;amp;userId=93201[/img]&#xD;
&#xD;
&#xD;
&#xD;
[size=5][b]Possible Improvements[/b][/size]&#xD;
&#xD;
We used a [b]SeedRandom[/b] function in our CA rule function to force the 6-fold rotational symmetry and 3 axes of reflection symmetry, and performed the CA calculation on all cells. However, this so called [url=http://demonstrations.wolfram.com/DihedralGroupNOfOrder2n/][i]D[/i][size=1]6[/size] symmetry[/url] can (and should) be integrated into our model, which will saving [b]11/12[/b] of the calculation. Also, the randomness of the growth path comes from [b]seedStore[/b], so to generate a new growth path, we have to re-compile the rule function. But with a improved model as described above, this constraint will no longer exist.&#xD;
&#xD;
[img=width: 800px; height: 177px;]/c/portal/getImageAttachment?filename=fig8.png&amp;amp;userId=93201[/img]&#xD;
[b][size=4]&#xD;
&#xD;
[size=5]Open question [/size]&#xD;
[/size][/b]&#xD;
Can we construct a well-organized structure (like the crystals) from a cellular automaton defined on an [b]irregular[/b] grid? While I believe the answer is [i]yes[/i], the next question would be [i]how?[/i]</description>
    <dc:creator>Silvia Hao</dc:creator>
    <dc:date>2014-04-11T16:03:33Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/1028536">
    <title>Mathematica 11.0.1 now available for the Raspberry Pi</title>
    <link>https://community.wolfram.com/groups/-/m/t/1028536</link>
    <description>Hi all,&#xD;
&#xD;
Mathematica 11.0.1 is now available for the Raspberry Pi on Raspbian. If you already have Mathematica installed on your Raspberry Pi, you can update with the following:&#xD;
&#xD;
    sudo apt-get update &amp;amp;&amp;amp; sudo apt-get upgrade wolfram-engine&#xD;
&#xD;
If you don&amp;#039;t already have Mathematica installed you can run the following commands to install it:&#xD;
&#xD;
    sudo apt-get update &amp;amp;&amp;amp; sudo apt-get install wolfram-engine&#xD;
&#xD;
New features for the Raspberry Pi include :&#xD;
&#xD;
 - Neural Network features including constructing custom nets : http://reference.wolfram.com/language/guide/NeuralNetworks.html&#xD;
 - Audio processing features including out of core streaming of large sounds as well as advanced audio processing : http://reference.wolfram.com/language/guide/AudioProcessing.html&#xD;
 - Travel based path plan functions including path finding from one city to another : http://reference.wolfram.com/language/guide/LocationsPathsAndRouting.html&#xD;
 - Channel based communication for sending and receiving messages : http://reference.wolfram.com/language/guide/Channel-BasedCommunication.html&#xD;
 - Powerful and easy scripting through WolframScript : http://reference.wolfram.com/language/ref/program/wolframscript.html&#xD;
 - And many more : http://reference.wolfram.com/language/guide/SummaryOfNewFeaturesIn11.html&#xD;
&#xD;
Additionally, with the new release of WolframScript on the Raspberry Pi, you can install WolframScript standalone and run it without a local kernel against the cloud using the `-cloud` option. This means you can use the Wolfram Language through WolframScript on the Raspberry Pi without having wolfram-engine installed by running it against the cloud. See the documentation page for WolframScript for more details.</description>
    <dc:creator>Ian Johnson</dc:creator>
    <dc:date>2017-03-09T21:02:49Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2185089">
    <title>[WSG21] Daily Study Group: Wolfram Language Basics</title>
    <link>https://community.wolfram.com/groups/-/m/t/2185089</link>
    <description>A new study group for Wolfram Language Basics begins Monday, Feb 15, 2021! &#xD;
&#xD;
Join this three-week study group to build or refresh your knowledge of the Wolfram Language. We will start slow but try to cover a broad variety of topics. No prior experience in Wolfram Language is needed to join this study group. We will provide study materials along with self-learning exercises so you can review topics on your own beyond the study group sessions.&#xD;
&#xD;
Sign up here: [https://wolfr.am/T4GiU9ch][1]&#xD;
&#xD;
&#xD;
  [1]: https://wolfr.am/T4GiU9ch</description>
    <dc:creator>Abrita Chakravarty</dc:creator>
    <dc:date>2021-02-04T21:18:34Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/2504513">
    <title>[WSG22] Daily Study Group: A Guide to Programming and Mathematics with WL</title>
    <link>https://community.wolfram.com/groups/-/m/t/2504513</link>
    <description>A new study group on the topic &amp;#034;A Guide to Programming and Mathematics with the Wolfram Language&amp;#034; will begin soon.&#xD;
&#xD;
Join a cohort of fellow learners and expand your understanding of core programming topics as well as symbolic and applied mathematics functionality in the Wolfram Language with lessons by veteran instructor and developer [David Withoff][1]. A basic working knowledge of the Wolfram Language or introductory-level skill in any programming language is recommended.&#xD;
&#xD;
April 18&amp;#x2013;May 6&#xD;
&#xD;
11am&amp;#x2013;12pm US CT (4&amp;#x2013;5pm GMT)&#xD;
&#xD;
[**REGISTER HERE**][2]&#xD;
&#xD;
![enter image description here][3]&#xD;
&#xD;
&#xD;
  [1]: https://www.wolfram.com/wolfram-u/instructors/withoff.html&#xD;
  [2]: https://www.bigmarker.com/series/daily-study-group-a-guide-to-programming-and-mathematics/series_details?utm_bmcr_source=community&#xD;
  [3]: https://community.wolfram.com//c/portal/getImageAttachment?filename=WolframUBanner.jpeg&amp;amp;userId=130003</description>
    <dc:creator>Abrita Chakravarty</dc:creator>
    <dc:date>2022-04-06T14:49:11Z</dc:date>
  </item>
  <item rdf:about="https://community.wolfram.com/groups/-/m/t/196759">
    <title>Reading Temperature Sensors in the Wolfram Language on the RPi</title>
    <link>https://community.wolfram.com/groups/-/m/t/196759</link>
    <description>These sensors are pretty cool--they are [url=http://www.adafruit.com/products/374]cheap to buy[/url] and surprisingly sensitive to small changes in temperature. Here&amp;#039;s a first attempt I made to interact with the sensors in the Wolfram Language.&#xD;
&#xD;
For this setup I used DS18B20 temperature sensors and hooked them up to the Raspberry Pi breadboard according to Adafruit&amp;#039;s [url=http://learn.adafruit.com/adafruits-raspberry-pi-lesson-11-ds18b20-temperature-sensing/overview]setup guide[/url]. The board should look like the following diagram (make sure the sensor is hooked up to a 3.3V pin--not a 5V pin or you could fry the sensor):&#xD;
&#xD;
[center][img=width: 300px; height: 481px;]https://learn.adafruit.com/system/assets/assets/000/003/775/medium800/learn_raspberry_pi_summary.jpg[/img][/center]&#xD;
Once hooked up and connected to your Pi, run the following commands in the terminal:&#xD;
&#xD;
[code]sudo modprobe w1-gpio&#xD;
sudo modprobe w1-therm[/code]&#xD;
The temperatures are read from the sensor by &amp;#034;reading&amp;#034; the file that&amp;#039;s created in the devices directory. You can locate the file with the following commands:&#xD;
&#xD;
[code]cd /sys/bus/w1/devices&#xD;
ls[/code]&#xD;
This will show you the contents of your devices folder, where there should be a file titled 28-xxxx, where the xxxx is the serial number unique to your sensor. Once you&amp;#039;ve got that number, enter:&#xD;
&#xD;
[code]cd 28-xxxx (the xxxx should be replaced with the serial number unique to your sensor)&#xD;
cat w1_slave[/code]&#xD;
Two lines of data should return back to you--if the first line ends with &amp;#034;YES&amp;#034; then the 5-digit number at the end of the second line is the temperature, to be read as xx.xxx degrees Celsius.&#xD;
&#xD;
And now that we know that the temperature sensor is working, and we know how to find it, we can copy the file path and import it using the Wolfram Language.&#xD;
&#xD;
[mcode]Import[&amp;#034;/sys/bus/w1/devices/28-000004fe0343/w1_slave&amp;#034;][/mcode]&#xD;
Since this still returns a really long string of data that we don&amp;#039;t need, we can single out the temperature and then convert the string into a computable expression.&#xD;
&#xD;
[mcode]temp:=N[ToExpression[StringTake[Import[&amp;#034;/sys/bus/w1/devices/28-000004fe0343/w1_slave&amp;#034;],-5]]/1000][/mcode]&#xD;
So now when we read the file, we just get the temperature back!&#xD;
&#xD;
[mcode]temp&#xD;
(*22.312*)&#xD;
[/mcode]&#xD;
For kicks, I set up a scheduled task to plot the ambient temperature of my office every 60 seconds for 6 hours. Unsurprisingly, the temperature only fluctuated a few tenths of a degree...!&#xD;
&#xD;
[mcode]t={}&#xD;
RunScheduledTask[(deg=temp;AppendTo[t,deg]),{60,360}];&#xD;
Dynamic[ListLinePlot[t,Joined-&amp;gt;True,PlotRange-&amp;gt;Automatic]]&#xD;
[/mcode]&#xD;
And here&amp;#039;s what the graph looked like after a little bit of time--it truly is a sensitive device (the &amp;#034;large&amp;#034; dip down to 22.1 was me touching the sensor with my cold hands!):&#xD;
&#xD;
[center][img=width: 360px; height: 228px;]/c/portal/getImageAttachment?filename=temperaturereading3.jpg&amp;amp;userId=108162[/img][/center]Any suggestions for what to do next?</description>
    <dc:creator>Allison Taylor</dc:creator>
    <dc:date>2014-02-06T21:04:23Z</dc:date>
  </item>
</rdf:RDF>

