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
/* | |
Energia Porgram to Control the MSP430 Robot | |
Exercise 1. | |
*/ | |
#define FWD HIGH | |
#define BKW LOW | |
int fadeAmount = 5; // how many points to fade the LED by |
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
/* | |
MSP430 Robot Control | |
*/ | |
#define FWD HIGH | |
#define BKW LOW | |
int fadeAmount = 5; // how many points to fade the LED by |
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 for Chassis | |
/* ********* | |
usage: | |
chassis obj(P1_0, P1_6, P1_2, P1_1); // This creates an object for the chassis class | |
chassis obj(A1, A0, A2, A3); | |
chassis obj(P1_0, P1_6, P1_2, P1_1, 127); |
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
/* | |
http://stackoverflow.com/questions/1371460/state-machines-tutorials/1371654#1371654 | |
State machines are very simple in C if you use function pointers. | |
Basically you need 2 arrays - one for state function pointers and one for state | |
transition rules. Every state function returns the code, you lookup state | |
transition table by state and return code to find the next state and then | |
just execute it. | |
*/ |
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
var noble = require('noble'); | |
var ble_UUID =['171a3182907143bfb53a1689b132a533', '9d0bfe96c7bb46c59b35d9abc398c587']; // add your UUIDs to this list... | |
var ble_serices = 'ffb0'; | |
var red_char = 'ffb1'; | |
var green_char = 'ffb2'; | |
var blue_char = 'ffb3'; | |
var white_char = 'ffb4'; | |
var R=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
var noble = require('noble'); | |
var scanningTimeout = 2000; // one second | |
var scanningRepeat = scanningTimeout + 8000; // Repeat scanning after 10 seconds for new peripherals. | |
noble.on('stateChange', function(state) { | |
if (state === 'poweredOn') { | |
// | |
// Once the BLE radio has been powered on, it is possible | |
// to begin scanning for services. Pass an empty array to | |
// scan for all services (uses more time and power). |
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
""" | |
@file bbc_recieve | |
@brief BBC microbit Receiver By Inderpreet Singh | |
""" | |
import radio | |
import random | |
from microbit import display, Image, button_a, sleep | |
radio.on() |
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
""" | |
@file bbc_tx | |
@brief BBC microbit Receiver By Inderpreet Singh | |
""" | |
import radio | |
import random | |
from microbit import * #import display, Image, button_a, sleep, button_b, | |
music = False | |
lights = 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
#!/usr/bin/env python | |
import visa | |
rm = visa.ResourceManager() | |
rm.list_resources() | |
inst = rm.open_resource('TCPIP0::192.168.5.185::5025::SOCKET') | |
# print(inst.query("*IDN?")) |
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/python3 | |
# Import statements for libraries | |
import time | |
import MySQLdb | |
# Variable placeholders | |
Done = False |
OlderNewer