This file contains hidden or 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 mraa | |
| import time | |
| # Motor parameters. Set to 1 or -1 to change default direction | |
| dirA = 1 | |
| dirB = 1 | |
| # PWM A (pin 12) is on pin 20 in MRAA | |
| pwmA = mraa.Pwm(20) | |
| pwmA.period_us(1000) |
This file contains hidden or 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 cv2 | |
| # Debugging options | |
| SHOW_IMAGE = True | |
| VERBOSE = True | |
| # HSV color thresholds for YELLOW | |
| THRESHOLD_LOW = (15, 215, 50); | |
| THRESHOLD_HIGH = (35, 255, 255); |
This file contains hidden or 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
| /** | |
| * Prop Shield Demo | |
| * Author: Shawn Hymel | |
| * Date: August 31, 2016 | |
| * | |
| * Description: | |
| * Connect a single WS2812B to the LED output on the Prop Shield | |
| * and a >2W speaker to the +/- speaker output. Attach the shield | |
| * to a Teensy 3.2 and run the NXPMotionSense calibration sketch |
This file contains hidden or 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
| from microbit import * | |
| while True: | |
| if button_a.is_pressed(): | |
| display.scroll("A") | |
| elif button_b.is_pressed(): | |
| display.scroll("B") | |
| else: | |
| display.show(Image.HAPPY) |
This file contains hidden or 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
| from microbit import * | |
| while True: | |
| if button_a.is_pressed(): | |
| if button_b.is_pressed(): | |
| display.show(Image.CONFUSED) | |
| else: | |
| display.show(Image.HAPPY) | |
| elif button_b.is_pressed(): | |
| display.show(Image.SAD) |
This file contains hidden or 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
| from microbit import * | |
| while True: | |
| if button_a.is_pressed(): | |
| display.show(Image.HAPPY) | |
| elif button_b.is_pressed(): | |
| display.show(Image.SAD) | |
| else: | |
| display.show(Image.MEH) |
This file contains hidden or 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
| /** | |
| * 8-Channel Multiplexer Demo | |
| * August 16, 2016 | |
| * License: Public Domain | |
| * | |
| * Show PWM on 8 LEDs using 4 I/O pins and an analog input to | |
| * adjust the PWM period. | |
| * | |
| * Hardware: | |
| * Mux | Trimpot | Arduino |
This file contains hidden or 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
| from microbit import * | |
| while True: | |
| display.scroll("Hello!") |
This file contains hidden or 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
| from microbit import * | |
| while True: | |
| display.scroll("Shawn") |
This file contains hidden or 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
| #define LED_N_SIDE 2 | |
| #define LED_P_SIDE 3 | |
| #define EMITTER 12 | |
| #define LED 13 | |
| #define CAL_N 100 | |
| // Global variables | |
| unsigned int threshold = 0; | |
| void setup() { |