Click here to Skip to main content
14,270,114 members
   

Mobile

 
AnswerRe: BEGINNER NEEDS HELP Pin
Wendelius30-Dec-16 20:58
mveWendelius30-Dec-16 20:58 
GeneralMessage Closed Pin
20-Apr-17 21:55
memberMember 1314071920-Apr-17 21:55 
AnswerRe: BEGINNER NEEDS HELP Pin
Richard MacCutchan30-Dec-16 21:11
protectorRichard MacCutchan30-Dec-16 21:11 
QuestionApple Pay - WEB Integration through Braintree - how to create Certificate for the Sandbox / Development Environment? Pin
AndreeaLib27-Dec-16 1:37
memberAndreeaLib27-Dec-16 1:37 
AnswerRe: Apple Pay - WEB Integration through Braintree - how to create Certificate for the Sandbox / Development Environment? Pin
Richard MacCutchan27-Dec-16 4:55
protectorRichard MacCutchan27-Dec-16 4:55 
Questionno définition for RequestAccessAsync in windows10 but i need it Pin
Member 865861427-Dec-16 0:05
memberMember 865861427-Dec-16 0:05 
AnswerRe: no définition for RequestAccessAsync in windows10 but i need it Pin
Richard Deeming10-Jan-17 3:43
mveRichard Deeming10-Jan-17 3:43 
QuestionHow to make running leds with Windows 10 IoT uwp c# Pin
ken7625-Dec-16 10:00
memberken7625-Dec-16 10:00 
I have problem to create running leds with Raspberry PI 3 Windows IOT, but random led blink does work.
The code for both are almost the same, only diffrent runnings leds is controlled by variable count and random led
is generated with random generator.

The running led code is below this text. I will get only the first led to light, and rest of leds stays dark. Can someone see what's wrong with this code?
But the random blink led works, which comes after this running leds code and both codes almost identically, but still the running leds code does not work.

Running leds code

