Blog J.Schweiss

Infosammlung zu .NET- und anderen Programmier-Themen

BadImage Exception–VS20xx Platform choosing

clock Mai 23, 2015 02:53 by author Administrator

x64/x86/anyCPU



Let me google that for you

clock Mai 16, 2015 22:33 by author Administrator

here



Azure

clock Mai 16, 2015 19:52 by author Administrator

Blog



Windows 10 IoT

clock Mai 16, 2015 19:42 by author Administrator

Artikel

code samples

HowTo



ZEDGraph in MVC

clock Mai 14, 2015 19:39 by author Administrator

here



1,8 “ TFT on Raspi

clock Mai 12, 2015 05:54 by author Administrator

with ST7735

Temperature-measurements with DS18S20



IoT–InitialState

clock Mai 10, 2015 22:36 by author Administrator

here website

Article



RaspiWifi Tests

clock Mai 10, 2015 22:25 by author Administrator

here



Windows 10 for IOT and Raspberry2

clock Mai 10, 2015 20:47 by author Administrator

Preview is out!

Setting up Windows 10 IoT Core on Raspberry Pi from a VM

Get started   1

Start coding

GPIOs

Tip:

After a couple of troubles with a Windows 10 Preview VM I downloaded the Windows Assessment and Deployment Kit (ADK tools) for Windows 10 Preview on my Windows 7 machine and installed just the DISM Part.
Now I could run the DISM command on Windows 7. No need for Windows 10

Install Windows 10 IoT on Win7

Forum

How to connect

Commandline utils



SSH-Keys

clock Mai 9, 2015 04:08 by author Administrator

SSH extern

Brute force bruteSSH

Tastaturlayout ändern

WLAN-Adapter

Samba



433 MHz Funksteckdosen mit RASPI schalten

clock Mai 9, 2015 03:48 by author Administrator

Artikel

BreakOut-Board



Arduino IDE 1.6 features

clock April 27, 2015 02:03 by author Administrator

here

 

void setup() {
  // initialize digital pin 13 as an output.
  pinMode(LED_BUILTIN, OUTPUT);
}
// the loop function runs over and over again forever
void loop() {
  digitalWrite(LED_BUILTIN, HIGH);   // turn the LED on (HIGH is the voltage level)
  delay(1000);              // wait for a second
  digitalWrite(LED_BUILTIN, LOW);    // turn the LED off by making the voltage LOW
  delay(1000);              // wait for a second
}



RCSwitch mit 433 MHz und Tücken mit Leonardo-Interrupts

clock April 27, 2015 01:39 by author Administrator

Beim Herumexperimentieren mit der RCSwitch-Library hier um die Definition für FHEM zu finden.

image

NanoCUL mit CC1101, Blog, FHEMduino, CUL-Emulator, FHEM-Übersicht

image

 

ist mir bei der  Empfags-Demo aufgefallen, dass die Zeile

  if (mySwitch.available()) 

nie True wurde.

Ursache war , dass in den Beispielen immer ein Arduino UNO benutzt wurde.

Bei mir kam ein Arduino Leonardo zum Einsatz!

  mySwitch.enableReceive(1);  // Receiver on interrupt 1 on leonardo(!) (not 0 as on UNO)  => that is pin #2#

Und siehe da:

http://www.arduino.cc/en/Reference/attachInterrupt

    https://code.google.com/p/arduino/issues/detail?id=714

This is valid for Leonardo :
    Int0 on D3,
    Int1 on D2,
    Int2 on D0,
    Int3 on D1
    http://arduino.cc/en/Reference/attachInterrupt shows pin 7 as interrupt 4 for the Leonardo (one of 5 hardware interrupts).  But    http://www.atmel.com/Images/7766s.pdf shows int.6. for port-pin E-6.  And the above shows just 4 interrupts...
    Documentations needs clarifying as to what hardware interrupts the Leonardo has, on what interrupt numbers. 
   
   See  Raw-Data:
    http://test.sui.li/oszi/

 

image

Insgesamt 32 Takte mit 12 Daten.

