<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Raspberry Pi Pico Archives | Paul Bupe Jr, PhD</title>
	<atom:link href="https://paulbupejr.com/category/tutorials/raspberry-pi-pico/feed/" rel="self" type="application/rss+xml" />
	<link>https://paulbupejr.com/category/tutorials/raspberry-pi-pico/</link>
	<description>Hardware, software, and everything in between</description>
	<lastBuildDate>Fri, 12 Feb 2021 03:01:13 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://paulbupejr.com/wp-content/uploads/2019/07/cropped-paul_logo@2x-32x32.png</url>
	<title>Raspberry Pi Pico Archives | Paul Bupe Jr, PhD</title>
	<link>https://paulbupejr.com/category/tutorials/raspberry-pi-pico/</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Easy Raspberry Pi Pico Microcontroller C / C++ Programming on Windows</title>
		<link>https://paulbupejr.com/raspberry-pi-pico-windows-development/</link>
					<comments>https://paulbupejr.com/raspberry-pi-pico-windows-development/#comments</comments>
		
		<dc:creator><![CDATA[paulbupe]]></dc:creator>
		<pubDate>Tue, 02 Feb 2021 01:06:35 +0000</pubDate>
				<category><![CDATA[Raspberry Pi Pico]]></category>
		<category><![CDATA[C++]]></category>
		<category><![CDATA[encoder]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[pico pio]]></category>
		<category><![CDATA[raspberry pi pico]]></category>
		<category><![CDATA[visual studio code]]></category>
		<guid isPermaLink="false">http://paulbupejr.com/?p=734</guid>

					<description><![CDATA[<p><span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 6</span> <span class="rt-label rt-postfix">minutes</span></span>This tutorial covers setting up a pretty painless Raspberry Pi Pico C / C++ SDK development workflow on Windows using the Windows Subsystem for Linux (WSL) and Visual Studio Code (VS Code) with IntelliSense code completion! With the Raspberry Pi Pico microcontroller being so new the current C / C++ SDK development process on Windows &#8230; <a href="https://paulbupejr.com/raspberry-pi-pico-windows-development/" class="more-link">Continue reading <span class="screen-reader-text">Easy Raspberry Pi Pico Microcontroller C / C++ Programming on Windows</span></a></p>
<p>The post <a href="https://paulbupejr.com/raspberry-pi-pico-windows-development/">Easy Raspberry Pi Pico Microcontroller C / C++ Programming on Windows</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></description>
										<content:encoded><![CDATA[<span class="span-reading-time rt-reading-time" style="display: block;"><span class="rt-label rt-prefix">Reading Time: </span> <span class="rt-time"> 6</span> <span class="rt-label rt-postfix">minutes</span></span>
<p>This tutorial covers setting up a pretty painless Raspberry Pi Pico C / C++ SDK development workflow on Windows using the Windows Subsystem for Linux (WSL) and Visual Studio Code (VS Code) with IntelliSense code completion!  </p>



<p>With the Raspberry Pi Pico microcontroller being so new the current C / C++ SDK development process on Windows <a href="https://datasheets.raspberrypi.org/pico/getting-started-with-pico.pdf" target="_blank" rel="noreferrer noopener">is a bit cumbersome</a>. This tutorial should hopefully give you some ideas on how to go about programming the Raspberry Pi Pico the easy way with WSL and VS Code.</p>



<p><strong><em>Note: This is not a beginner tutorial and assumes some minimal development experience.</em></strong></p>



<span id="more-734"></span>



<p>The Raspberry Pi Pico is an exciting new microcontroller board <a href="https://www.raspberrypi.org/blog/raspberry-pi-silicon-pico-now-on-sale/" target="_blank" rel="noreferrer noopener">launched on January 21, 2021</a>. It&#8217;s based on the RP2040 microcontroller (by the Raspberry Pi Foundation) sporting a <strong>dual-core</strong> ARM Cortex-M0+ running at 133 MHz. The most exciting feature is the Programmable I/O, or PIO, that has 8 independent processors (simple state machines). This is huge for robotics where there&#8217;s a need to ingest real-time sensor data in the background while performing other tasks. <em>Keep an eye out for my tutorial on reading multiple DC motor quadrature encoders at the same time without messing with lots of timers and interrupts using the PIO!</em></p>



<h2 class="wp-block-heading">Prerequisites</h2>



<ol class="wp-block-list"><li>Enable <a href="https://docs.microsoft.com/windows/wsl/install-win10" target="_blank" rel="noreferrer noopener"><strong>Windows Subsystem for Linux</strong></a> and install the latest Ubuntu image (20); follow the &#8220;Manual Installation&#8221; steps. WSL is a built-in feature of Windows 10 and brings most of the power of developing on a Linux machine natively into Windows! Be sure to install Windows Terminal for an even better experience (instructions towards the end of the link above). </li><li>Install <strong><a href="https://code.visualstudio.com/download" target="_blank" rel="noreferrer noopener">Visual Studio Code</a></strong> and install the following extensions:<a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-wsl" target="_blank" rel="noreferrer noopener"> Remote &#8211; WSL</a>, <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cpptools" target="_blank" rel="noreferrer noopener">C/C++</a>, and <a href="https://marketplace.visualstudio.com/items?itemName=ms-vscode.cmake-tools" target="_blank" rel="noreferrer noopener">CMake Tools</a>. You can search for these extensions by name directly in VS Code. </li></ol>



<h2 class="wp-block-heading" id="configurewsl">Configure WSL</h2>



<h5 class="wp-block-heading">Setup Script</h5>



<p>If you are in a bit of a rush I&#8217;ve created a setup script that will perform all the WSL configuration tasks for you. Just open up WSL, run the following commands, then <a href="#configurecode">skip to setting up Visual Studio Code</a>! </p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd ~
git clone https://github.com/74ls04/pico-wsl-setup.git
cd pico-wsl-setup
./pico_wsl_setup.sh</pre></div>



<p><strong>This script will install the SDK in <code>~/pico</code></strong> and also installs a few Pico extras from the Raspberry Pi Pico repos. </p>



<h5 class="wp-block-heading">Install Dependencies</h5>



<p><em>Note: I&#8217;m using Ubuntu 18 for this demo but if you&#8217;re starting from scratch use 20 to avoid issues with CMake compatibility.</em></p>



<p>First, open up the WSL Ubuntu terminal and go to the home directory.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd ~</pre></div>



<p> Then install the required build dependencies </p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">sudo apt update
sudo apt install git cmake gcc-arm-none-eabi libnewlib-arm-none-eabi build-essential</pre></div>



<p>That&#8217;s all there is for dependencies!</p>



<h5 class="wp-block-heading" id="sdkinstall">Install the Raspberry Pi Pico C / C++ SDK</h5>



<p>While still in the home directory create a directory called <code>pico</code> and go into the <code>pico</code> directory</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">mkdir pico
cd pico</pre></div>



<p>After that clone the SDK and examples git repositories.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">git clone -b master https://github.com/raspberrypi/pico-sdk.git
cd pico-sdk
git submodule update --init
cd ..
git clone -b master https://github.com/raspberrypi/pico-examples.git</pre></div>



<p><em>The <code>git submodule</code> command basically pulls in a separate Raspberry Pi repository from <code>https://github.com/raspberrypi/tinyusb.git</code> and downloads those files.</em></p>



<p>Here is what all the commands look like after execution.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img fetchpriority="high" decoding="async" width="906" height="575" src="https://paulbupejr.com/wp-content/uploads/2021/01/sdk_install.png" alt="Raspberry Pi Pico Toolchain" class="wp-image-750" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/sdk_install.png 906w, https://paulbupejr.com/wp-content/uploads/2021/01/sdk_install-300x190.png 300w, https://paulbupejr.com/wp-content/uploads/2021/01/sdk_install-768x487.png 768w" sizes="(max-width: 906px) 100vw, 906px" /></figure></div>



<h2 class="wp-block-heading" id="configurecode">Configure and Build with Visual Studio Code</h2>



<p>Now we&#8217;re going to configure VS Code and build the following &#8220;blink&#8221; example. </p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;clike&quot;,&quot;mime&quot;:&quot;text/x-c++src&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;C++&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;cpp&quot;}">#include &quot;pico/stdlib.h&quot;

int main() {
    const uint LED_PIN = 25;
    gpio_init(LED_PIN);
    gpio_set_dir(LED_PIN, GPIO_OUT);
    while (true) {
        gpio_put(LED_PIN, 1);
        sleep_ms(250);
        gpio_put(LED_PIN, 0);
        sleep_ms(250);
    }
}</pre></div>



<p>So far you should have the following directories:</p>



<pre class="wp-block-code"><code>~/pico
~/pico/pico-sdk
~/pico/pico-examples</code></pre>



<p>Move into the <code>pico-examples</code> directory</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">cd pico-examples</pre></div>



<p>Now here is where the integration of VS Code and WSL really shines. Open VS Code into this directory </p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">code .</pre></div>



<p>This command will launch VS Code and automatically link it to the WSL instance. You should see a green connection label in the bottom left. This process also creates a hidden .vscode sub-directory that will hold the VS Code configuration for this workspace.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img decoding="async" width="584" height="63" src="https://paulbupejr.com/wp-content/uploads/2021/01/green-connected.png" alt="" class="wp-image-751" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/green-connected.png 584w, https://paulbupejr.com/wp-content/uploads/2021/01/green-connected-300x32.png 300w" sizes="(max-width: 584px) 100vw, 584px" /></figure></div>



<p></p>



<p>If this is your first time using VS Code with WSL <a href="https://code.visualstudio.com/docs/remote/wsl#_managing-extensions" target="_blank" rel="noreferrer noopener">follow these quick instructions</a> to make sure the three extensions mentioned at the top are also installed in WSL. At this point you may see a notification asking if you would like to configure the project &#8212; click on &#8220;Not now&#8221; as we need to set up a few things first.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img decoding="async" width="582" height="207" src="https://paulbupejr.com/wp-content/uploads/2021/01/configure_project.png" alt="" class="wp-image-752" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/configure_project.png 582w, https://paulbupejr.com/wp-content/uploads/2021/01/configure_project-300x107.png 300w" sizes="(max-width: 582px) 100vw, 582px" /></figure></div>



<h5 class="wp-block-heading">Configure CMake Extension</h5>



<p>Click the gear icon in the bottom left and select <code>Settings</code>.</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="1024" height="390" src="https://paulbupejr.com/wp-content/uploads/2021/01/settings.png" alt="" class="wp-image-753" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/settings.png 1024w, https://paulbupejr.com/wp-content/uploads/2021/01/settings-300x114.png 300w, https://paulbupejr.com/wp-content/uploads/2021/01/settings-768x293.png 768w" sizes="auto, (max-width: 1024px) 100vw, 1024px" /></figure></div>



<p></p>



<p>Expand the Extensions tree, select CMake Tools configuration, and then click <code>Add Item</code> under &#8220;<em>Cmake: Build Environment</em>&#8221; to add the SDK path as shown below. If you followed the directory structure in this tutorial your <code>PICO_SDK_PATH</code> will be <code>/home/$USER/pico/pico-sdk</code> where <strong><span class="has-inline-color has-medium-pink-color">$USER is your WSL username</span></strong>. In this case my tutorial username is &#8220;main.&#8221;</p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="844" height="530" src="https://paulbupejr.com/wp-content/uploads/2021/01/sdk_path.png" alt="Raspberry Pi Pico SDK Path" class="wp-image-754" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/sdk_path.png 844w, https://paulbupejr.com/wp-content/uploads/2021/01/sdk_path-300x188.png 300w, https://paulbupejr.com/wp-content/uploads/2021/01/sdk_path-768x482.png 768w" sizes="auto, (max-width: 844px) 100vw, 844px" /></figure></div>



<h5 class="wp-block-heading">Configure IntelliSense (Code Completions)</h5>



<p>Open the Command Palette, <code><span class="has-inline-color has-medium-pink-color">Ctrl+Shift+P</span></code>, and start typing &#8220;C/C++&#8221; then select <strong>C/C++: Edit Configurations (JSON)</strong>. </p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="890" height="363" src="https://paulbupejr.com/wp-content/uploads/2021/01/cpp.png" alt="" class="wp-image-756" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/cpp.png 890w, https://paulbupejr.com/wp-content/uploads/2021/01/cpp-300x122.png 300w, https://paulbupejr.com/wp-content/uploads/2021/01/cpp-768x313.png 768w" sizes="auto, (max-width: 890px) 100vw, 890px" /></figure></div>



<p>This will create the following file: </p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}"> /home/$USER/pico/pico-examples/.vscode/c_cpp_properties.json</pre></div>



<p>Change the file to match the following settings. <strong>Keep in mind that these settings are purely for code-completion and have nothing to do with the actual compiling</strong>.</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;javascript&quot;,&quot;mime&quot;:&quot;application/json&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;JSON&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;json&quot;}">{
    &quot;configurations&quot;: [
        {
            &quot;name&quot;: &quot;Linux&quot;,
            &quot;includePath&quot;: [
                &quot;${workspaceFolder}/**&quot;,
                &quot;/home/$USER/projects/pico/pico-sdk/**&quot;,
                &quot;/usr/lib/gcc/arm-none-eabi/**&quot;
            ],
            &quot;defines&quot;: [],
            &quot;compilerPath&quot;: &quot;arm-none-eabi-gcc&quot;,
            &quot;cStandard&quot;: &quot;c11&quot;,
            &quot;cppStandard&quot;: &quot;c++17&quot;,
            &quot;intelliSenseMode&quot;: &quot;gcc-arm&quot;,
            &quot;configurationProvider&quot;: &quot;ms-vscode.cmake-tools&quot;
        }
    ],
    &quot;version&quot;: 4
}</pre></div>



<p class="has-text-align-center"><span class="has-inline-color has-medium-pink-color"><strong>Replace $USER with your WSL username under &#8220;includePath&#8221;!</strong></span></p>



<div class="wp-block-image"><figure class="aligncenter size-full"><img loading="lazy" decoding="async" width="947" height="523" src="https://paulbupejr.com/wp-content/uploads/2021/01/completion_settings.png" alt="Raspberry Pi Pico Intellisense" class="wp-image-755" srcset="https://paulbupejr.com/wp-content/uploads/2021/01/completion_settings.png 947w, https://paulbupejr.com/wp-content/uploads/2021/01/completion_settings-300x166.png 300w, https://paulbupejr.com/wp-content/uploads/2021/01/completion_settings-768x424.png 768w" sizes="auto, (max-width: 947px) 100vw, 947px" /></figure></div>



<p></p>



<p>Close VS Code and relaunch it again from the terminal with</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">code .</pre></div>



<p>This time when CMake asks whether you&#8217;d like to configure the project select &#8220;Yes&#8221; and wait for it to finish configuring.</p>



<h5 class="wp-block-heading">Configure Compiler and Build</h5>



<p>Tell VS Code which compiler to use by clicking the &#8220;<em>No Kit Selected</em>&#8221; text at the bottom </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="671" height="37" src="https://paulbupejr.com/wp-content/uploads/2021/02/compiler-sel.png" alt="Raspberry Pi Pico Compiler Select" class="wp-image-768" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/compiler-sel.png 671w, https://paulbupejr.com/wp-content/uploads/2021/02/compiler-sel-300x17.png 300w" sizes="auto, (max-width: 671px) 100vw, 671px" /></figure></div>



<p>Then selecting <code>GCC for arm-none-eabi...</code> If using Ubuntu 20 your compiler version will be different since I&#8217;m using 18. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="724" height="405" src="https://paulbupejr.com/wp-content/uploads/2021/02/compiler.png" alt="Raspberry Pi Pico Compiler Menu" class="wp-image-769" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/compiler.png 724w, https://paulbupejr.com/wp-content/uploads/2021/02/compiler-300x168.png 300w" sizes="auto, (max-width: 724px) 100vw, 724px" /></figure>



<p></p>



<p>Open up the &#8220;blink.c&#8221; example file using the explorer menu on the left, <code><span class="has-inline-color has-medium-pink-color">CTRL+SHIFT+E</span></code>. You should see no errors highlighted in the file and code hints should be working as well. </p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="694" height="425" src="https://paulbupejr.com/wp-content/uploads/2021/02/codehint.png" alt="Raspberry Pi Pico Code Completion" class="wp-image-770" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/codehint.png 694w, https://paulbupejr.com/wp-content/uploads/2021/02/codehint-300x184.png 300w" sizes="auto, (max-width: 694px) 100vw, 694px" /></figure>



<p></p>



<p>Tell CMake which project to build by clicking on <code>[all]</code> at the bottom</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="671" height="37" src="https://paulbupejr.com/wp-content/uploads/2021/02/build-sel.png" alt="Raspberry Pi Pico Project Select" class="wp-image-771" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/build-sel.png 671w, https://paulbupejr.com/wp-content/uploads/2021/02/build-sel-300x17.png 300w" sizes="auto, (max-width: 671px) 100vw, 671px" /></figure>



<p></p>



<p>Then scroll until you see &#8220;blink.&#8221;</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="667" height="432" src="https://paulbupejr.com/wp-content/uploads/2021/02/project-sel.png" alt="Raspberry Pi Pico Project Select Menu" class="wp-image-772" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/project-sel.png 667w, https://paulbupejr.com/wp-content/uploads/2021/02/project-sel-300x194.png 300w" sizes="auto, (max-width: 667px) 100vw, 667px" /></figure>



<p></p>



<p>You should now see <code>[blink]</code> instead of <code>[all]</code>. Click on &#8220;Build&#8221; to build the project!</p>



<figure class="wp-block-image size-large"><img loading="lazy" decoding="async" width="757" height="37" src="https://paulbupejr.com/wp-content/uploads/2021/02/build.png" alt="Raspberry Pi Pico Build Select" class="wp-image-774" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/build.png 757w, https://paulbupejr.com/wp-content/uploads/2021/02/build-300x15.png 300w" sizes="auto, (max-width: 757px) 100vw, 757px" /></figure>



<p></p>



<p>VS Code will automatically create a build directory and spit out the project binaries into that directory. </p>



<div class="wp-block-image"><figure class="aligncenter size-large"><img loading="lazy" decoding="async" width="720" height="464" src="https://paulbupejr.com/wp-content/uploads/2021/02/build-done.png" alt="Raspberry Pi Pico Build" class="wp-image-775" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/build-done.png 720w, https://paulbupejr.com/wp-content/uploads/2021/02/build-done-300x193.png 300w" sizes="auto, (max-width: 720px) 100vw, 720px" /></figure></div>



<p><em>Keep in mind this built the debug configuration, you can change it to release by clicking on <code>CMake: [Debug]: Ready</code> at the bottom.</em></p>



<h5 class="wp-block-heading">Upload to Raspberry Pi Pico</h5>



<p>Uploading the binary to the Pico is just a matter of dragging the <code>.uf2</code> file into the folder that opens when you plug in the Pico while holding down the <code>BOOTSEL</code> button.</p>



<p>The file to transfer is:</p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">/home/main/pico/pico-examples/build/blink/blink.uf2</pre></div>



<p>To open the directory you can either right clock on the directory name in VS Code then click &#8220;Reveal in Explorer&#8221; or just type </p>



<div class="wp-block-codemirror-blocks-code-block code-block"><pre class="CodeMirror" data-setting="{&quot;showPanel&quot;:false,&quot;languageLabel&quot;:false,&quot;fullScreenButton&quot;:true,&quot;copyButton&quot;:true,&quot;mode&quot;:&quot;shell&quot;,&quot;mime&quot;:&quot;text/x-sh&quot;,&quot;theme&quot;:&quot;cobalt&quot;,&quot;lineNumbers&quot;:false,&quot;styleActiveLine&quot;:false,&quot;lineWrapping&quot;:false,&quot;readOnly&quot;:true,&quot;fileName&quot;:&quot;&quot;,&quot;language&quot;:&quot;Shell&quot;,&quot;maxHeight&quot;:&quot;400px&quot;,&quot;modeName&quot;:&quot;shell&quot;}">explorer.exe .</pre></div>



<p>in the WSL terminal to open that directory in Windows Explorer. <em>That&#8217;s one of the most useful WSL commands!</em></p>



<p>Plug in the Raspberry Pi Pico while holding down the <code>BOOTSEL</code> button and then drag over the <code>.uf2</code> file to the Pico folder. </p>



<figure class="wp-block-image size-full is-resized"><img loading="lazy" decoding="async" src="https://paulbupejr.com/wp-content/uploads/2021/02/transfer.png" alt="Raspberry Pi Pico Upload" class="wp-image-776" width="728" height="331" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/transfer.png 970w, https://paulbupejr.com/wp-content/uploads/2021/02/transfer-300x136.png 300w, https://paulbupejr.com/wp-content/uploads/2021/02/transfer-768x349.png 768w" sizes="auto, (max-width: 728px) 100vw, 728px" /></figure>



<p>It will automatically disconnect after transferring and immediately start running the program! </p>



<div class="wp-block-image"><figure class="aligncenter size-large is-resized"><img loading="lazy" decoding="async" src="https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-1024x696.jpg" alt="Raspberry Pi Pico" class="wp-image-781" width="512" height="348" srcset="https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-1024x696.jpg 1024w, https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-300x204.jpg 300w, https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-768x522.jpg 768w, https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-1536x1044.jpg 1536w, https://paulbupejr.com/wp-content/uploads/2021/02/pico-2-2048x1392.jpg 2048w" sizes="auto, (max-width: 512px) 100vw, 512px" /></figure></div>



<p>It&#8217;s also pretty easy to configure VS Code to automatically move the file after building but for the sake of keeping this short I&#8217;ll save that for another time.</p>



<h2 class="wp-block-heading">More to come!</h2>



<p>This should hopefully give you an idea of how the current development process is for the Raspberry Pi Pico. My goal is to create another robotics-focused Pico tutorial in the coming months starting from scratch and using the PIO &#8212; maybe in conjunction with a <a href="https://paulbupejr.com/raspberry-pi-serial-console/">Raspberry</a> <a href="https://paulbupejr.com/autonomous-robot-design/">Pi</a>!</p>



<p>Feel free to ask any questions or offer suggestions in the comments!</p>



<p>Updated: 2/11/2021</p>
<p>The post <a href="https://paulbupejr.com/raspberry-pi-pico-windows-development/">Easy Raspberry Pi Pico Microcontroller C / C++ Programming on Windows</a> appeared first on <a href="https://paulbupejr.com">Paul Bupe Jr, PhD</a>.</p>
]]></content:encoded>
					
					<wfw:commentRss>https://paulbupejr.com/raspberry-pi-pico-windows-development/feed/</wfw:commentRss>
			<slash:comments>28</slash:comments>
		
		
			</item>
	</channel>
</rss>

<!--
Performance optimized by W3 Total Cache. Learn more: https://www.boldgrid.com/w3-total-cache/?utm_source=w3tc&utm_medium=footer_comment&utm_campaign=free_plugin

Page Caching using Disk: Enhanced 
Lazy Loading (feed)

Served from: paulbupejr.com @ 2026-04-15 13:15:46 by W3 Total Cache
-->