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
#coding:utf-8 | |
""" | |
Written on a Windows 10 Laptop, Python 2.7.14 Version. | |
This program automatically detects and lists ports. | |
Written by Davis, Tseng 10/03/2017. | |
""" | |
# import serial |
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
#coding:utf-8 | |
""" | |
Written on a Windows 10 / MacOS Sierra Laptop, Python 2.7.14 Version. | |
This program automatically detects and lists ports. | |
Written by Davis, Tseng 10/03/2017. | |
""" | |
# import serial | |
import serial.tools.list_ports |
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
import sys | |
site_packages = next(p for p in sys.path if 'site-packages' in p) | |
print site_packages |
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
{ | |
"extensionName": "BBC micro:bit Extension", | |
"extensionPort": 54321, | |
"url": "https://github.com/", | |
"blockSpecs": [ | |
["r", "加速度感應值(mg) x", "acc_x"], | |
["r", "加速度感應值(mg) y", "acc_y"], | |
["r", "加速度感應值(mg) z", "acc_z"], | |
["", "", ""], | |
["r", "方位感應值(°) x", "comp_x"], |
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
# micro:bit for Scratch Extension | |
from microbit import * | |
import music | |
REFRESH = 100 | |
def get_sensor_data(): | |
# Gestures/Accelerometer | |
ax, ay, az = accelerometer.get_x(), accelerometer.get_y(), accelerometer.get_z() |
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/local/bin/python | |
# -*- coding: utf-8 -*- | |
""" | |
Created on Tue Oct 10 12:49:59 2017 | |
@author: Davis, Tseng @Taiwan | |
Copyright (c) 2017-18 Davis Tseng All right reserved. | |
This program is free software; |
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
' Option Explicit | |
Dim StopReading As Boolean | |
Sub StartBtn_Click() | |
' | |
' StartBtn - Starts reading from the Micro:Bit into the grid | |
' | |
Dim COM_Byte As Byte | |
StopReading = False | |
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
basic.forever(() => { | |
serial.writeString("D:") | |
serial.writeNumber(input.acceleration(Dimension.Strength)) | |
serial.writeString(",") | |
serial.writeNumber(input.lightLevel()) | |
serial.writeString(",") | |
serial.writeNumber(input.compassHeading()) | |
serial.writeString(",") | |
serial.writeNumber(input.temperature()) | |
serial.writeLine("") |
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 "MicroBit.h" | |
MicroBit uBit; | |
int main() { | |
uBit.init(); | |
uBit.display.scroll("NEW PROGRAM"); | |
release_fiber(); | |
} |
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
@echo off | |
rem set the yotta build target | |
yt target bbc-microbit-classic-gcc | |
rem make sure cpp file goes into source dir | |
copy source\examples\bluetooth-eddystone-url\main.cpp source | |
rem and config.json in the microbit-samples dir | |
copy source\examples\bluetooth-eddystone-url\config.json . |
OlderNewer