Pigmeo was a compiler and framework for writing microcontroller firmware in C# and other .NET languages, developed by Adrián Bulnes (Urriellu) between 2007 and 2010. This is a frozen, read-only archive of the project’s website, pigmeo.org; nothing here is maintained. Source code: github.com/Urriellu/pigmeo · Original capture: Wayback Machine · urriellu.net

Binary numbers

From Pigmeo - .NET/Mono/CLI (C#, VB.NET, C++/CLI, Nemerle...) for microcontrollers (PIC, dsPIC, AVR...)

using Pigmeo.Extensions;
 
byte foo;
foo = Convert.ToByte("00000111", 2); //Asign value 0x00000111 to foo
foo = "00000111".BinToByte(); //Asign value 0x00000111 to foo
foo.GetBit(5); //returns the value of bit 5
foo.SetBit(2, true); //sets bit 2 to "true"
 
UInt16 bar;
bar = "0001001010000001".BinToUInt16(); //Asign value 0x0001001010000001 to bar