Main Site Documentation

Using GHIElectronics.NETMF.FEZ; is missing


#1

I tried to blink a LED according to the tutorial. but the GHIElectronics.NETMF.FEZ; assembly is not there. I want to use the following codes. I have already installed the SDK4.2 and FEZ Cerbuino Bee board is used. Can any one give me a suggestion. please

using System;
using Microsoft.SPOT;
using System.Threading;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
namespace MFConsoleApplication1
{
public class Program
{
public static void Main()
{
OutputPort LED;
LED = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, true);
while (true)
{
LED.Write(!LED.Read());
Thread.Sleep(200);


#2

As your board is a Gadgeteer mainboard, it is easier for you to use a Gadgeteer project and then use mainboard.SetOnboardLED(true);


#3

Please use GHI.Hardware.FEZCerb namespace and assembly.

You will need GHI.Hardware.FEZCerb.Pin.PB2 for LED

Helpful link for you:

https://www.ghielectronics.com/docs/45/fez-cerbuino-bee-developer


#4

the following namespace is missing in the references. can you please tell me how to insert it. thanks

using GHIElectronics.NETMF.FEZ;


#5

The example is old. Please follow Gus’s advise or use the namespace/assembly and pin that I have indicated above.


#6

Thanks mate. I just new to FEZ


#7

We will update the example shortly


#8

Does .net micro frame work has a hex conversion or do i need to include it in my codings


#9

There are some codeshare contributions that have that:

https://www.ghielectronics.com/community/codeshare/search?q=string


#10

thanks mate


#11

uint P32 = uint.Parse(“b7e15163”, System.Globalization.NumberStyles.HexNumber);

the following error is displayed due to the above statement

Error 1 The type or namespace name ‘NumberStyles’ does not exist in the namespace ‘System.Globalization’ (are you missing an assembly reference?)

which assembly do I need to avoid this error when using the .net frame work or does it need any number conversions???


#12

There are some string conversion helpers on codeshare. I would use that.
NETMF doesn’t have all the functionality that exists in full .Net.


#13

Using MSDN for .NET Micro Framework (http://msdn.microsoft.com/en-us/library/cc533014.aspx) and following the link to System.Globalization Namespace implies that NETMF does not support “NumberStyles”. Additionally C# supports hexadecimal literal values of the form 0xHHHH:

uint P32 = 0xb7e15163;

See also: http://stackoverflow.com/questions/4189297/converting-string-to-uint


#14

thanks all


#15

public void Encrypt(FileStream streamreader,FileStream streamwriter)
{
uint r1, r2;

        System.IO.BinaryReader br = new System.IO.BinaryReader(streamreader);
        System.IO.BinaryWriter bw = new System.IO.BinaryWriter(streamwriter);
        long filelength = streamreader.Length;
        while (filelength > 0)
        {
            try
            {
                r1 = br.ReadUInt32();
                try
                {
                    r2 = br.ReadUInt32();
                }
                catch
                {
                    r2 = 0;
                }
            }
            catch
            {
                r1 = r2 = 0;
            }

            Encode(ref r1, ref r2, rounds);
            bw.Write(r1);
            bw.Write(r2);

            filelength -= 8;
        }

Above code is used to encrypt a data file. I want to change it to encrypt a data stream (i.e data stream coming from a sensor). what are the changes I need to do???


#16

You can also look over: http://www.ghielectronics.com/docs/111/crypto-aes and http://www.ghielectronics.com/docs/49/xtea


#17

Thanks Architect.
using GHI.Hardware.FEZCerb;
and
GHI.Hardware.FEZCerb.Pin.PB2
used in the example is perfect.

Joey