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!

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

Give feedback

Comments

Similar projects you might like

Windows 98 Wrist Watch
Easy
  • 3,423
  • 24

Full instructions

Everyone's favourite Operating System. On your wrist!

The Factory at Exhibition - 4.0 and beyond - [Part 1]
Easy
  • 391
  • 4

Work in progress

Control and Supervision of a true 4.0 Working Factory that will be visible in a public Exhibition using Raspberry Pi, PowerBerry, Win10Iot

Windows 10 IoT Temperature SMT172
Easy
  • 1,360
  • 6

Protip

Read temperature from sensor (SMT172) with Windows 10 IOT, Raspberry Pi and C# UWP.

Detect Faces Using a LattePanda!
Easy
  • 246
  • 3

Full instructions

Want to make a face recognition application? Using existing APIs, it is a relatively simple process!

PlatformIO for Visual Studio Code
Easy
  • 13
  • 0

Protip

PlatformIO is an open source ecosystem for IoT development. And now, PlatformIO for Visual Studio Code is coming!

Get Stared: Intel Edison, Azure IoT Hub and Blink App
Easy
  • 184
  • 1

Full instructions

This is a getting started guide on how to use Intel Edison to send data to Azure IoT hub, store data in Azure Storage thru Azure functions.

Add projectSign up / Login
Respect project