9448,272,940,280,940,276,940,276,940,276,944,276,940,276,944,272,940,276,944,272,944,276,940,276,940,276,940,888,332,276,944,884,336,272,944,884,336,276,940,888,332,276,940,276,944,272,944,884,336,

image

Hauscode: “11111”  , scheint bei den Pollin Steckdosen invertiert zu sein, also “00000” (siehe auch  hier)

DeviceId:      01111

Hier ein Beispiel-Output. (die Raw-Data-Werte in obige Webseite pasten.)

Setup done....
Received 1361 / 24bit Protocol: 1
Decimal: 1361 (24Bit) Binary: 000000000000010101010001 Tri-State: 000000FFFF0F ¨ C
Ä ¨ PulseLength: 304 microseconds Protocol: 1
Raw data: 9448,276,944,276,940,276,940,276,940,280,936,280,936,280,940,276,940,276,944,272,940,276,944,276,936,280,940,884,336,276,936,888,332,280,940,884,332,280,940,888,328,280,940,276,940,276,940,888,332,

Here is my code for Leonardo:

 

/*
  Simple example for receiving, here as Leonardo Version
  See Interrupt for D3,D2 !
  
  http://code.google.com/p/rc-switch/

    https://code.google.com/p/arduino/issues/detail?id=714
    Int0 on D3, 
    Int1 on D2, 
    Int2 on D0, 
    Int3 on D1
    http://arduino.cc/en/Reference/attachInterrupt shows pin 7 as interrupt 4 for the Leonardo (one of 5 hardware interrupts).  
But http://www.atmel.com/Images/7766s.pdf shows int.6. for port-pin E-6.  And the above shows just 4 interrupts...
    Documentations needs clarifying as to what hardware interrupts the Leonardo has, on what interrupt numbers.  
    
    Raw-Data:
    http://test.sui.li/oszi/

*/

#include <RCSwitch.h>

RCSwitch mySwitch = RCSwitch();


int ledPin = 9;                 // LED connected to digital pin 13
int onboard_led = 13;
//------------------------------------------------------------
void blink()
{   digitalWrite(ledPin, HIGH);   // sets the LED on   delay(50); // waits for a second   digitalWrite(ledPin, LOW);    // sets the LED off   delay(50);  // waits for a second
}
//------------------------------------------------------------
void blink_system()
{   digitalWrite(onboard_led, HIGH);   // sets the LED on   delay(50); // waits for a second   digitalWrite(onboard_led, LOW);    // sets the LED off   delay(50); // waits for a second
}
//------------------------------------------------------------
static char * dec2binWzerofill(unsigned long Dec, unsigned int bitLength)
{   static char bin[64];   unsigned int i=0;   while (Dec > 0)   {     bin[32+i++] = (Dec & 1 > 0) ? '1' : '0';     Dec = Dec >> 1;   }   for (unsigned int j = 0; j< bitLength; j++)   {     if (j >= bitLength - i)     {       bin[j] = bin[ 31 + i - (j - (bitLength - i)) ];     }     else     {       bin[j] = '0';     }   }   bin[bitLength] = '\0';      return bin;
}
//------------------------------------------------------------
void output(unsigned long decimal, unsigned int length, unsigned int delay, unsigned int* raw, unsigned int protocol) 
{   if (decimal == 0)   {     Serial.print("Unknown encoding.");   } else {     char* b = dec2binWzerofill(decimal, length);     Serial.print("Decimal: ");     Serial.print(decimal);     Serial.print(" (");     Serial.print( length );     Serial.print("Bit) Binary: ");     Serial.print( b );     Serial.print(" Tri-State: ");     Serial.print( bin2tristate( b) );     Serial.print(" PulseLength: ");     Serial.print(delay);     Serial.print(" microseconds");     Serial.print(" Protocol: ");     Serial.println(protocol);   }      Serial.print("Raw data: ");   for (int i=0; i<= length*2; i++) {     Serial.print(raw[i]);     Serial.print(",");   }   Serial.println();   Serial.println();
}

