Title
| Model
| Price
|
2A Dual Motor Controller
| DRI0002
| $ 17.00
|
FEZ Panda II- A .NET Micro Framework Controller
| DFR0142
| $ 39.90
|
Bluetooth bee
| TEL0023
| $ 26.00
|
IO Expansion Shield For Arduino (V5)
| DFR0088
| $ 18.00
|
HKBRAM - without insurance (weight 235.00 g):
| $ 7.00
| |
Total:
| $ 107.90
|
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.Hardware;
namespace iButton
{
public class Program
{
static OneWire ow = new OneWire((Cpu.Pin)FEZ_Pin.Digital.Di4);
static OutputPort led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, false );
public static void Main()
{
bool ledState = false ;
while ( true )
{
byte [] readall = new byte [8];
if (ow.Search_GetNextDevice(readall))
{
string hex = ByteArrayToString(readall);
Debug.Print( "========================" );
if (readall[0] != 0x01)
{
Debug.Print( "Device is not a DS1990A family device." );
}
Debug.Print(hex);
for ( int i = 0; i < 6; i++)
{
Thread.Sleep(200);
ledState = !ledState;
led.Write(ledState);
}
}
}
}
public static string ByteArrayToString( byte [] ba)
{
string hex = string .Empty;
for ( int i = ba.Length - 1; i >= 0; i--)
{
hex += " " + ByteToHex(ba[i]);
}
return hex;
}
public static string ByteToHex( byte b)
{
const string hex = "0123456789ABCDEF" ;
int lowNibble = b & 0x0F;
int highNibble = (b & 0x0F0) >> 4;
string s = new string ( new char [] { hex[highNibble], hex[lowNibble] });
return s;
}
}
}
* This source code was highlighted with Source Code Highlighter .
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.Hardware;
namespace iButton
{
public class Program
{
static OneWire ow = new OneWire((Cpu.Pin)FEZ_Pin.Digital.Di4);
static OutputPort led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, false );
public static void Main()
{
bool ledState = false ;
while ( true )
{
byte [] readall = new byte [8];
if (ow.Search_GetNextDevice(readall))
{
string hex = ByteArrayToString(readall);
Debug.Print( "========================" );
if (readall[0] != 0x01)
{
Debug.Print( "Device is not a DS1990A family device." );
}
Debug.Print(hex);
for ( int i = 0; i < 6; i++)
{
Thread.Sleep(200);
ledState = !ledState;
led.Write(ledState);
}
}
}
}
public static string ByteArrayToString( byte [] ba)
{
string hex = string .Empty;
for ( int i = ba.Length - 1; i >= 0; i--)
{
hex += " " + ByteToHex(ba[i]);
}
return hex;
}
public static string ByteToHex( byte b)
{
const string hex = "0123456789ABCDEF" ;
int lowNibble = b & 0x0F;
int highNibble = (b & 0x0F0) >> 4;
string s = new string ( new char [] { hex[highNibble], hex[lowNibble] });
return s;
}
}
}
* This source code was highlighted with Source Code Highlighter .
using System;
using System.Threading;
using Microsoft.SPOT;
using Microsoft.SPOT.Hardware;
using GHIElectronics.NETMF.FEZ;
using GHIElectronics.NETMF.Hardware;
namespace iButton
{
public class Program
{
static OneWire ow = new OneWire((Cpu.Pin)FEZ_Pin.Digital.Di4);
static OutputPort led = new OutputPort((Cpu.Pin)FEZ_Pin.Digital.LED, false );
public static void Main()
{
bool ledState = false ;
while ( true )
{
byte [] readall = new byte [8];
if (ow.Search_GetNextDevice(readall))
{
string hex = ByteArrayToString(readall);
Debug.Print( "========================" );
if (readall[0] != 0x01)
{
Debug.Print( "Device is not a DS1990A family device." );
}
Debug.Print(hex);
for ( int i = 0; i < 6; i++)
{
Thread.Sleep(200);
ledState = !ledState;
led.Write(ledState);
}
}
}
}
public static string ByteArrayToString( byte [] ba)
{
string hex = string .Empty;
for ( int i = ba.Length - 1; i >= 0; i--)
{
hex += " " + ByteToHex(ba[i]);
}
return hex;
}
public static string ByteToHex( byte b)
{
const string hex = "0123456789ABCDEF" ;
int lowNibble = b & 0x0F;
int highNibble = (b & 0x0F0) >> 4;
string s = new string ( new char [] { hex[highNibble], hex[lowNibble] });
return s;
}
}
}
* This source code was highlighted with Source Code Highlighter .
Source: https://habr.com/ru/post/142831/