Change images to use image shortcode; Move images to their own folder to keep things tidy
|
Before Width: | Height: | Size: 236 KiB After Width: | Height: | Size: 236 KiB |
@@ -9,10 +9,10 @@ tags:
|
||||
draft: false
|
||||
author: Paul Williams
|
||||
author_email: phyushin@gmail.com
|
||||
listing_image: hackbot.jpg
|
||||
listing_image: images/hackbot.jpg
|
||||
---
|
||||
|
||||
# Continuing the Bot Building Process
|
||||
## Continuing the Bot Building Process
|
||||
So, we'll continue from where we left on last a little while ago with our bot building blog [posts][1].
|
||||
We'd got to the MK IV if memory serves... Next on the list of things to do is to make our bot interface page nice and pretty.
|
||||
|
||||
@@ -21,7 +21,7 @@ Because we're using a very simple webserver on the [Raspbery Pi Pico W][2] and b
|
||||
|
||||
## CodePen
|
||||
When prototyping, it's always much more satisfying to see the changes happen quickly, as opposed to editing our `generateHTML()` function, uploading to the bot, connecting to our bot, visiting the url... it's a lot of steps - so, to make this a bit easier we're going to use a nice tool called [CodePen][3], our first step is to rip out the HTML from the `generateHTML()` function and paste it into the HTML window, like so:
|
||||

|
||||
{{< image src="images/codepen_screenshot.png" title="HTML & CSS editor windows above, results below">}}
|
||||
The result of the code is shown underneath the HTML and CSS editor windows, We've made a couple of modifications from our original `generateHTML()` function to make it easier to work with CSS:
|
||||
|
||||
```python
|
||||
@@ -50,10 +50,10 @@ Now, once we're done with making the code look _pretty_ in CodePen we can just d
|
||||
|
||||
## Paletton
|
||||
A good place to grab some colours that go well together is [Paletton][3], For the purposes of this guide however we're only going to pick a primary colour but don't let that stop you from adding a little extra _flare_, pick a colour you like the look of like so:
|
||||

|
||||
{{< image src="images/paletton1.png" title="Paletton Colour Picker">}}
|
||||
|
||||
Then, once you're happy with your colourcscheme - go to the export and select _as CSS_:
|
||||

|
||||
{{< image src="images/export_as_css.png" title="Export - listing colours that go well together">}}
|
||||
Don't worry if the export doesn't work, as all the relevant colour information (Hex values) can be grabbed right off this page too!
|
||||
You should end up with something like this in your `style.css` file:
|
||||
```css
|
||||
|
||||
|
Before Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 57 KiB After Width: | Height: | Size: 57 KiB |
|
Before Width: | Height: | Size: 53 KiB After Width: | Height: | Size: 53 KiB |
|
Before Width: | Height: | Size: 236 KiB After Width: | Height: | Size: 236 KiB |
|
Before Width: | Height: | Size: 346 KiB After Width: | Height: | Size: 346 KiB |
@@ -9,7 +9,7 @@ tags:
|
||||
draft: false
|
||||
author: Paul Williams
|
||||
author_email: phyushin@gmail.com
|
||||
listing_image: hackbot.jpg
|
||||
listing_image: images/hackbot.jpg
|
||||
---
|
||||
|
||||
## The Beginning
|
||||
@@ -90,7 +90,7 @@ if uart.any(): #Checking if data available
|
||||
```
|
||||
Below is the initial schematic:
|
||||
|
||||
{{< image src="initial_schematic.png" height="x400" title="The prototype" >}}
|
||||
{{<image src="images/initial_schematic.png" title="The prototype">}}
|
||||
|
||||
As you can see above, this is roughly how the prototype fit together ... you connected to the bluetooth module, send the correct commands, the pico reads them over _[uart][7]_ and calls the respective functions... well that was the plan at least - it turns out that iOS devices don't work as _out of the box_ as android devices when it comes to serial over bluetooth shenanigans, so back to the drawing board on how we get the signals - after all it's no good to us if only some kids can use it! the idea was it could be done all by your phone.
|
||||
|
||||
@@ -109,8 +109,7 @@ With our Pico W wired in we needed to make some modifications to the program run
|
||||
The main change is that instead of using bluetooth to communicate over serial we're now using the web server (this means upgrading to the Pico W for it's handy wireless functionality) to do the _talking_ and we just interact with _it_
|
||||
|
||||
Below is a very basic sequence diagram of how this works - did I mention it was basic?
|
||||
|
||||

|
||||
{{<image src="images/basic_phone_to_bot_comms.png" title="Basic Sequence Diagram of the communication from phone to the _bot_">}}
|
||||
|
||||
Now that we've got the idea for how the communication works we can start to build the web _frontend_ for our bot... Keeping in mind that all the control functionality we already have from the `MK I` to `MK III` we just need to change the way the Pico [W now that we've _upgraded_] gets the instructions to _call_ the functions we need, we can think of this somewhat like the _frontend_ and _backend_ of any other web app really!
|
||||
|
||||
@@ -152,8 +151,7 @@ print('Connection successful')
|
||||
print(ap.ifconfig())
|
||||
```
|
||||
If your Pico is powered, you should now see it broadcasting an SSID like this:
|
||||
|
||||

|
||||
{{ <image src="images/Wifi.png" title="Hackbots Wifi AP"> }}
|
||||
|
||||
Fantastic!
|
||||
|
||||
|
||||
|
Before Width: | Height: | Size: 346 KiB |