October 2017

Buggy from Mikroe

Buggy Mikroe

Buggy Link

Sensehat

from sense_hat import SenseHAT

sense = SenseHAT()
sense.set_rotation(180)

message = "Raspberry Pi SIG"

yellow = [255,255,0]
red = [255, 0, 0]

speed = 0.1

while True:
    sense.show_message(text_string=message, scroll_speed=speed, text_color=yellow, back_color=red)

Python

print("hello")
print(type("hello"))
print(dir("hello"))
print("hello".upper())
import builtins
print(builtins)
dir(builtins)

Micropython for ESP8266

Micropython for ESP8266

I2C in NodeRED/python/command line

Tested using a 16-bit I/O expander MCP23017

NodeRED

Install node-red-contrib-i2c using ‘Manage Palette’

Nodered I2C Nodered I2C Nodered I2C

Python
from smbus import SMBus

bus = SMBus(1)

bus.write_data_byte(0x20, 0x14, 0xff)
bus.read_data_byte()

bus.write_data_byte(0x20, 0x14, 0x00)
bus.read_data_byte()