Skip to content

Commit

Permalink
Added post on web scraping
Browse files Browse the repository at this point in the history
  • Loading branch information
emgardner committed Jan 24, 2024
1 parent 373381f commit 6d30593
Show file tree
Hide file tree
Showing 23 changed files with 327 additions and 19 deletions.
14 changes: 14 additions & 0 deletions .astro/types.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,13 @@ declare module 'astro:content' {
collection: "posts";
data: any
} & { render(): Render[".md"] };
"web-scraping-and-crawling-in-rust/index.md": {
id: "web-scraping-and-crawling-in-rust/index.md";
slug: "web-scraping-and-crawling-in-rust";
body: string;
collection: "posts";
data: any
} & { render(): Render[".md"] };
};
"weekly-notes": {
"week-2---2024/index.md": {
Expand All @@ -239,6 +246,13 @@ declare module 'astro:content' {
collection: "weekly-notes";
data: any
} & { render(): Render[".md"] };
"week-3--2024/index.md": {
id: "week-3--2024/index.md";
slug: "week-3--2024";
body: string;
collection: "weekly-notes";
data: any
} & { render(): Render[".md"] };
};

};
Expand Down
Binary file added public/assets/obsidian/25 Duty Cycle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidian/50 Duty Cycle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidian/ASCII Table.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidian/DMA Config.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidian/DMA Interrupt Flags.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidian/DMA Interrupt Status.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidian/GPIOA_MODER Register.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidian/HackerNews Posts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidian/Nucleo Board.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidian/STM32 Memory Bank.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidian/hackernews-posts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/assets/obsidianHackerNews Posts.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions src/content/posts/embedded-rust-from-zero-to-blink/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,12 @@ title: Setting up an embedded rust project for STM32
hero: ./Background.jpg
thumbnail: Thumbnail.png
description: How to use cargo to setup an embedded rust project.
tags: [rust, embedded, stm32, microcontrollers]
date: 01-20-2022
tags:
- rust
- embedded
- stm32
- microcontrollers
date: 01-20-2023
draft: false
---

