read, connect, share

9/7/2019

How to change from red, to green and blink the blue led on the Azure Sphere MT3620 starter kit. 

  • Azure Starter Kit
  • Microsoft Visual Studio
  • Watch YouTube Video (recommended for connection)
  • GitHub files
  • or Azure Blink Template
Bits4Bots, LLC - The STEAM Shop

Author

Larsha Johnson
Electrical Engineering

undergraduate at the University of

South Florida.
She enjoys designing electronic

circuits (KiCad & NI Multisim),

blogging, and creating  Youtube


 tutorials.

Photos credit: Bits4Bots LLC. Azure Sphere Starter Kit

So, the correlation to the RBG pins are 8, 9 , and 10. This change must be made in first the header of the .C file and the .C file itself.

Picture

This is assuming you already have your board in azsphere device prep-debug mode in the CMD window.
******************************************************If you are looking for an easy way to get going with the starter kit you're in luck! I recently started playing with the kit myself and was successful in the HelloWorld blink test. In the Azure sample code the GPIO color choice is red of the RBG.
There is also a YouTube video by Hackster that shows the code for GPIO 9, which is the green of the RBG. Today my friend you will have the information to blink the blue of the RBG, GPIO 10. 

View my profile on LinkedIn

App_manifest.json

​{
  "SchemaVersion": 1,
  "Name" : "AzureSphereBlink1",
  "ComponentId" : "dafede3f-b746-46ce-xxxx-xxxxxxxxxxx", //blocked out my personal info
  "EntryPoint": "/bin/app",
  "CmdArgs": [ ],
  "Capabilities": {
    "AllowedConnections": [ ],
    "Gpio": [ 10 ],
    "Uart": [ ],
    "WifiConfig": false
  },
  "ApplicationType":"Default"
}

Picture

Guest blogger wanted!
Email bits4bots@gmail.com

Main.c

​#include <stdbool.h>
#include <errno.h>
#include <string.h>
#include <time.h>

#include <applibs/log.h>
#include <applibs/gpio.h>

int main(void)
{
    //Inspired by GitHub Azure Sphere Samples designed by Bits4Bots LLC  
//This minimal Azure Sphere app repeatedly toggles GPIO 10, which is the blue channel of RGB
    // LED 1 on the MT3620 RDB.
    // Use this app to test that device and SDK installation succeeded that you can build,
    // deploy, and debug an app with Visual Studio, and that you can deploy an app over the air,
    // per the instructions here: https://docs.microsoft.com/azure-sphere/quickstarts/qs-overview
    //
    // It is NOT recommended to use this as a starting point for developing apps; instead use
    // the extensible samples here: https://github.com/Azure/azure-sphere-samples
    Log_Debug(
        "\nVisit https://github.com/Azure/azure-sphere-samples for extensible samples to use as a "
        "starting point for full applications.\n");

    int fd = GPIO_OpenAsOutput(10, GPIO_OutputMode_PushPull, GPIO_Value_High);
    if (fd < 0) {
        Log_Debug(
            "Error opening GPIO: %s (%d). Check that app_manifest.json includes the GPIO used.\n",
            strerror(errno), errno);
        return -1;
    }

    const struct timespec sleepTime = {1, 0};
    while (true) {
        GPIO_SetValue(fd, GPIO_Value_Low);
        nanosleep(&sleepTime, NULL);
        GPIO_SetValue(fd, GPIO_Value_High);
        nanosleep(&sleepTime, NULL);
    }
}

Categories

Newest hobby: Insanely complex PCB outlines.

Picture
A photo on Flickr
gallery/uploads-2-9-7-6-29765689-151698_orig

I hope you found this tutorial useful. All of the information on this site is licensed under the creative commons. Share and share alike. Please gives us a mention or share our page with a friend. Thanks.

How would you implement the built-in sensors & leds in your design. How do you feel about cryptography? About 5G? 

https://cdn2.editmysite.com/images/old/bg_feed
  • Only a wise person can solve a difficult problem. ~ Akan proverb

Student Engineers

* Indicates required field

Engineering Field of Interest *

Topic of Interest *

How did you hear about this site? *

Internet Search

Advertisment

Friend

Other

chat, talk, subscribe, buzz