Skip to main content

Posts

PS3 Controller to move a USB Robot Arm

Guest Blogger Hiren Mistry, Nuffield Research Placement Student working at the University of Northampton. How to use a PS3 Controller to move a USB Robot Arm on a Raspberry Pi By Hiren Mistry This program enables the user to control the robot arm via a PlayStation 3 Controller, through USB connection. Requirements: ·        PyUSB- This must be installed so the Python Code can interact with the USB Robot Arm. It can be downloaded from https://sourceforge.net/projects/pyusb/files/PyUSB%201.0/1.0.0/pyusb-1.0.0.tar.gz/download ·        PyGame- This module is needed to receive input from the PS3 controller. It can be downloaded from http://www.pygame.org/download.shtml   How does it Work? To receive the input from the controller PyGame is used. PyGame is a set of modules used for writing games and contains the necessary modules need to receive the PlayStation controller input. The input consists of...

kitronik :Move mini buggy (Python control of LEDs)

In two previous posts I looked at control the :Move buggy using JavaScript Blocks or Python . In this post we are going to look at controlling the LEDs using Python (or more accurately micropython). Pin 0 controls the LEDs, they are based on 5   NeoPixel compatible,  RGB, addressable LEDs; so the Neopixel protocols (and library for Neopixels) can be used.  Code First five colours of the rainbow. The array lig  holds the RGB settings for the rainbow colours (more details on the RGB colours can be found at  Lorraine Underwood 's Halloween Cloud project ). In the code below, the five LEDs have a different colour allocated to them. from microbit import * import neopixel np = neopixel.NeoPixel(pin0, 5) lig=[[255,0,0],[255,127,0],[255,255,0],[0,255,0],[0,0,255],[75,0,136],[139,0,255]] while True:     np[0] = lig[0]     np[1] = lig[1]     np[2] = lig[2]     np[3] = lig[3] ...

kitronik :Move buggy (Python controlled servos)

In a previous post I looked at controlling the Kitronik :Move buggy using Javascript based blocks . In this short post I will show  controlling the servos of the micro:bit based :Move buggy with Python. Control is via pin1(left motor) and pin2 (right motor) and the motors have to be driven in opposite directions to move forward or backwards. The direction of the motors is controlled by the analogue value written to the pins;   pinX.write_analog(180) - anticlockwise or  pinX.write_analog(1) - clockwise ( pinX.write_analog(0) - stops the motor). Setting the analog_period seems to work at 20ms; this was found by experiment, discussed in a previous post . So the initial code below sets up the moves for forward, backward, turn left, turn right all controlled with a move for so many milliseconds. Code  from microbit import * pin1.set_analog_period(20) pin2.set_analog_period(20) def forward(N):     pin1.write_analog(180...

kitronik :Move mini buggy (JavaScript blocks)

Finally got around to building add playing with the Kitronik :Move  https://www.kitronik.co.uk/5624-move-mini-buggy-kit-excl-microbit.html  (see below - I decided to put the green sides on the outside - just to be different). One of its features is a vertical set of holes for a pen to be placed in. Add the blocks (found at  https://github.com/KitronikLtd/pxt-kitronik-servo-lite ) in blocks editor ( https://makecode.microbit.org/ )  to control the motors. You can do the same thing with writing to the pins,  t hose instructions come with the build instructions, but using the extra blocks  is a little easier to understand. Also add the package for neopixels (type in neopixels  in the search box to find them). Two very good tutorials I found useful to start with can be found at: Neopixels on the robot  in blocks - https://www.kitronik.co.uk/blog/using-kitronik-zip-leds-bbc-microbit/ Servos on the robot in blocks -  ht...

genetic algorithms to select filters for evoked potential enhancement

Use of evolutionary algorithms to select filters for evoked potential enhancement Scott Turner University of Leicester Published: 2000 http://hdl.handle.net/2381/29366 DOI: 10.13140/RG.2.1.3654.3204 Abstract Evoked potentials are electrical signals produced by the nervous system in response to a stimulus. In general these signals are noisy with a low signal to noise ratio. The aim was to investigate ways of extracting the evoked response within an evoked potential recording, achieving a similar signal to noise ratio as conventional averaging but with less repetitions per average. In this thesis, evolutionary algorithms were used in three ways to extract the evoked potentials from a noisy background. First, evolutionary algorithms selected the cut-off frequencies for a set of filters. A different filter or filter bank was produced for each data set. The noisy signal was passed through each filter in a bank of filters the filter bank output was a weighted sum of the individ...

Cozmo, Ohbot go to Code Club

I have recently taken two robots to a Code Club, here are a couple of reflections/observations. Cozmo This robot produced by Anki is incredibly cute - a cross between Wall-E and a pet in some respects. The code below was produced by the 'Code-Clubbers' and gets Cozmo to speak move around and operate its forks at the front. Anecdotally, someone was trying to work on something but couldn't resist coming and having another look at what it was doing. Ohbot Ohbot provided a different opportunity to play with a robot, getting to move the mouth, speak and track faces. My first impression was some of the children were a bit wary, until they found out they could control what it says and that seemed to break the ice. All opinions in this blog are the Author's and should not in any way be seen as reflecting the views of any organisation the Author has any association with. Twitter @scottturneruon