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

The $10 RPi Zero W - First Impressions
Easy
  • 6,938
  • 14

Protip

Seriously, can a $10 Raspberry Pi Zero-W actually perform useful work? I'm typing this while the "W" is streaming YouTube to my HDMI 4K TV.

PlatformIO for Visual Studio Code
Easy
  • 772
  • 6

Protip

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

ExaGear Desktop Virtual Machine for Raspberry Pi
Easy
  • 62
  • 2

Full instructions

Make common solutions for PC work on ARM-based for any purpose and level of difficulty.

Network Monitoring using R-Pi and Node Red
Easy
  • 1,587
  • 11

Work in progress

Using the R-Pi 3 and Node Red I created a simple network monitoring appliance.

Install Alexa on Raspberry Pi with Wake Word and Airplay
Easy
  • 3,916
  • 35

Protip

Install Amazon Voice Service Alexa on Raspberry Pi 3 B with Wake Word and Airplay support. You can use Raspberry Pi as multi-room speaker.

Windows 98 Wrist Watch
Easy
  • 3,793
  • 24

Full instructions

Everyone's favourite Operating System. On your wrist!

ProjectsCommunitiesContestsLiveAppsBetaFree StoreBlogAdd projectSign up / Login
Respect project
Feedback