private void Timer_Tick(object sender, object e)
        {
            int ledCheck = 1, ledCheck2 = 1;
            int ledValue = 0, ledValue2 = 0; 
                //ledValue2 = 1;
            int checkValue = 0;

           
                    if (ledCheck2 == 1)
                    {
                        pinValue1 = GpioPinValue.Low;
                        pin.Write(pinValue1);

                        pinValue2 = GpioPinValue.Low;
                        pin2.Write(pinValue2);

                        pinValue3 = GpioPinValue.Low;
                        pin3.Write(pinValue3);

                        pinValue4 = GpioPinValue.Low;
                        pin4.Write(pinValue4);

                        pinValue5 = GpioPinValue.Low;
                        pin5.Write(pinValue5);

                        pinValue6 = GpioPinValue.Low;
                        pin6.Write(pinValue6);

                        pinValue7 = GpioPinValue.Low;
                        pin7.Write(pinValue7);
                        ledCheck2 = 0;

                    }
                   ledValue2 = ledValue2 + 1;
                    TextBlock1.Text = ledValue2.ToString();
                    if (ledValue2 == 1)
                    {
                        pinValue1 = GpioPinValue.High;

                    }

                    if (ledValue2 == 2)
                    {
                        pinValue2 = GpioPinValue.High;

                    }

                    if (ledValue == 3)
                    {
                        pinValue3 = GpioPinValue.High;

                    }

                    if (ledValue2 == 4)
                    {
                        pinValue4 = GpioPinValue.High;

                    }

                    if (ledValue2 == 5)
                    {
                        pinValue5 = GpioPinValue.High;

                    }

                    if (ledValue2 == 6)
                    {
                        pinValue6 = GpioPinValue.High;

                    }

                    if (ledValue2 == 7)
                    {
                        pinValue7 = GpioPinValue.High;

                    }
                    if (pinValue1 == GpioPinValue.High)
                    {

                        pinValue1 = GpioPinValue.High;
                        pin.Write(pinValue1);

                        pinValue2 = GpioPinValue.Low;
                        pin2.Write(pinValue2);

                        pinValue3 = GpioPinValue.Low;
                        pin3.Write(pinValue3);

                        pinValue4 = GpioPinValue.Low;
                        pin4.Write(pinValue4);

                        pinValue5 = GpioPinValue.Low;
                        pin5.Write(pinValue5);

                        pinValue6 = GpioPinValue.Low;
                        pin6.Write(pinValue6);

                        pinValue7 = GpioPinValue.Low;
                        pin7.Write(pinValue7);

                    }


                    if (pinValue2 == GpioPinValue.High)
                    {

                        pinValue1 = GpioPinValue.Low;
                        pin.Write(pinValue1);

                        pinValue2 = GpioPinValue.High;
                        pin2.Write(pinValue2);

                        pinValue3 = GpioPinValue.Low;
                        pin3.Write(pinValue3);

                        pinValue4 = GpioPinValue.Low;
                        pin4.Write(pinValue4);

                        pinValue5 = GpioPinValue.Low;
                        pin5.Write(pinValue5);

                        pinValue6 = GpioPinValue.Low;
                        pin6.Write(pinValue6);

                        pinValue7 = GpioPinValue.Low;
                        pin7.Write(pinValue7);
                    }

                    if (pinValue3 == GpioPinValue.High)
                    {

                        pinValue1 = GpioPinValue.Low;
                        pin.Write(pinValue1);

                        pinValue2 = GpioPinValue.Low;
                        pin2.Write(pinValue2);

                        pinValue3 = GpioPinValue.High;
                        pin3.Write(pinValue3);

                        pinValue4 = GpioPinValue.Low;
                        pin4.Write(pinValue4);

                        pinValue5 = GpioPinValue.Low;
                        pin5.Write(pinValue5);

                        pinValue6 = GpioPinValue.Low;
                        pin6.Write(pinValue6);

                        pinValue7 = GpioPinValue.Low;
                        pin7.Write(pinValue7);

                    }



                    if (pinValue4 == GpioPinValue.High)
                    {

                        pinValue1 = GpioPinValue.Low;
                        pin.Write(pinValue1);

                        pinValue2 = GpioPinValue.Low;
                        pin2.Write(pinValue2);

                        pinValue3 = GpioPinValue.Low;
                        pin3.Write(pinValue3);

                        pinValue4 = GpioPinValue.High;
                        pin4.Write(pinValue4);

                        pinValue5 = GpioPinValue.Low;
                        pin5.Write(pinValue5);

                        pinValue6 = GpioPinValue.Low;
                        pin6.Write(pinValue6);

                        pinValue7 = GpioPinValue.Low;
                        pin7.Write(pinValue7);
                    }



                    if (pinValue5 == GpioPinValue.High)
                    {

                        pinValue1 = GpioPinValue.Low;
                        pin.Write(pinValue1);

                        pinValue2 = GpioPinValue.Low;
                        pin2.Write(pinValue2);

                        pinValue3 = GpioPinValue.Low;
                        pin3.Write(pinValue3);

                        pinValue4 = GpioPinValue.Low;
                        pin4.Write(pinValue4);

                        pinValue5 = GpioPinValue.High;
                        pin5.Write(pinValue5);

                        pinValue6 = GpioPinValue.Low;
                        pin6.Write(pinValue6);

                        pinValue7 = GpioPinValue.Low;
                        pin7.Write(pinValue7);

                    }



                    if (pinValue6 == GpioPinValue.High)
                    {

                        pinValue1 = GpioPinValue.Low;
                        pin.Write(pinValue1);

                        pinValue2 = GpioPinValue.Low;
                        pin2.Write(pinValue2);

                        pinValue3 = GpioPinValue.Low;
                        pin3.Write(pinValue3);

                        pinValue4 = GpioPinValue.Low;
                        pin4.Write(pinValue4);

                        pinValue5 = GpioPinValue.Low;
                        pin5.Write(pinValue5);

                        pinValue6 = GpioPinValue.High;
                        pin6.Write(pinValue6);

                        pinValue7 = GpioPinValue.Low;
                        pin7.Write(pinValue7);


                    }



                    if (pinValue7 == GpioPinValue.High)
                    {

                        pinValue1 = GpioPinValue.Low;
                        pin.Write(pinValue1);

                        pinValue2 = GpioPinValue.Low;
                        pin2.Write(pinValue2);

                        pinValue3 = GpioPinValue.Low;
                        pin3.Write(pinValue3);

                        pinValue4 = GpioPinValue.Low;
                        pin4.Write(pinValue4);

                        pinValue5 = GpioPinValue.Low;
                        pin5.Write(pinValue5);

                        pinValue6 = GpioPinValue.Low;
                        pin6.Write(pinValue6);

                        pinValue7 = GpioPinValue.High;
                        pin7.Write(pinValue7);

                       
                    }
                    TextBlock1.Text = "TEST " + ledValue2.ToString();
                    
}


Random led blink
private void Timer_Tick(object sender, object e)
        {
            int ledCheck = 1, ledCheck2 = 1;
            int ledValue = 0, ledValue2 = 0; 
                //ledValue2 = 1;
            int checkValue = 0;
         



                    if (ledCheck == 1)
                    {

                        pinValue1 = GpioPinValue.Low;
                        pin.Write(pinValue1);

                        pinValue2 = GpioPinValue.Low;
                        pin2.Write(pinValue2);

                        pinValue3 = GpioPinValue.Low;
                        pin3.Write(pinValue3);

                        pinValue4 = GpioPinValue.Low;
                        pin4.Write(pinValue4);

                        pinValue5 = GpioPinValue.Low;
                        pin5.Write(pinValue5);

                        pinValue6 = GpioPinValue.Low;
                        pin6.Write(pinValue6);

                        pinValue7 = GpioPinValue.Low;
                        pin7.Write(pinValue7);
                        ledCheck = 0;

                    }


                    Random rnd = new Random();
                    ledValue = rnd.Next(1, 8);

                    if (ledValue != checkValue)
                    {
                        checkValue = ledValue;
                        if (ledValue == 1)
                        {
                            pinValue1 = GpioPinValue.High;

                        }

                        if (ledValue == 2)
                        {
                            pinValue1 = GpioPinValue.High;

                        }

                       if (ledValue == 3)
                        {
                            pinValue3 = GpioPinValue.High;

                        }

                        if (ledValue == 4)
                        {
                            pinValue4 = GpioPinValue.High;

                        }

                        if (ledValue == 5)
                        {
                            pinValue5 = GpioPinValue.High;

                        }

                        if (ledValue == 6)
                        {
                            pinValue6 = GpioPinValue.High;

                        }

                        if (ledValue == 7)
                        {
                            pinValue7 = GpioPinValue.High;

                        }

                        if (pinValue1 == GpioPinValue.High)
                        {

                            pinValue1 = GpioPinValue.High;
                            pin.Write(pinValue1);

                            pinValue2 = GpioPinValue.Low;
                            pin2.Write(pinValue2);

                            pinValue3 = GpioPinValue.Low;
                            pin3.Write(pinValue3);

                            pinValue4 = GpioPinValue.Low;
                            pin4.Write(pinValue4);

                            pinValue5 = GpioPinValue.Low;
                            pin5.Write(pinValue5);

                            pinValue6 = GpioPinValue.Low;
                            pin6.Write(pinValue6);

                            pinValue7 = GpioPinValue.Low;
                            pin7.Write(pinValue7);

                        }


                        if (pinValue2 == GpioPinValue.High)
                        {

                            pinValue1 = GpioPinValue.Low;
                            pin.Write(pinValue1);

                            pinValue2 = GpioPinValue.High;
                            pin2.Write(pinValue2);

                            pinValue3 = GpioPinValue.Low;
                            pin3.Write(pinValue3);

                            pinValue4 = GpioPinValue.Low;
                            pin4.Write(pinValue4);

                            pinValue5 = GpioPinValue.Low;
                            pin5.Write(pinValue5);

                            pinValue6 = GpioPinValue.Low;
                            pin6.Write(pinValue6);

                            pinValue7 = GpioPinValue.Low;
                            pin7.Write(pinValue7);
                        }

                        if (pinValue3 == GpioPinValue.High)
                        {

                            pinValue1 = GpioPinValue.Low;
                            pin.Write(pinValue1);

                            pinValue2 = GpioPinValue.Low;
                            pin2.Write(pinValue2);

                            pinValue3 = GpioPinValue.High;
                            pin3.Write(pinValue3);

                            pinValue4 = GpioPinValue.Low;
                            pin4.Write(pinValue4);

                            pinValue5 = GpioPinValue.Low;
                            pin5.Write(pinValue5);

                            pinValue6 = GpioPinValue.Low;
                            pin6.Write(pinValue6);

                            pinValue7 = GpioPinValue.Low;
                            pin7.Write(pinValue7);

                        }



                        if (pinValue4 == GpioPinValue.High)
                        {

                            pinValue1 = GpioPinValue.Low;
                            pin.Write(pinValue1);

                            pinValue2 = GpioPinValue.Low;
                            pin2.Write(pinValue2);

                            pinValue3 = GpioPinValue.Low;
                            pin3.Write(pinValue3);

                            pinValue4 = GpioPinValue.High;
                            pin4.Write(pinValue4);

                            pinValue5 = GpioPinValue.Low;
                            pin5.Write(pinValue5);

                            pinValue6 = GpioPinValue.Low;
                            pin6.Write(pinValue6);

                            pinValue7 = GpioPinValue.Low;
                            pin7.Write(pinValue7);
                        }



                        if (pinValue5 == GpioPinValue.High)
                        {

                            pinValue1 = GpioPinValue.Low;
                            pin.Write(pinValue1);

                            pinValue2 = GpioPinValue.Low;
                            pin2.Write(pinValue2);

                            pinValue3 = GpioPinValue.Low;
                            pin3.Write(pinValue3);

                            pinValue4 = GpioPinValue.Low;
                            pin4.Write(pinValue4);

                            pinValue5 = GpioPinValue.High;
                            pin5.Write(pinValue5);

                            pinValue6 = GpioPinValue.Low;
                            pin6.Write(pinValue6);

                            pinValue7 = GpioPinValue.Low;
                            pin7.Write(pinValue7);

                        }



                        if (pinValue6 == GpioPinValue.High)
                        {

                            pinValue1 = GpioPinValue.Low;
                            pin.Write(pinValue1);

                            pinValue2 = GpioPinValue.Low;
                            pin2.Write(pinValue2);

                            pinValue3 = GpioPinValue.Low;
                            pin3.Write(pinValue3);

                            pinValue4 = GpioPinValue.Low;
                            pin4.Write(pinValue4);

                            pinValue5 = GpioPinValue.Low;
                            pin5.Write(pinValue5);

                            pinValue6 = GpioPinValue.High;
                            pin6.Write(pinValue6);

                            pinValue7 = GpioPinValue.Low;
                            pin7.Write(pinValue7);


                        }



                        if (pinValue7 == GpioPinValue.High)
                        {

                            pinValue1 = GpioPinValue.Low;
                            pin.Write(pinValue1);

                            pinValue2 = GpioPinValue.Low;
                            pin2.Write(pinValue2);

                            pinValue3 = GpioPinValue.Low;
                            pin3.Write(pinValue3);

                            pinValue4 = GpioPinValue.Low;
                            pin4.Write(pinValue4);

                            pinValue5 = GpioPinValue.Low;
                            pin5.Write(pinValue5);

                            pinValue6 = GpioPinValue.Low;
                            pin6.Write(pinValue6);

                            pinValue7 = GpioPinValue.High;
                            pin7.Write(pinValue7);


                        }
                        TextBlock1.Text = "NOT Same value!";

                    }
                    else
                    {
                        TextBlock1.Text = "Same value!";
                    }
                          
        }

