<?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 | Learn C Games Programming Blog</title>
	<atom:link href="https://learncgames.com/category/raspberry-pi/feed/" rel="self" type="application/rss+xml" />
	<link>https://learncgames.com</link>
	<description>A blog about C, programming games and my ebook(s).</description>
	<lastBuildDate>Fri, 13 Jun 2025 15:05:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://learncgames.com/wp-content/uploads/2020/03/cropped-favicon-32x32.png</url>
	<title>raspberry-pi | Learn C Games Programming Blog</title>
	<link>https://learncgames.com</link>
	<width>32</width>
	<height>32</height>
</image> 
<site xmlns="com-wordpress:feed-additions:1">181446779</site>	<item>
		<title>Ever do a sudo apt update on your Raspberry Pi?</title>
		<link>https://learncgames.com/ever-do-a-sudo-apt-update-on-your-raspberry-pi/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ever-do-a-sudo-apt-update-on-your-raspberry-pi</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Fri, 13 Jun 2025 15:04:05 +0000</pubDate>
				<category><![CDATA[Errors]]></category>
		<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[hardware clock]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3435</guid>

					<description><![CDATA[<p>&#160; &#160; &#160; &#160; And you get this error message?  It says E: Release file for http://archive.raspberrypi.com/debian/dists/bookworm/InRelease is not valid yet (invalid for another 10h 37min 50s). Updates for this repository will not be applied. E: Release file for http://deb.debian.org/debian/dists/bookworm-updates/InRelease is not valid yet (invalid for another 12h 15min 47s). Updates for this repository will [&#8230;]</p>
The post <a href="https://learncgames.com/ever-do-a-sudo-apt-update-on-your-raspberry-pi/">Ever do a sudo apt update on your Raspberry Pi?</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img fetchpriority="high" decoding="async" class="alignleft size-full wp-image-3436" src="https://learncgames.com/wp-content/uploads/2025/06/update.png" alt="sudo apt update error message" width="681" height="203" srcset="https://learncgames.com/wp-content/uploads/2025/06/update.png 681w, https://learncgames.com/wp-content/uploads/2025/06/update-300x89.png 300w" sizes="(max-width: 681px) 100vw, 681px" /></p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>And you get this error message?  It says</p>
<pre>E: Release file for http://archive.raspberrypi.com/debian/dists/bookworm/InRelease is not valid yet 
(invalid for another 10h 37min 50s). Updates for this repository will not be applied.
E: Release file for http://deb.debian.org/debian/dists/bookworm-updates/InRelease is not valid yet 
(invalid for another 12h 15min 47s). Updates for this repository will not be applied.</pre>
<p>If you do</p>
<pre>sudo hwclock -s</pre>
<p>It will fix it. Apparently it&#8217;s to do with the hardware clock having drifted and I&#8217;m guessing this causes an error condition. Still, its an easy fix!</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/ever-do-a-sudo-apt-update-on-your-raspberry-pi/">Ever do a sudo apt update on your Raspberry Pi?</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3435</post-id>	</item>
		<item>
		<title>Setting up SDL3 on Linux</title>
		<link>https://learncgames.com/setting-up-sdl3-on-linux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=setting-up-sdl3-on-linux</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Mon, 26 May 2025 15:02:41 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[SDL]]></category>
		<category><![CDATA[Techniques]]></category>
		<category><![CDATA[SDL3 on Linux]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3420</guid>

					<description><![CDATA[<p>I knew it wasn&#8217;t going to be easy, but it turned out to be quite a bit more difficult than I thought. The problem is, unlike SDL2, there are no dev versions of SDL3 etc. yet, so you have to build it from scratch. I&#8217;ll be honest, I&#8217;m not sure I could have done it [&#8230;]</p>
The post <a href="https://learncgames.com/setting-up-sdl3-on-linux/">Setting up SDL3 on Linux</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><script type='application/json' class='__iawmlf-post-loop-links'>[{"id":17,"href":"https:\/\/github.com\/Ravbug\/sdl3-sample","archived_href":"http:\/\/web-wp.archive.org\/web\/20260112022859\/https:\/\/github.com\/Ravbug\/sdl3-sample","redirect_href":"","checks":[{"date":"2026-02-06 10:35:54","http_code":206},{"date":"2026-02-09 18:04:10","http_code":206},{"date":"2026-02-12 22:36:31","http_code":206},{"date":"2026-02-15 23:18:57","http_code":206},{"date":"2026-02-19 00:34:59","http_code":206},{"date":"2026-02-22 04:11:10","http_code":206},{"date":"2026-02-25 10:07:15","http_code":206},{"date":"2026-02-28 10:09:57","http_code":206},{"date":"2026-03-03 12:37:49","http_code":206},{"date":"2026-03-06 17:22:24","http_code":206},{"date":"2026-03-09 18:51:13","http_code":206},{"date":"2026-03-12 20:26:12","http_code":206},{"date":"2026-03-15 21:57:49","http_code":206},{"date":"2026-03-19 06:22:42","http_code":206},{"date":"2026-03-22 08:22:09","http_code":206},{"date":"2026-03-25 10:53:16","http_code":206},{"date":"2026-03-28 10:54:10","http_code":206},{"date":"2026-03-31 11:05:13","http_code":206},{"date":"2026-04-03 11:05:44","http_code":206},{"date":"2026-04-06 11:57:00","http_code":206},{"date":"2026-04-09 12:21:08","http_code":404},{"date":"2026-04-12 12:50:11","http_code":206},{"date":"2026-04-15 13:16:11","http_code":206},{"date":"2026-04-18 19:14:35","http_code":206},{"date":"2026-04-21 20:49:12","http_code":206},{"date":"2026-04-25 03:40:29","http_code":206},{"date":"2026-04-28 06:36:36","http_code":206},{"date":"2026-05-01 06:37:36","http_code":206},{"date":"2026-05-04 13:17:02","http_code":206},{"date":"2026-05-08 00:43:05","http_code":206}],"broken":false,"last_checked":{"date":"2026-05-08 00:43:05","http_code":206},"process":"done"},{"id":18,"href":"https:\/\/github.com\/Ravbug\/sdl3-sample\/wiki\/Setting-up-your-computer","archived_href":"http:\/\/web-wp.archive.org\/web\/20250505154154\/https:\/\/github.com\/Ravbug\/sdl3-sample\/wiki\/Setting-up-your-computer","redirect_href":"","checks":[{"date":"2026-02-06 10:35:56","http_code":206},{"date":"2026-02-09 18:04:10","http_code":206},{"date":"2026-02-12 22:36:31","http_code":206},{"date":"2026-02-15 23:18:57","http_code":206},{"date":"2026-02-19 00:35:04","http_code":206},{"date":"2026-02-22 04:11:09","http_code":206},{"date":"2026-02-25 10:07:15","http_code":206},{"date":"2026-02-28 10:09:57","http_code":206},{"date":"2026-03-03 12:37:48","http_code":206},{"date":"2026-03-06 17:22:24","http_code":206},{"date":"2026-03-09 18:51:14","http_code":206},{"date":"2026-03-12 20:26:12","http_code":206},{"date":"2026-03-15 21:57:49","http_code":206},{"date":"2026-03-19 06:22:43","http_code":206},{"date":"2026-03-22 08:22:09","http_code":206},{"date":"2026-03-25 10:53:18","http_code":206},{"date":"2026-03-28 10:54:09","http_code":206},{"date":"2026-03-31 11:05:24","http_code":206},{"date":"2026-04-03 15:25:51","http_code":206},{"date":"2026-04-06 15:37:45","http_code":206},{"date":"2026-04-09 19:09:51","http_code":404},{"date":"2026-04-12 20:24:37","http_code":206},{"date":"2026-04-15 20:58:34","http_code":206},{"date":"2026-04-19 01:38:24","http_code":206},{"date":"2026-04-22 11:41:16","http_code":206},{"date":"2026-04-25 12:34:43","http_code":206},{"date":"2026-04-28 13:01:47","http_code":206},{"date":"2026-05-01 16:17:46","http_code":206},{"date":"2026-05-04 17:44:18","http_code":206},{"date":"2026-05-08 06:01:46","http_code":206}],"broken":false,"last_checked":{"date":"2026-05-08 06:01:46","http_code":206},"process":"done"}]</script><img decoding="async" class="alignleft size-full wp-image-3421" src="https://learncgames.com/wp-content/uploads/2025/05/sdl3-1.png" alt="SDL3 program running on Raspberry Pi." width="550" height="514" srcset="https://learncgames.com/wp-content/uploads/2025/05/sdl3-1.png 550w, https://learncgames.com/wp-content/uploads/2025/05/sdl3-1-300x280.png 300w" sizes="(max-width: 550px) 100vw, 550px" /></p>
<p>I knew it wasn&#8217;t going to be easy, but it turned out to be quite a bit more difficult than I thought.</p>
<p>The problem is, unlike SDL2, there are no dev versions of SDL3 etc. yet, so you have to build it from scratch.</p>
<p>I&#8217;ll be honest, I&#8217;m not sure I could have done it without this <a title="Link to Ravbug's Setting up SDL3 sample on GitHub" href="https://github.com/Ravbug/sdl3-sample" target="_blank" rel="noopener">GitHub repository</a>. User <em>Ravbug</em> who is very busy person (<em>752 contributions on GitHub in the last year- I tip my hat to him or her!</em>) who provided that repository.</p>
<p>It sets up SDL3, SDL_image, sdl_mixer and SDL_ttf.</p>
<p>Follow his link to the <a title="Ravbug's instructions" href="https://github.com/Ravbug/sdl3-sample/wiki/Setting-up-your-computer" target="_blank" rel="noopener">Wiki page</a> Scroll down to the bottom for the Linux instructions. I can confirm that it works on Raspberry Pi as well.  You&#8217;ll need to install cmake first with</p>
<pre>sudo apt install cmake</pre>
<p>Then run his cmake to build everything and go for a coffee.<br />
Now go into the build folder under sdl3-sample and do</p>
<pre>make</pre>
<p>That only takes a second or so.</p>
<p>After you&#8217;ve done that you&#8217;ll end up with a load of files including an executable sdl-min that you can run. That&#8217;s what generated the Tiger&#8217;s head &#8211; it plays The Sting film&#8217;s theme (The Entertainer) music as well demonstrating that it&#8217;s using SDL_mixer as well as SDL3 and SDL_ttf (<em>I&#8217;m guessing</em>) and of course SDL_image.</p>
<h3>But that is just the start</h3>
<p>To use SDL3 etc in your C program, you need a bit more configuration than with SDL2. I&#8217;m in uncharted waters here but used an AI- Claude 4 to help me get through and it did.</p>
<p>The problem is you have to tell VS Code where the header files are located, the .so files and also the executable needs to know at runtime.</p>
<p>I set up Ravbug&#8217;s sdl3_sample in my home folder so all paths start <strong>/home/david/sdl3-sample. </strong></p>
<p>This is my tasks.json</p>
<p>&nbsp;</p>
<pre><code class="language-json" data-line="">{
    &quot;version&quot;: &quot;2.0.0&quot;,
    &quot;tasks&quot;: [
        {
            &quot;type&quot;: &quot;shell&quot;,
            &quot;label&quot;: &quot;clang-14.0 build active file&quot;,
            &quot;command&quot;: &quot;/usr/bin/clang-14&quot;,
            &quot;args&quot;: [
                &quot;-I/home/david/sdl3-sample/SDL/include&quot;,
                &quot;-I/home/david/sdl3-sample/SDL_image/include&quot;, 
                &quot;-I/home/david/sdl3-sample/SDL_mixer/include&quot;,
                &quot;-I/home/david/sdl3-sample/SDL_ttf/include&quot;,
                &quot;-g&quot;,
                &quot;${file}&quot;,&quot;${workspaceFolder}/hr_time.c&quot;,
                &quot;-L/home/david/sdl3-sample/build&quot;,	
                &quot;-Wl,-rpath,/home/david/sdl3-sample/build&quot;,				
                &quot;-o&quot;,
                &quot;${fileDirname}/${fileBasenameNoExtension}&quot;,
                &quot;-lSDL3&quot;,
                &quot;-lSDL3_image&quot;, 
                &quot;-lSDL3_ttf&quot;   

            ],
            &quot;options&quot;: {
                &quot;cwd&quot;: &quot;/usr/bin&quot;
            },
            &quot;group&quot;: {
                &quot;kind&quot;: &quot;build&quot;,
                &quot;isDefault&quot;: true
            }
        }
    ]
}</code></pre>
<p>The lines that are SDL3 specific include the -I&#8217;s to provide the include path. -L the path to the .so files and the -rpath line is the path to the runtime files which gets linked into the executable.</p>
<p>If you add these three lines into c_cpp_properties.json then you&#8217;ll also avoid the dreaded red squiggles.</p>
<pre><code class="language-json" data-line="">            &quot;includePath&quot;: [
                &quot;${workspaceFolder}/**&quot;,
                &quot;/home/david/sdl3-sample/SDL/include&quot;,
                &quot;/home/david/sdl3-sample/SDL_image/include&quot;,
                &quot;/home/david/sdl3-sample/SDL_ttf/include&quot;
            ],</code></pre>
<pre><code class="language-json" data-line="">
</code></pre>
<p>And your C&#8217;s #includes need the files prefixed like this :</p>
<pre>#include &lt;SDL3/SDL.h&gt;
#include &lt;SDL3_image/SDL_image.h&gt;
#include &lt;SDL3_ttf/SDL_ttf.h&gt;</pre>
<p>And here it is running on my Pi.</p>
<p><img decoding="async" class="alignleft wp-image-3422 size-large" src="https://learncgames.com/wp-content/uploads/2025/05/missilecommand_pi-1024x780.png" alt="Missile Command running on a Raspberry Pi 5 with SDL3" width="1024" height="780" srcset="https://learncgames.com/wp-content/uploads/2025/05/missilecommand_pi-1024x780.png 1024w, https://learncgames.com/wp-content/uploads/2025/05/missilecommand_pi-300x229.png 300w, https://learncgames.com/wp-content/uploads/2025/05/missilecommand_pi-768x585.png 768w, https://learncgames.com/wp-content/uploads/2025/05/missilecommand_pi.png 1108w" sizes="(max-width: 1024px) 100vw, 1024px" /></p>The post <a href="https://learncgames.com/setting-up-sdl3-on-linux/">Setting up SDL3 on Linux</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3420</post-id>	</item>
		<item>
		<title>eBook 2 now published on Amazon</title>
		<link>https://learncgames.com/ebook-2-now-publisjed-on-amazon/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=ebook-2-now-publisjed-on-amazon</link>
					<comments>https://learncgames.com/ebook-2-now-publisjed-on-amazon/#comments</comments>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Mon, 19 May 2025 09:08:06 +0000</pubDate>
				<category><![CDATA[Ebook]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[ebook]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3388</guid>

					<description><![CDATA[<p>This is the Linux and Raspberry Pi version of the first book which uses VS Code.  All code updated plus screenshots mostly from Raspberry Pis and a new book cover!</p>
The post <a href="https://learncgames.com/ebook-2-now-publisjed-on-amazon/">eBook 2 now published on Amazon</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><script type='application/json' class='__iawmlf-post-loop-links'>[{"id":16,"href":"https:\/\/amzn.eu\/d\/87tHW3A","archived_href":"","redirect_href":"https:\/\/www.amazon.co.uk\/dp\/B0F92TGVD1?ref=cm_sw_r_ffobk_cp_ud_dp_SGCWV17P59HBXDKZEMDQ&ref_=cm_sw_r_ffobk_cp_ud_dp_SGCWV17P59HBXDKZEMDQ&social_share=cm_sw_r_ffobk_cp_ud_dp_SGCWV17P59HBXDKZEMDQ&bestFormat=true&previewDoh=1","checks":[],"broken":false,"last_checked":null,"process":"done"}]</script><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3389" src="https://learncgames.com/wp-content/uploads/2025/05/learnc-games-programming-Linux.png" alt="Learn C Games programming " width="1140" height="464" srcset="https://learncgames.com/wp-content/uploads/2025/05/learnc-games-programming-Linux.png 1140w, https://learncgames.com/wp-content/uploads/2025/05/learnc-games-programming-Linux-300x122.png 300w, https://learncgames.com/wp-content/uploads/2025/05/learnc-games-programming-Linux-1024x417.png 1024w, https://learncgames.com/wp-content/uploads/2025/05/learnc-games-programming-Linux-768x313.png 768w" sizes="auto, (max-width: 1140px) 100vw, 1140px" />This is the <a title="Link to ebook on Amazon" href="https://amzn.eu/d/87tHW3A" target="_blank" rel="noopener">Linux and Raspberry Pi version</a> of the first book which uses VS Code.  All code updated plus screenshots mostly from Raspberry Pis and a new book cover!</p>The post <a href="https://learncgames.com/ebook-2-now-publisjed-on-amazon/">eBook 2 now published on Amazon</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
					<wfw:commentRss>https://learncgames.com/ebook-2-now-publisjed-on-amazon/feed/</wfw:commentRss>
			<slash:comments>2</slash:comments>
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3388</post-id>	</item>
		<item>
		<title>Interesting bug with controllermap</title>
		<link>https://learncgames.com/interesting-bug-with-controllermap/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=interesting-bug-with-controllermap</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sun, 23 Mar 2025 14:35:44 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[SDL]]></category>
		<category><![CDATA[utility]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3356</guid>

					<description><![CDATA[<p>So I&#8217;ve been playing with a Rust program that uses the config string generated by controllermap. It shows all the keys and the text of a particular button turns green when you press it and it shows PRESSED/RELEASED. But it got A and B buttons mixed up and also X and Y. I&#8217;d press A, [&#8230;]</p>
The post <a href="https://learncgames.com/interesting-bug-with-controllermap/">Interesting bug with controllermap</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignleft wp-image-3357" src="https://learncgames.com/wp-content/uploads/2025/03/test.png" alt="Running a Rust program to show gamepad controls" width="500" height="390" srcset="https://learncgames.com/wp-content/uploads/2025/03/test.png 801w, https://learncgames.com/wp-content/uploads/2025/03/test-300x234.png 300w, https://learncgames.com/wp-content/uploads/2025/03/test-768x598.png 768w" sizes="auto, (max-width: 500px) 100vw, 500px" /></p>
<p>So I&#8217;ve been playing with a Rust program that uses the config string generated by <a title="Link to blog post about controllermap" href="https://learncgames.com/new-tutorial-posted-how-to-build-controllermap-in-linux/" target="_blank" rel="noopener">controllermap</a>. It shows all the keys and the text of a particular button turns green when you press it and it shows PRESSED/RELEASED.</p>
<p>But it got A and B buttons mixed up and also X and Y. I&#8217;d press A, it highlighted B etc.</p>
<p>I checked my code, it wasn&#8217;t there. I ran controllermap again and it generated a similar config string.</p>
<p>I then went back to the Pi version of Asteroids, put it on a Pi, started debugging it, pressed the fire button and it hit the line of code for the A button. D&#8217;oh.</p>
<p>The only conclusion I can come up with is that controllermap gets it wrong for my gamepad. I had somehow missed it when I added gamepad control for the Asteroid Pi.</p>
<p>It&#8217;s quite easy to fix.  This is what the full text in gamepad.txt look like.</p>
<pre>030000001008000001e5000010010000,usb gamepad,platform:Linux,crc:417e,<strong>a:b2,b:b1,x:b3,y:b0</strong>,back:b8,start:b9,leftshoulder:b4,rightshoulder:b5,leftx:a0,lefty:a1,</pre>
<p>but we&#8217;re only interesed in the button mappings for a,b, x and y which are in bold.</p>
<p>a:b2,b:b1,x:b3,y:b0,</p>
<p>Just swap the a b mappings and the x and y so it looks like</p>
<pre>a:b1,b:b2,x:b0,y,b3</pre>
<p>Then save the file and it now works correctly.</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/interesting-bug-with-controllermap/">Interesting bug with controllermap</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3356</post-id>	</item>
		<item>
		<title>New tutorial posted &#8211; how to build controllermap in Linux</title>
		<link>https://learncgames.com/new-tutorial-posted-how-to-build-controllermap-in-linux/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=new-tutorial-posted-how-to-build-controllermap-in-linux</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Sat, 22 Mar 2025 12:11:07 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[tutorials]]></category>
		<category><![CDATA[controllermap]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[SDL2]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3354</guid>

					<description><![CDATA[<p>Remember controllermap? The utility that creates a configuration string for a game pad etc. I found that it is no longer installed by default when you install libsdl2-dev on Linux.  I found the hard way, trying to use it on my new Raspbverry Piu 5. But the source code is available for it in the [&#8230;]</p>
The post <a href="https://learncgames.com/new-tutorial-posted-how-to-build-controllermap-in-linux/">New tutorial posted – how to build controllermap in Linux</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3352" src="https://learncgames.com/wp-content/uploads/2025/03/controllermap.png" alt="Controllermap utility" width="514" height="344" srcset="https://learncgames.com/wp-content/uploads/2025/03/controllermap.png 514w, https://learncgames.com/wp-content/uploads/2025/03/controllermap-300x201.png 300w" sizes="auto, (max-width: 514px) 100vw, 514px" /></p>
<p>Remember controllermap? The utility that creates a configuration string for a game pad etc. I found that it is no longer installed by default when you install libsdl2-dev on Linux.  I found the hard way, trying to use it on my new Raspbverry Piu 5.</p>
<p>But the source code is available for it in the libsdl 2 releases.</p>
<p>So I wrote a quick tutorial that explains how to get the source code and build it using clang on VS Code on a Pi or any Linux box.  It&#8217;s <a title="Link to tutorial how to build controllermap on Linux" href="https://learncgames.com/tutorials/how-to-build-controllermap-on-linux-for-sdl2/" target="_blank" rel="noopener">linked here</a> or you can find it on the tutorials menu.</p>The post <a href="https://learncgames.com/new-tutorial-posted-how-to-build-controllermap-in-linux/">New tutorial posted – how to build controllermap in Linux</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3354</post-id>	</item>
		<item>
		<title>How fast is a Raspberry Pi 5?</title>
		<link>https://learncgames.com/how-fast-is-a-raspberry-pi-5/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-fast-is-a-raspberry-pi-5</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Tue, 18 Mar 2025 00:05:10 +0000</pubDate>
				<category><![CDATA[64-bit]]></category>
		<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[Rust]]></category>
		<category><![CDATA[poker]]></category>
		<category><![CDATA[speed]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3340</guid>

					<description><![CDATA[<p>I recently bought one with 8 GB RAM pictured above. I haven&#8217;t got an SSD for it yet so am still pottering about with an SD Card. I&#8217;ve installed VS Code, clang. and Rust along with the VS Code extensions Rust-Analyzer and codelldb. Out of curiosity I compiled and ran a Rust program that reads [&#8230;]</p>
The post <a href="https://learncgames.com/how-fast-is-a-raspberry-pi-5/">How fast is a Raspberry Pi 5?</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><script type='application/json' class='__iawmlf-post-loop-links'>[{"id":20,"href":"https:\/\/github.com\/David-H-Bolton\/Projects\/blob\/main\/rust_pokerhand_faster.zip","archived_href":"","redirect_href":"","checks":[],"broken":false,"last_checked":null,"process":"done"}]</script><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3341" src="https://learncgames.com/wp-content/uploads/2025/03/raspi-5.png" alt="Raspberry PI 5" width="606" height="402" srcset="https://learncgames.com/wp-content/uploads/2025/03/raspi-5.png 606w, https://learncgames.com/wp-content/uploads/2025/03/raspi-5-300x199.png 300w" sizes="auto, (max-width: 606px) 100vw, 606px" />I recently bought one with 8 GB RAM pictured above. I haven&#8217;t got an SSD for it yet so am still pottering about with an SD Card.</p>
<p>I&#8217;ve installed VS Code, clang. and Rust along with the VS Code extensions Rust-Analyzer and codelldb.</p>
<p>Out of curiosity I compiled and ran a Rust program that reads in a text file of 1,000 lines of text with each line holding 7 random cards like this: AH 6D 2C 4S JD QH QC.</p>
<p>The idea is to load the file into RAM then process each line and determine the best poker hand.</p>
<p>On my PC 11th Gen Intel(R) Core(TM) i7-11700K @ 3.60GHz (which runs Windows 11), I compared running the Rust program in Windows 11, on Ubuntu 24.04 LTS running in a Hyper-V VM on the same PC and on the Raspberry Pi 5 using it&#8217;s own Debian (Bookworm) version.</p>
<p>Here are the times per hand.</p>
<ul>
<li><strong>Windows</strong>: 175 ns.</li>
<li><strong>Ubuntu on Hyper-V</strong> 125 ns</li>
<li><strong>Raspberry Pi 5</strong>: 175 ns.</li>
</ul>
<p>You can download the project with the test cards from <a title="Download Rust project zip file from GitHub" href="https://github.com/David-H-Bolton/Projects/blob/main/rust_pokerhand_faster.zip">GitHub</a>. This link is a zip file containing the project file.</p>
<p>To run it in release in VS Code, in the terminal type in</p>
<pre>cargo run --release 1000_card_hands.txt</pre>
<pre><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3342" src="https://learncgames.com/wp-content/uploads/2025/03/timings.png" alt="Timings running under Ubuntu" width="710" height="90" srcset="https://learncgames.com/wp-content/uploads/2025/03/timings.png 710w, https://learncgames.com/wp-content/uploads/2025/03/timings-300x38.png 300w" sizes="auto, (max-width: 710px) 100vw, 710px" /></pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>Or you can view the test cards which include the results with commemts in the test file. No need to run it release.</p>
<pre>cargo run --features=show_cards test_card_hands.txt

<img loading="lazy" decoding="async" class="alignleft size-full wp-image-3344" src="https://learncgames.com/wp-content/uploads/2025/03/showcards.png" alt="Showing cards with test data" width="815" height="431" srcset="https://learncgames.com/wp-content/uploads/2025/03/showcards.png 815w, https://learncgames.com/wp-content/uploads/2025/03/showcards-300x159.png 300w, https://learncgames.com/wp-content/uploads/2025/03/showcards-768x406.png 768w" sizes="auto, (max-width: 815px) 100vw, 815px" />
</pre>
<p>What is so suprising is that the time on Windows and Rapberry Pi 5 are the same. Windows is running a virus checker (Windows Defender) and I guess that might slow it a bit. </p>The post <a href="https://learncgames.com/how-fast-is-a-raspberry-pi-5/">How fast is a Raspberry Pi 5?</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3340</post-id>	</item>
		<item>
		<title>How to fix sound on the Raspberry Pi</title>
		<link>https://learncgames.com/how-to-fix-sound-on-the-raspberry-pi/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=how-to-fix-sound-on-the-raspberry-pi</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Thu, 22 Dec 2022 00:00:55 +0000</pubDate>
				<category><![CDATA[C]]></category>
		<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[audio]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3152</guid>

					<description><![CDATA[<p>First I modded the code that inits sound to this: int success=Mix_OpenAudio(44000, AUDIO_F32LSB, 2, 8192); if (success==-1 ) { LogError2(&#34;InitSetup failed to init audio because %s&#34;,Mix_GetError()); } That extra call to Mix_GetError() returns a string saying what the problem is and in this case I got ALSA : Couldn&#8217;t find any hardware audio formats. ALSA [&#8230;]</p>
The post <a href="https://learncgames.com/how-to-fix-sound-on-the-raspberry-pi/">How to fix sound on the Raspberry Pi</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><script type='application/json' class='__iawmlf-post-loop-links'>[{"id":36,"href":"https:\/\/en.wikipedia.org\/wiki\/Advanced_Linux_Sound_Architecture","archived_href":"http:\/\/web-wp.archive.org\/web\/20260201212308\/https:\/\/en.wikipedia.org\/wiki\/Advanced_Linux_Sound_Architecture","redirect_href":"","checks":[{"date":"2026-02-06 11:14:45","http_code":200},{"date":"2026-02-11 03:48:55","http_code":200},{"date":"2026-02-23 17:07:40","http_code":200},{"date":"2026-03-01 04:10:46","http_code":200},{"date":"2026-03-09 17:18:25","http_code":200},{"date":"2026-03-14 23:28:03","http_code":200},{"date":"2026-03-20 00:40:52","http_code":200},{"date":"2026-03-31 16:57:15","http_code":200},{"date":"2026-04-09 00:31:21","http_code":200},{"date":"2026-04-14 12:03:52","http_code":200},{"date":"2026-04-21 04:37:32","http_code":200},{"date":"2026-04-26 14:18:25","http_code":200},{"date":"2026-04-30 15:33:07","http_code":200},{"date":"2026-05-05 02:59:03","http_code":200}],"broken":false,"last_checked":{"date":"2026-05-05 02:59:03","http_code":200},"process":"done"},{"id":37,"href":"http:\/\/blog.scphillips.com\/posts\/2013\/01\/sound-configuration-on-raspberry-pi-with-alsa","archived_href":"http:\/\/web-wp.archive.org\/web\/20251006101907\/http:\/\/blog.scphillips.com\/posts\/2013\/01\/sound-configuration-on-raspberry-pi-with-alsa\/","redirect_href":"","checks":[{"date":"2026-02-06 11:14:48","http_code":200},{"date":"2026-02-11 03:48:57","http_code":200},{"date":"2026-02-23 17:07:41","http_code":200},{"date":"2026-03-01 04:10:46","http_code":200},{"date":"2026-03-09 17:18:28","http_code":200},{"date":"2026-03-14 23:28:03","http_code":200},{"date":"2026-03-20 00:40:50","http_code":200},{"date":"2026-03-31 16:57:16","http_code":200},{"date":"2026-04-09 00:31:23","http_code":200},{"date":"2026-04-14 12:03:55","http_code":200},{"date":"2026-04-21 04:37:36","http_code":200},{"date":"2026-04-26 14:18:27","http_code":200},{"date":"2026-04-30 15:33:16","http_code":200},{"date":"2026-05-05 02:59:04","http_code":200}],"broken":false,"last_checked":{"date":"2026-05-05 02:59:04","http_code":200},"process":"done"}]</script><img loading="lazy" decoding="async" class="alignleft size-full wp-image-3154" src="https://learncgames.com/wp-content/uploads/2022/12/raspi-config.png" alt="Raspi-config for Raspberry Pi" width="656" height="448" srcset="https://learncgames.com/wp-content/uploads/2022/12/raspi-config.png 656w, https://learncgames.com/wp-content/uploads/2022/12/raspi-config-300x205.png 300w" sizes="auto, (max-width: 656px) 100vw, 656px" />First I modded the code that inits sound to this:</p>
<pre><code class="language-c" data-line="">	int success=Mix_OpenAudio(44000, AUDIO_F32LSB, 2, 8192);
	if (success==-1 ) {

		LogError2(&quot;InitSetup failed to init audio because %s&quot;,Mix_GetError());
	}</code></pre>
<p>That extra call to Mix_GetError() returns a string saying what the problem is and in this case I got</p>
<p>ALSA : Couldn&#8217;t find any hardware audio formats.</p>
<p>ALSA is short for Advanced Linux Sound Architecture and <a title="Link to Wikipedia about ALSA" href="https://en.wikipedia.org/wiki/Advanced_Linux_Sound_Architecture" target="_blank" rel="noopener">Wikipedi</a>a is very informative. It certainly put some perspective on it.</p>
<p>&nbsp;</p>
<p>Also I found <a title="Link to article on configuring sound for the Raspberry Pi" href="http://blog.scphillips.com/posts/2013/01/sound-configuration-on-raspberry-pi-with-alsa/" target="_blank" rel="noopener">this article</a> adds a lot more information.  What fixed it though was doing</p>
<pre>sudo raspi-config</pre>
<p>Then pressing enter on 1. System Options and then S2 Audio and selecting the headphones option. Simple as that. After that asteroids played the sounds as expected.</p>
<p>There&#8217;s a lesson here which is to use the functions provided, in this case calling the Mix_GetError() function to show errors.  I added it into the PlayASound() call to see why it was failing, and it stopped doing it, i.e. it worked with lots of explosions on screen. I suspect it was the sound configuration hadn&#8217;t been properly set which is an issue with Raspberry Pis apparently.</p>The post <a href="https://learncgames.com/how-to-fix-sound-on-the-raspberry-pi/">How to fix sound on the Raspberry Pi</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3152</post-id>	</item>
		<item>
		<title>Raspberry Pi Sound issues- trying to fix it</title>
		<link>https://learncgames.com/raspberry-pi-sound-issues-trying-to-fix-it/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=raspberry-pi-sound-issues-trying-to-fix-it</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Mon, 19 Dec 2022 00:00:02 +0000</pubDate>
				<category><![CDATA[bugs]]></category>
		<category><![CDATA[C]]></category>
		<category><![CDATA[Ebook]]></category>
		<category><![CDATA[linux]]></category>
		<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[sound]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=3145</guid>

					<description><![CDATA[<p>In working through my Linux/Raspberry Pi eBook(Yes &#8211; the second eBook!), I&#8217;m up to the chapter where sounds are introduced using the SDL_mixer library. And I&#8217;ve hit two sets of problems. It sometimes refuses to initialize the sound code.  This code below hits the LogError line: int success=Mix_OpenAudio(22050, AUDIO_S16LSB, 2, 8192); if (success==-1 ) { [&#8230;]</p>
The post <a href="https://learncgames.com/raspberry-pi-sound-issues-trying-to-fix-it/">Raspberry Pi Sound issues- trying to fix it</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><script type='application/json' class='__iawmlf-post-loop-links'>[{"id":38,"href":"https:\/\/pixabay.com\/users\/openclipart-vectors-30363\/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=158394","archived_href":"http:\/\/web-wp.archive.org\/web\/20251230124419\/https:\/\/pixabay.com\/users\/openclipart-vectors-30363\/?utm_source=link-attribution","redirect_href":"","checks":[{"date":"2026-02-06 11:14:50","http_code":403},{"date":"2026-02-11 00:49:37","http_code":403},{"date":"2026-02-15 09:57:58","http_code":403},{"date":"2026-02-22 03:49:13","http_code":403},{"date":"2026-02-27 11:03:50","http_code":403},{"date":"2026-03-04 08:58:03","http_code":403},{"date":"2026-03-10 04:10:04","http_code":403},{"date":"2026-03-14 23:28:01","http_code":403},{"date":"2026-03-23 04:24:55","http_code":403},{"date":"2026-03-26 18:05:22","http_code":403},{"date":"2026-04-04 12:46:30","http_code":403},{"date":"2026-04-09 07:36:36","http_code":403},{"date":"2026-04-12 11:45:04","http_code":403},{"date":"2026-04-20 08:36:45","http_code":403},{"date":"2026-04-24 22:31:37","http_code":403},{"date":"2026-04-28 06:53:30","http_code":403},{"date":"2026-05-02 00:59:46","http_code":403},{"date":"2026-05-05 11:15:57","http_code":403},{"date":"2026-05-09 00:45:33","http_code":403}],"broken":true,"last_checked":{"date":"2026-05-09 00:45:33","http_code":403},"process":"done"},{"id":39,"href":"https:\/\/pixabay.com\/\/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=158394","archived_href":"http:\/\/web-wp.archive.org\/web\/20260205102120\/https:\/\/pixabay.com\/?utm_source=link-attribution","redirect_href":"","checks":[{"date":"2026-02-06 11:14:54","http_code":403},{"date":"2026-02-11 00:49:37","http_code":403},{"date":"2026-02-15 09:57:57","http_code":403},{"date":"2026-02-22 03:49:12","http_code":403},{"date":"2026-02-27 11:03:50","http_code":403},{"date":"2026-03-04 08:58:03","http_code":403},{"date":"2026-03-10 04:10:04","http_code":403},{"date":"2026-03-14 23:28:01","http_code":403},{"date":"2026-03-23 04:24:56","http_code":403},{"date":"2026-03-26 18:05:20","http_code":403},{"date":"2026-04-04 12:46:30","http_code":403},{"date":"2026-04-09 07:36:39","http_code":403},{"date":"2026-04-12 11:45:04","http_code":403},{"date":"2026-04-19 12:07:41","http_code":403},{"date":"2026-04-24 22:31:41","http_code":403},{"date":"2026-04-28 12:25:24","http_code":403},{"date":"2026-05-02 00:31:34","http_code":403},{"date":"2026-05-05 11:47:41","http_code":403},{"date":"2026-05-09 00:45:33","http_code":403}],"broken":true,"last_checked":{"date":"2026-05-09 00:45:33","http_code":403},"process":"done"}]</script><figure id="attachment_3146" aria-describedby="caption-attachment-3146" style="width: 295px" class="wp-caption alignleft"><img loading="lazy" decoding="async" class="size-medium wp-image-3146" src="https://learncgames.com/wp-content/uploads/2022/12/loudspeaker-295x300.png" alt="Loudpeaker" width="295" height="300" srcset="https://learncgames.com/wp-content/uploads/2022/12/loudspeaker-295x300.png 295w, https://learncgames.com/wp-content/uploads/2022/12/loudspeaker.png 630w" sizes="auto, (max-width: 295px) 100vw, 295px" /><figcaption id="caption-attachment-3146" class="wp-caption-text">Image by <a href="https://pixabay.com/users/openclipart-vectors-30363/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=158394">OpenClipart-Vectors</a> from <a href="https://pixabay.com//?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=158394">Pixabay</a></figcaption></figure></p>
<p>In working through my Linux/Raspberry Pi eBook(<em>Yes &#8211; the second eBook!)</em>, I&#8217;m up to the chapter where sounds are introduced using the SDL_mixer library. And I&#8217;ve hit two sets of problems.</p>
<p>It sometimes refuses to initialize the sound code.  This code below hits the LogError line:</p>
<pre><code class="language-c" data-line=""></code></pre>
<pre><code class="language-c" data-line="">	int success=Mix_OpenAudio(22050, AUDIO_S16LSB, 2, 8192);
	if (success==-1 ) {
		LogError(&quot;InitSetup failed to init audio&quot;);
	}</code></pre>
<pre><code class="language-c" data-line=""></code></pre>
<p>The other day it was working but not today. Now I have updated the Pi&#8217;s code (<em>sudo apt update</em> <em>etc</em>) but I wouldn&#8217;t have expected that to break it. I&#8217;ve been looking on the internet and find the whole thing a bit complicated.</p>
<p>I&#8217;ve got my Pi running 64-bit Raspberry Pi OS. I&#8217;ve changed the output device to headphones which plug into the headphone socket. If I run the VLC media player and tell it to play into the headphones, it will happily play the .wav files I&#8217;ve got for the asteroids game.</p>
<p>But if I run <strong>speaker-test</strong>, a terminal application with this command line</p>
<pre>speaker-test -c2 -twav -l7 plughw:1,0</pre>
<p>I get</p>
<pre>speaker-test 1.2.4

Playback device is default
Stream parameters are 48000Hz, S16_LE, 2 channels
WAV file(s)
Setting of hwparams failed: Invalid argument</pre>
<p>By running this command:</p>
<pre><code class="language-c" data-line="">aplay -L
</code></pre>
<p>I got 71 lines of output but of these these below are the most important</p>
<pre>output
<strong>hw</strong>:CARD=<strong>Headphones</strong>,DEV=0
    bcm2835 Headphones, bcm2835 Headphones
</pre>
<p>and the speaker-test command using the device parameter &#8211;<strong>Dhw:Headphones</strong> now worked. I&#8217;ve highlighted the bits in the aplay output needed to identify the device.</p>
<p>The new command  is</p>
<pre>speaker-test -c2 -twav -l7 -Dhw:Headphones</pre>
<p>I can now hear a female voice saying <strong>front left</strong> then <strong>front right</strong> a few times in my headphones.</p>
<p>So my Pi&#8217;s sound device is working; I just have to figure why SDL_mixer isn&#8217;t always. I&#8217;ll keep looking.</p>
<p><strong>And the second problem</strong> which only occurs when the mixer is working, is when you play a lot of sounds. The <strong>PlayASound()</strong> function checks the result. On Windows it never had a problem but on Raspberry Pi, when you blow up a lot of asteroids say at one time, it plays a number of explosions then returns an error for each explosion after that. I think there&#8217;s only so many channels; that&#8217;s an easy fix; just ignore the error and return as if it succeeded.</p>The post <a href="https://learncgames.com/raspberry-pi-sound-issues-trying-to-fix-it/">Raspberry Pi Sound issues- trying to fix it</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">3145</post-id>	</item>
		<item>
		<title>Networking fun with my Pi</title>
		<link>https://learncgames.com/networking-fun-with-my-pi/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=networking-fun-with-my-pi</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Wed, 09 Dec 2020 00:00:53 +0000</pubDate>
				<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[neyworking]]></category>
		<category><![CDATA[woes]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=2026</guid>

					<description><![CDATA[<p>I lost my main internet for a week due to a power cut that left my main router in a funny state. It had to be factory reset then WiFi SSDs and passwords were reset. My office internet comes down a very long ethernet cable via two switches and a router. I had problems with [&#8230;]</p>
The post <a href="https://learncgames.com/networking-fun-with-my-pi/">Networking fun with my Pi</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><script type='application/json' class='__iawmlf-post-loop-links'>[{"id":328,"href":"https:\/\/pixabay.com\/photos\/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=1246209","archived_href":"http:\/\/web-wp.archive.org\/web\/20260129081545\/https:\/\/pixabay.com\/photos\/?utm_source=link-attribution","redirect_href":"","checks":[{"date":"2026-02-06 14:00:33","http_code":403},{"date":"2026-02-12 22:35:49","http_code":403},{"date":"2026-02-17 04:27:14","http_code":403},{"date":"2026-02-25 10:44:58","http_code":403},{"date":"2026-03-05 18:13:31","http_code":403},{"date":"2026-03-10 15:24:14","http_code":403},{"date":"2026-03-14 23:28:01","http_code":403},{"date":"2026-03-26 23:46:30","http_code":403},{"date":"2026-03-30 08:06:50","http_code":403},{"date":"2026-04-05 15:46:01","http_code":403},{"date":"2026-04-09 09:28:30","http_code":403},{"date":"2026-04-15 10:21:56","http_code":403},{"date":"2026-04-21 19:26:43","http_code":403},{"date":"2026-04-28 08:05:26","http_code":403},{"date":"2026-05-02 14:03:56","http_code":403},{"date":"2026-05-08 01:10:58","http_code":403}],"broken":true,"last_checked":{"date":"2026-05-08 01:10:58","http_code":403},"process":"done"},{"id":329,"href":"https:\/\/pixabay.com\/?utm_source=link-attribution&utm_medium=referral&utm_campaign=image&utm_content=1246209","archived_href":"http:\/\/web-wp.archive.org\/web\/20260205102120\/https:\/\/pixabay.com\/?utm_source=link-attribution","redirect_href":"","checks":[{"date":"2026-02-06 14:00:36","http_code":403},{"date":"2026-02-12 09:55:17","http_code":403},{"date":"2026-02-17 04:27:15","http_code":403},{"date":"2026-02-25 10:44:59","http_code":403},{"date":"2026-03-05 18:13:31","http_code":403},{"date":"2026-03-10 15:24:13","http_code":403},{"date":"2026-03-14 23:28:03","http_code":403},{"date":"2026-03-26 23:46:30","http_code":403},{"date":"2026-03-30 08:06:50","http_code":403},{"date":"2026-04-05 15:46:01","http_code":403},{"date":"2026-04-09 09:28:29","http_code":403},{"date":"2026-04-15 10:21:57","http_code":403},{"date":"2026-04-21 19:26:43","http_code":403},{"date":"2026-04-28 08:05:24","http_code":403},{"date":"2026-05-02 14:04:02","http_code":403},{"date":"2026-05-08 19:18:31","http_code":403}],"broken":true,"last_checked":{"date":"2026-05-08 19:18:31","http_code":403},"process":"done"}]</script><figure id="attachment_2027" aria-describedby="caption-attachment-2027" style="width: 300px" class="wp-caption alignleft"><img loading="lazy" decoding="async" class="size-medium wp-image-2027" src="https://learncgames.com/wp-content/uploads/2020/12/network-1246209_640-300x200.jpg" alt="Networking" width="300" height="200" srcset="https://learncgames.com/wp-content/uploads/2020/12/network-1246209_640-300x200.jpg 300w, https://learncgames.com/wp-content/uploads/2020/12/network-1246209_640.jpg 640w" sizes="auto, (max-width: 300px) 100vw, 300px" /><figcaption id="caption-attachment-2027" class="wp-caption-text">Image by <a href="https://pixabay.com/photos/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1246209">Free-Photos</a> from <a href="https://pixabay.com/?utm_source=link-attribution&amp;utm_medium=referral&amp;utm_campaign=image&amp;utm_content=1246209">Pixabay</a></figcaption></figure></p>
<p>I lost my main internet for a week due to a power cut that left my main router in a funny state. It had to be factory reset then WiFi SSDs and passwords were reset. My office internet comes down a very long ethernet cable via two switches and a router. I had problems with my router and it got factory reset. Unfortunately I didn&#8217;t set this network up and didn&#8217;t realise that the network had two routers each doing DHCP and consequently it took a week to get things right. At one point I;d do a ping from my desktop PC and the answer would come back as IPV6, It was totally ignoring IPV4 requests, pings to domains with the -4 parameter were unreachable. Not a fun week.</p>
<p>My Pi which plugs into one of the switches and my desktop PC which also plugs onto the same switch would not talk. Both could see the internet but my Pi could not see Microsoft servers. I&#8217;d tried everything, even giving it a permanent IP rather than a DHCP but that can cause issues if the DHCP issues an IP address the same.</p>
<p>I do rather a lot with my PC and the Pi and having them networked is much more convenient than not. I use WinSCP for copying files and Putty if I need to connect in.</p>
<p>In the end, I bottled out and burnt the Raspberry Pi OS on a SD Card and booted from that. One hour later I&#8217;d installed all 295 updates and then installed VS Code.</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/networking-fun-with-my-pi/">Networking fun with my Pi</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">2026</post-id>	</item>
		<item>
		<title>Back on the Raspberry Pi</title>
		<link>https://learncgames.com/back-on-the-raspberry-pi/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=back-on-the-raspberry-pi</link>
		
		<dc:creator><![CDATA[David]]></dc:creator>
		<pubDate>Fri, 27 Nov 2020 00:00:51 +0000</pubDate>
				<category><![CDATA[raspberry-pi]]></category>
		<category><![CDATA[clang]]></category>
		<category><![CDATA[compiling]]></category>
		<guid isPermaLink="false">https://learncgames.com/?p=1901</guid>

					<description><![CDATA[<p>It has been a few months since I last used it and as you&#8217;d expect, it took a little bit of time and effort to get things back to what they were. I&#8217;m pretty good about backing things up and it took about 30 minutes to burn a new SD Card, update it, install VS [&#8230;]</p>
The post <a href="https://learncgames.com/back-on-the-raspberry-pi/">Back on the Raspberry Pi</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></description>
										<content:encoded><![CDATA[<p><img loading="lazy" decoding="async" class="alignleft size-full wp-image-1903" src="https://learncgames.com/wp-content/uploads/2020/11/pi-asteroids.png" alt="Pi Asteroids Development" width="450" height="256" srcset="https://learncgames.com/wp-content/uploads/2020/11/pi-asteroids.png 450w, https://learncgames.com/wp-content/uploads/2020/11/pi-asteroids-300x171.png 300w" sizes="auto, (max-width: 450px) 100vw, 450px" />It has been a few months since I last used it and as you&#8217;d expect, it took a little bit of time and effort to get things back to what they were.</p>
<p>I&#8217;m pretty good about backing things up and it took about 30 minutes to burn a new SD Card, update it, install VS Code and the C/C++ extension, then copy my asteroids version over. I use <strong>WinSCP</strong> so had to enable <strong>SSH</strong> on the PI. It&#8217;s disabled by default but just tick a checkbox on the interface tab of the Preferences-&gt;Configuration menu.</p>
<p>Even then it didn&#8217;t compile. Of course I had to reinstall the dev versions of <strong>SDL, SDL_image, SDL_mixer and SDL_ttf</strong> and the <strong>clang</strong> compiler. Still it didn&#8217;t compile. I had created a <strong>Projects</strong> folder and created an <strong>Asteroids</strong> folder underneath that. I also had the Vs Code JSON files that you need for compiling C/C++. the main one of which is <strong>tasks.json</strong>. Those were in a folder <strong>.vscode</strong> which I had backed up but I&#8217;d copied it over into the wrong location. You want it located <strong>inside</strong> your VS Code folder.</p>
<p>This makes sense. If you have say five different projects then you are going to have a different build, link stuff per project. So you&#8217;ll have a unique <strong>.vscode</strong> in each folder. When you want to switch projects, you just close the Folder in the VS Code File menu and open it in the folder for the project that you next want to work on.</p>
<p>Mind you it still wouldn&#8217;t compile. It turned out my tasks.json has <strong>clang-6</strong> in it. When I did a <strong>clang &#8211;version</strong> on it, it told me it was clang 7.0.1. So I upped it to <strong>clang-7</strong> in tasks.json and that fixed it. It all compiled and ran.</p>
<p>Once you&#8217;ve done this a time or two it becomes 2nd nature but I can understand novices frustration; there are a lot of moving parts that all have to be right before you can even write and run C code. It&#8217;s not like other programming languages are really any better though. If you have setup virtual environments in Python and installed Python modules, you&#8217;ll know what it can be like.</p>
<p>&nbsp;</p>The post <a href="https://learncgames.com/back-on-the-raspberry-pi/">Back on the Raspberry Pi</a> first appeared on <a href="https://learncgames.com">Learn C Games Programming Blog</a>.]]></content:encoded>
					
		
		
		<post-id xmlns="com-wordpress:feed-additions:1">1901</post-id>	</item>
	</channel>
</rss>
