Reading Serial data from a Raspberry Pi Pico

This post documents what I did to get serial data from my Pico to be stored/displayed on my PC (which could equally be a full Raspberry Pi)

The reason for this is that I have lots of cool components from my Maker Advent Calendar (sensors, screen, lights etc) and while they work nicely just on the Pico if I wanted them to save the data somewhere so I can display them on a web site you can’t do that in micropython – or so I thought. Read more…

Getting a servo to turn on RPi 400

Thing I have learned:

  1. You don’t need a separate battery pack to power this continuous servo FS90R. You can power it from the 5V pin on the RPi
  2. I need to remember how breadboards work! The valley down the middle is NOT connected underneath
  3. I’m still not sure how pulse width modulation works so can’t control the turning well yet

Pics to follow soon

Useful link: https://stackoverflow.com/questions/45150825/control-continuous-servo-motor-with-raspberry-pi-and-python

Code:

import RPi.GPIO as GPIO
import time
GPIO.setmode(GPIO.BCM)
GPIO.setup(17, GPIO.OUT)
p = GPIO.PWM(17, 50)
p.start(7.5)
try:
  while True:
    p.ChangeDutyCycle(7.5)
    time.sleep(1)
    p.ChangeDutyCycle(12.5)
    time.sleep(1)
    p.ChangeDutyCycle(2.5)
    time.sleep(1)

except KeyboardInterrupt:
  GPIO.cleanup()
 Read more...

How to embed links from Repl.it

Add a custom HTML block

Then use an iframe with the following format

<iframe frameborder="0" width="100%" height="500px" src="https://replit.com/@USERNAME/demo-embed?embed=true"></iframe>