Things used in this project

Hardware components:
Pi 3 02
Raspberry Pi 3 Model B
×1
Software apps and online services:
Snappy%20(1)
Ubuntu Snappy Ubuntu Core
OS of your choice. Either Ubuntu 16.04, Ubuntu 14.04 or Windows 10 IoT Core.
10
Microsoft Windows 10 IoT Core
OS of your choice. Either Ubuntu 16.04, Ubuntu 14.04 or Windows 10 IoT Core.
Vs2015logo
Microsoft Visual Studio 2015
IDE for making your own .Net Core app. Not required, but recommended if you want to make your own app.

Code

Program.csC#
Code for the Pi calculation program.
using System;
using System.Threading;
namespace picalc
{
    class Program
    {
        static string[] text = {
@"      ___                       ___           ___           ___       ___     ",
@"     /\  \          ___        /\  \         /\  \         /\__\     /\  \    ",
@"    /::\  \        /\  \      /::\  \       /::\  \       /:/  /    /::\  \   ",
@"   /:/\:\  \       \:\  \    /:/\:\  \     /:/\:\  \     /:/  /    /:/\:\  \  ",
@"  /::\~\:\  \      /::\__\  /:/  \:\  \   /::\~\:\  \   /:/  /    /:/  \:\  \ ",
@" /:/\:\ \:\__\  __/:/\/__/ /:/__/ \:\__\ /:/\:\ \:\__\ /:/__/    /:/__/ \:\__\",
@" \/__\:\/:/  / /\/:/  /    \:\  \  \/__/ \/__\:\/:/  / \:\  \    \:\  \  \/__/",
@"      \::/  /  \::/__/      \:\  \            \::/  /   \:\  \    \:\  \      ",
@"       \/__/    \:\__\       \:\  \           /:/  /     \:\  \    \:\  \     ",
@"                 \/__/        \:\__\         /:/  /       \:\__\    \:\__\    ",
@"                               \/__/         \/__/         \/__/     \/__/    " };
        static double Pi = 0;
        static double n = 1;
        static long i = 0L;

        static void Main(string[] args)
        {
            foreach (string s in text)
            {
                Console.WriteLine(s);
            }
            Console.WriteLine();
            Console.WriteLine();
            Console.WriteLine();
            while (i < long.MaxValue)
            {
                Console.SetCursorPosition(0, Console.CursorTop - 1);
                ClearCurrentConsoleLine();
                Pi += (4.0 / n);
                n += 2.0;
                Pi -= (4.0 / n);
                n += 2.0;
                Console.WriteLine("Generated value of Pi: " + Pi);
                i++;
                Thread.Sleep(50);
            }

        }
        public static void ClearCurrentConsoleLine()
        {
            int currentLineCursor = Console.CursorTop;
            Console.SetCursorPosition(0, Console.CursorTop);
            Console.Write(new string(' ', Console.WindowWidth));
            Console.SetCursorPosition(0, currentLineCursor);
        }

    }
}

Credits

13089067
Rastko Đorđević

A 14 year old that loves programming and IoT.

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Similar projects you might like

HAL, The Link With The Outside World
Easy
  • 117
  • 3

Full instructions

The HAL (Hardware Abstraction Layer) communicate with sensors and actuators in the most easy way.

Read the signal of the AB quadrature encoder with Theremino.
Easy
  • 224
  • 3

Full instructions

The simplest way to read A B quadrature encoder using Theremino Master.

Theremino SlotViewer, the simplest way to manage slots.
Easy
  • 134
  • 4

Full instructions

Theremino SlotViewer is the very simple way to manage the slots, read the value and modify in real time the value of each slot.

Eddystone beacons with the micro:bit
Easy
  • 159
  • 2

Protip

Experiment with the Physical Web by turning your micro:bit into an Eddystone beacon.

DIY Smart Home Doorbell 2.0 (works with Alexa)
Easy
  • 1,657
  • 11

Full instructions

Build your own DIY smart home doorbell for cheap, get notified when your guest knock at your door and remotely open by voice command

DIY Self-monitored Smart Home for Vacation Time
Easy
  • 2,034
  • 13

Full instructions

Automate your house to have a peaceful mind on vacation! Monitor remotely and stay updated through smartphone notifications.

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback