Click here to Skip to main content
14,661,016 members
Home » Discussions » Mobile
   

Mobile

 
AnswerRe: BEGINNER NEEDS HELP Pin
Wendelius30-Dec-16 20:58
mveWendelius30-Dec-16 20:58 
AnswerRe: BEGINNER NEEDS HELP Pin
Richard MacCutchan30-Dec-16 21:11
mveRichard MacCutchan30-Dec-16 21:11 
AnswerRe: BEGINNER NEEDS HELP Pin
Member 1459781420-Sep-19 1:22
MemberMember 1459781420-Sep-19 1:22 
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
mveRichard 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
mveRichard MacCutchan12-Dec-16 5:01 
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
mveRichard 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
mveRichard MacCutchan18-Oct-16 6:13 
GeneralRe: very urgent!! Pin
NotPolitcallyCorrect18-Oct-16 6:14
MemberNotPolitcallyCorrect18-Oct-16 6:14 
JokeRe: very urgent!! Pin
ZurdoDev2-Nov-16 5:29
mveZurdoDev2-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
mveZurdoDev2-Nov-16 5:28 
Question5.1 channel in bluetooth audio Pin
Krishnakumartg26-Sep-16 19:32
MemberKrishnakumartg26-Sep-16 19:32 
AnswerRe: 5.1 channel in bluetooth audio Pin
Richard MacCutchan26-Sep-16 20:48
mveRichard MacCutchan26-Sep-16 20:48 

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.