QuestionHelp getting started Pin
gopreetgo12-Dec-16 4:13
membergopreetgo12-Dec-16 4:13 
AnswerRe: Help getting started Pin
Richard MacCutchan12-Dec-16 5:01
protectorRichard MacCutchan12-Dec-16 5:01 
AnswerMessage Closed Pin
7-Feb-17 19:20
professionaldidinj7-Feb-17 19:20 
AnswerRe: Help getting started Pin
camillebo16-Jun-17 13:32
membercamillebo16-Jun-17 13:32 
SuggestionRe: Help getting started Pin
David Crow16-Jun-17 17:44
memberDavid Crow16-Jun-17 17:44 
QuestionProblem to save to text with rasbperry windows 10 iot uwp? Pin
ken767-Dec-16 7:08
memberken767-Dec-16 7:08 
Questionvery urgent!! Pin
Member 1280041118-Oct-16 4:48
memberMember 1280041118-Oct-16 4:48 
GeneralRe: very urgent!! Pin
Richard MacCutchan18-Oct-16 5:10
protectorRichard MacCutchan18-Oct-16 5:10 
GeneralRe: very urgent!! Pin
Member 1280041118-Oct-16 5:29
memberMember 1280041118-Oct-16 5:29 
AnswerRe: very urgent!! Pin
NotPolitcallyCorrect18-Oct-16 5:59
memberNotPolitcallyCorrect18-Oct-16 5:59 
GeneralRe: very urgent!! Pin
Member 1280041118-Oct-16 6:02
memberMember 1280041118-Oct-16 6:02 
GeneralRe: very urgent!! Pin
Richard MacCutchan18-Oct-16 6:13
protectorRichard MacCutchan18-Oct-16 6:13 
GeneralRe: very urgent!! Pin
NotPolitcallyCorrect18-Oct-16 6:14
memberNotPolitcallyCorrect18-Oct-16 6:14 
GeneralMessage Closed Pin
27-Mar-17 20:27
memberJacquelinelee27-Mar-17 20:27 
JokeRe: very urgent!! Pin
ZurdoDev2-Nov-16 5:29
professionalZurdoDev2-Nov-16 5:29 
AnswerRe: very urgent!! Pin
David Crow18-Oct-16 9:59
memberDavid Crow18-Oct-16 9:59 
AnswerRe: very urgent!! Pin
ZurdoDev2-Nov-16 5:28
professionalZurdoDev2-Nov-16 5:28 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.