This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# Copyright 2017 Google Inc. | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
let item = 0 | |
input.onButtonPressed(Button.B, () => { | |
pins.digitalWritePin(DigitalPin.P13, 1) | |
item = 1 | |
basic.showIcon(IconNames.Yes) | |
}) | |
input.onButtonPressed(Button.A, () => { | |
music.playTone(440, music.beat(BeatFraction.Sixteenth)) | |
item = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Running implements Runnable { | |
private Thread t; | |
private String name; | |
Running( String threadName) { | |
name = threadName; | |
} | |
public void run() { | |
//String name = "A"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_GFX.h> // Core graphics library | |
#include <Adafruit_ST7735.h> // Hardware-specific library for ST7735 | |
#include <Adafruit_ST7789.h> // Hardware-specific library for ST7789 | |
#include <SPI.h> | |
#ifdef ADAFRUIT_HALLOWING | |
#define TFT_CS 39 // Hallowing display control pins: chip select | |
#define TFT_RST 37 // Display reset | |
#define TFT_DC 38 // Display data/command select | |
#define TFT_BACKLIGHT 7 // Display backlight pin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_NeoPixel.h> | |
#ifdef __AVR__ | |
#include <avr/power.h> // Required for 16 MHz Adafruit Trinket | |
#endif | |
#define PIN 0 | |
#define LEDS 60 | |
#define LED_WIDTH 6 | |
#define LED_HEIGHT 10 | |
Adafruit_NeoPixel pixels(LEDS, PIN, NEO_GRB + NEO_KHZ800); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
echo 'sh RotatePiTFT.sh (rotation 0,90,180,270)' | |
if [$1 == '']; then | |
echo "Rotation (0,90,180,270):" | |
read rotation | |
else | |
rotation=$1 | |
echo Rotation: | |
echo $rotation | |
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Make sure to set up your imports properly before this | |
public class BLEClient { | |
private final static String TAG = BLEClient.class.getSimpleName(); | |
public Context context; | |
private String mDeviceName; | |
private String mDeviceAddress; | |
private BluetoothLeService bluetoothService; | |
private ArrayList<ArrayList<BluetoothGattCharacteristic>> mGattCharacteristics = | |
new ArrayList<ArrayList<BluetoothGattCharacteristic>>(); |