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 pygame as pg | |
import sys | |
from collections import deque | |
WALL = 1 | |
PATH = 0 | |
VISITING = 2 | |
DONE = 3 | |
VISITED = 4 |
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 pprint | |
from collections import deque | |
import os | |
import time | |
X_MARK = "X" | |
def solve(inp_array): | |
rows = len(inp_array) |
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
#include <mraa.h> | |
#include <signal.h> | |
#define PWM_PIN 5 /**< The pin where the LED is connected */ | |
volatile int keepRunning; | |
/** Signal handler used to stop this application cleanly */ | |
void handler(int arg) |
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
/** | |
* | |
* This is a 'c' program that demos the usage of the mraa library | |
* to blink an LED connected to port D5 on Intel Edison/Galileo | |
* | |
* setup: | |
* The LED is connected to port D5 | |
* | |
* Compilation: | |
* gcc -o blink blinky.c -lmraa |
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
#!/usr/bin/python | |
import pyupm_grove | |
import mraa | |
import time | |
import sys | |
""" | |
This script demonstrates the usage of the light sensor using upm |
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
# Build the "core libraray" for compiling arduino on Edison | |
#board = "Galileo Gen2" | |
#board = "Galileo" | |
board = "Edison" | |
options = "-m32 -march=i586 -c -g -Os -w -fno-exceptions -ffunction-sections -fdata-sections -MMD -D__ARDUINO_X86__ -Xassembler -march=i586 -m32 -DARDUINO=153" | |
output = "-Os -Wl,--gc-sections -march=i586" | |
if board == "Edison": |
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 pyupm_grove # Get the UPM library | |
# Create the temperature sensor object | |
temp = pyupm_grove.GroveTemp(1) | |
# Use "value" method on it to get the temperature | |
print "Temperature now is " + str(temp.value()) |
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
#!/usr/bin/python | |
import mraa | |
import time | |
import math | |
# More info here -> http://www.seeedstudio.com/wiki/Grove_-_Temperature_Sensor | |
B=3975 | |
ain = mraa.Aio(1) |
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
#!/usr/bin/python | |
import mraa | |
import time | |
PWM_PIN = 5 | |
ADC_PIN = 0 # Analog in pin | |
ROT_MAX = 1024.0 # Max value as measured by ADC when pot is connected | |
# Set up the PWM |
NewerOlder