//------------------------------------------------------------
static char* bin2tristate(char* bin) {   char returnValue[50];   int pos = 0;   int pos2 = 0;   while (bin[pos]!='\0' && bin[pos+1]!='\0') {     if (bin[pos]=='0' && bin[pos+1]=='0') {       returnValue[pos2] = '0';     } else if (bin[pos]=='1' && bin[pos+1]=='1') {       returnValue[pos2] = '1';     } else if (bin[pos]=='0' && bin[pos+1]=='1') {       returnValue[pos2] = 'F';     } else {       return "not applicable";     }     pos = pos+2;     pos2++;   }   returnValue[pos2] = '\0';   return returnValue;
}
//------------------------------------------------------------
void setup() 
{   pinMode(ledPin, OUTPUT);  // sets the digital pin as output   pinMode(onboard_led, OUTPUT);   Serial.begin(9600);      while (!Serial)   {     ; // wait for serial port to connect. Needed for Leonardo only   }   Serial.println("Setup done....");      //mySwitch.setProtocol(1);   mySwitch.enableReceive(1);  // Receiver on inerrupt 1 on leonardo(!) (not 0 on UNO)  => that is pin #2#     }
//------------------------------------------------------------
void loop() 
{   digitalWrite(ledPin, LOW);   digitalWrite(onboard_led, HIGH);   if (mySwitch.available())   {  int value = mySwitch.getReceivedValue(); if (value == 0) {  Serial.print("Unknown encoding");     }      else     {       Serial.print("Received ");       Serial.print( mySwitch.getReceivedValue() );       Serial.print(" / ");       Serial.print( mySwitch.getReceivedBitlength() );       Serial.print("bit ");       Serial.print("Protocol: ");       Serial.println( mySwitch.getReceivedProtocol() );     }         output(mySwitch.getReceivedValue(), mySwitch.getReceivedBitlength(), mySwitch.getReceivedDelay(), mySwitch.getReceivedRawdata(),mySwitch.getReceivedProtocol());         mySwitch.resetAvailable();   }   else   {     int val=0;      val = digitalRead(2);      digitalWrite(ledPin, val);     //blink_system();     }
}

//------------------------------------------------------------


Soap FAQs

clock April 25, 2015 21:50 by author Administrator

here



Oracle FAQs

clock April 25, 2015 21:41 by author Administrator

here

DBA Checklist

Oracle Health



SDR mit Pi

clock April 25, 2015 03:21 by author Administrator

HowTo



Microsoft Message Analyzer

clock April 20, 2015 02:10 by author Administrator

download V1.2



u8glib

clock April 19, 2015 21:24 by author Administrator

graphic lib

ugclib for ST7735

lcd oszilloscope for  DG-16080-11 with touch screen basics

 

wifi terminal



PI Bootstrap

clock April 13, 2015 00:48 by author Administrator

here



Independent ON-OFF Times

clock April 13, 2015 00:40 by author Administrator

with millis()

How to reste millis()

 

// On and Off Times (as int, max=32secs)

const

unsigned int onTime = 1000; 
const

unsigned int offTime = 500; 
// Tracks the last time event fired

unsigned long previousMillis=0; 
// Interval is how long we wait

int interval = onTime; 
// Used to track if LED should be on or off

boolean LED13state = true; 
// Usual Setup Stuff

void setup() 
{ 
 pinMode(13, OUTPUT); 
}

void loop() 
{ // Set Pin 13 to state of LED13state each timethrough loop() // If LED13State hasn't changed, neither will the pin
digitalWrite(13, LED13state); // Grab snapshot of current time, this keeps all timing // consistent, regardless of how much code is inside the next if-statement unsigned long currentMillis = millis(); // Compare to previous capture to see if enough time has passed if ((unsigned long)(currentMillis - previousMillis) >= interval) { // Change wait interval, based on current LED state 
if (LED13state) 
{ // LED is currently on, set time to stay off 
interval = offTime; } else { // LED is currently off, set time to stay on 
interval = onTime; } // Toggle the LED's state, Fancy, eh!? 
LED13state = !(LED13state); // Save the current time to compare "later" 
previousMillis = currentMillis; } 
}