Browsing Tag

Codebug

Random dice example for a codebug

A random dice example for a codebug Code Python # To run this code on CodeBug, visit: # # http://www.codebug.org.uk/learn/activity/66/tethering-codebug-with-python/#step585 # import codebug_tether from codebug_tether import (IO_DIGITAL_OUTPUT, IO_DIGITAL_INPUT, IO_PWM_OUTPUT, IO_ANALOG_INPUT) import random from codebug_tether.sprites import Sprite random_number = None codebug = codebug_tether.CodeBug() codebug.set_leg_io(0, IO_DIGITAL_INPUT); codebug.set_leg_io(1, IO_DIGITAL_INPUT); codebug.set_leg_io(2,…

Scrolling text on a Codebug

In this example we will display some of the scrolling text examples on a  codebug, these are easy to create Code Python # To run this code on CodeBug, visit: # # http://www.codebug.org.uk/learn/activity/66/tethering-codebug-with-python/#step585 # import codebug_tether from codebug_tether import (IO_DIGITAL_OUTPUT, IO_DIGITAL_INPUT, IO_PWM_OUTPUT, IO_ANALOG_INPUT) from codebug_tether.sprites import StringSprite codebug = codebug_tether.CodeBug() codebug.set_leg_io(0, IO_DIGITAL_INPUT); codebug.set_leg_io(1, IO_DIGITAL_INPUT);…

Happy or Sad face on Codebug

Lets press a button and then display a happy face with button A pressed and a sad face if button B is pressed Code Python Code # To run this code on CodeBug, visit: # # http://www.codebug.org.uk/learn/activity/66/tethering-codebug-with-python/#step585 # import codebug_tether from codebug_tether import (IO_DIGITAL_OUTPUT, IO_DIGITAL_INPUT, IO_PWM_OUTPUT, IO_ANALOG_INPUT) from codebug_tether.sprites import Sprite display = None display_1 = None codebug = codebug_tether.CodeBug() codebug.set_leg_io(0, IO_DIGITAL_INPUT);…

Magic 8 ball on a Codebug example

This is magic 8 ball running on a codebug CodeBug™ is a fun, engaging, entry level introduction to simple programming and electronic concepts to anyone, at any age. It is easy to program using the online interface, which features colourful drag and drop blocks, an in-browser emulator and engaging community features. It enables you to create your own games, clothes, robots or whatever other inventions you have in mind. Plugs onto Raspberry Pi GPIO as an add-on Starting point for Internet of Things devices Versatile I/O…