Problems with digitalRead

userHead Sc4r3Cr0w 2018-03-02 06:56:42 1374 Views2 Replies

i have this simple settup:
Image
But when i try to read from pin 7 i always get 0 (i also tried other pins)
This is my code (C#):

Code: Select all

var arduino = new Arduino(); arduino.pinMode(7, Arduino.INPUT);// Set the digital pin 12 as input int Value = arduino.digitalRead(7);// Read the state of pin 12 once. Console.WriteLine(Value); //arduino.digitalPinUpdated += Arduino_digitalPinUpdated; while (true) { Thread.Sleep(1000); Console.WriteLine(arduino.digitalRead(7)); } I also tried digitalPinUpdated but it did not work. 
I dont get where my problem is ... it all set up like in the example here: https://docs.lattepanda.com