Skip to main content

Posts

Showing posts with the label rainbow

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] ...

Playing with Ozobot Bit and Blockly

Previously I discussed the older Ozobot that were programmed by colours on paper or made to dance via an App. The newer Ozobot Bit still can be used in these ways but also can be programmed using a Blockly web-based interface at  http://ozoblockly.com/editor , so are now programmable on tablets, but also PC, Macs, essentially anything that can run the webpage. First stage is the calibration of the 'bot' 1. Hold the power button on the ozobot until it starts flashing with a white light. 2. Move to the white space that is similar to the bottom of the Ozobot, the wheels might start moving but as you get closer to the space they should stop. 3. The Ozobot should start flashing green - that is ok continue holding the ozobot to the screen until it stops flashing green - if it flashes red start again. Build your code blocks and when you are ready press the power button on the Ozobot. Hold the ozobot against the white space again and holding it there press the load bu...