Expand All @@ -16,7 +20,7 @@ The purpose of this post is to give a brief overview of how to setup an embedded
- An STM32 board preferrably one with an in built programmer and USB/UART converter like the **NUCLEO** series of board these can be bought for fairly cheap and in my opinion are much nicer than the **Bluepill** [Many can be found here for reasonable cost](https://www.digikey.com/en/product-highlight/s/stmicroelectronics/nucleo-development-boards)
- A programmer if your board doesn't have one, if you've bought a bluepill from amazon chances are this came in the package.

![Nucleo Board](/assets/obsidian/nucleo-board.png)
![Nucleo Board](/assets/obsidian//nucleo-board.png)
### Target Installation

If you haven't installed rust yet do so by following the directions on the official rust site: [Rust Installation Instructions](https://www.rust-lang.org/learn/get-started). The next step will be to install the proper cross-toolchain compiler for the chip that we're using.
Expand Down Expand Up @@ -111,7 +115,7 @@ rustflags = [ "-C", "link-arg=-Tlink.x"]

Lastly we will create a very basic linker script. This is baord specific. If you're unfamiliar with microcontrollers this will always be found in you MCU's datasheets or reference manual. A layout of the memory sections is provided below. By convention RAM starts at 0x2000000 and Flash starts at 0x80000000.

![STM32 Memory Bank](/assets/obsidian/stm32-memory-bank.png)
![STM32 Memory Bank](/assets/obsidian//stm32-memory-bank.png)

```
/* memory.x - Linker script for the STM32L476RGT6 */
Expand Down Expand Up @@ -243,14 +247,14 @@ What on earth is **gpioa.moder** and **gpioa.typer**. Well these are registers t

Here we see that the GPIOA_MODER register set's the mode of the GPIO pins on BANK A.

![GPIOA_MODER Register](/assets/obsidian/gpioa_moder-register.png)
![GPIOA_MODER Register](/assets/obsidian//gpioa_moder-register.png)

That mode is defined by the following bit's:

![GPIO MODE CONFIGURATION](/assets/obsidian/gpio-mode-configuration.png)
![GPIO MODE CONFIGURATION](/assets/obsidian//gpio-mode-configuration.png)
And lastly the type of output is defined here:

![GPIO OUTPUT CONFIGURATION](/assets/obsidian/gpio-output-configuration.png)
![GPIO OUTPUT CONFIGURATION](/assets/obsidian//gpio-output-configuration.png)

When you hear someone refer to bare-metal programming often what they are referring to is that instead of using a nice method like this:

Expand Down
6 changes: 3 additions & 3 deletions src/content/posts/embedded-rust-gpio's/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags:
- embedded
- stm32
- microcontrollers
date: 01-22-2022
date: 01-22-2023
draft: false
---

Expand Down Expand Up @@ -316,7 +316,7 @@ pub trait _embedded_hal_PwmPin {

We first get the maximum duty value of the timer **ARR** and then we can set the duty cycle to a fraction of that value by dividing down the max value. Let's see what happens when we set the duty cycle to half the value when we look at the output wave form on a logic analyzer.

![50 Duty Cycle](/assets/obsidian/50-duty-cycle.png)
![50 Duty Cycle](/assets/obsidian//50-duty-cycle.png)

Great it's almost exactly what we would expect the top is the Digital representation of the analog signal that is ont the bottom. Let's see what happens when we divide it down by 4:

Expand All @@ -325,7 +325,7 @@ Great it's almost exactly what we would expect the top is the Digital representa
pwm.set_duty(max_duty/4);
```

![25 Duty Cycle](/assets/obsidian/25-duty-cycle.png)
![25 Duty Cycle](/assets/obsidian//25-duty-cycle.png)

and here's the final code:

Expand Down
10 changes: 5 additions & 5 deletions src/content/posts/embedded-rust-serial/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags:
- embedded
- stm32
- microcontrollers
date: 01-23-2022
date: 01-23-2023
draft: false
---

Expand Down Expand Up @@ -153,7 +153,7 @@ If you run this script you should see the following on the terminal:

Perfect we get our 4 byte message's (3 ints, 1 newline) and echo them out. Now let's do something a little bit more useful with this information let's change the length of the LED's on time based on our recevied message. We are sending over ascii numeric values. We could send over raw bytes and process them but dealing with the ascii values gives us a fun little challenge. Ascii is a character encoding standard for electronic communication. ASCII codes represent text in computers.

![ASCII Table](/assets/obsidian/ascii-table.png)
![ASCII Table](/assets/obsidian//ascii-table.png)

How do we represent the number 1000 with ascii text? It's equivalent to the u8 byte array of [31, 30, 30, 30]. There are many methods to decoding this but let's roll our own for fun:

Expand Down Expand Up @@ -586,10 +586,10 @@ The DMA Configuration Register contains the following fields:
| TCIE | 1 | Transfer Complete Interrupt Enable |
| EN | 0 | Enable |

![DMA Config](/assets/obsidian/dma-config.png)
![DMA Config](/assets/obsidian//dma-config.png)

![DMA Interrupt Status](/assets/obsidian/dma-interrupt-status.png)
![DMA Interrupt Status](/assets/obsidian//dma-interrupt-status.png)

![DMA Interrupt Flags](/assets/obsidian/dma-interrupt-flags.png)
![DMA Interrupt Flags](/assets/obsidian//dma-interrupt-flags.png)

**Work In progress**
2 changes: 1 addition & 1 deletion src/content/posts/embedded-rust-timers/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ tags:
- embedded
- stm32
- microcontrollers
date: 01-21-2022
date: 01-21-2023
draft: false
---

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ tags:
- PROGRAMMING
- "#obsidian"
title: How i am using Obsidian for my blog
date: 01-12-2023
date: 01-12-2024
---
I've been wanting to write more blog articles mostly for three reasons:

Expand All @@ -18,7 +18,7 @@ My initial goal was to edit blog posts directly in my text editor and have the f

By this point I've been using Obsidian for the better part of a year now and I really like it. I'm not a power user by any stretch, and my note taking habit's could be way better. So i thought why not just use the markdown editor that Obsidian provides me with to edit my blog content?

![Pasted image 20240107154046](/assets/obsidian/pasted-image-20240107154046.png)
![Pasted image 20240107154046](/assets/obsidian//pasted-image-20240107154046.png)
<p style="text-align: center; font-style:italic;">Obligatory Obsidian Graph</p>


Expand Down
Loading

0 comments on commit 6d30593

Please sign in to comment.