View DynamicTrainMap.lua
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
local gpu = computer.getPCIDevices(findClass("GPU_T1_C"))[1] | |
local screen = component.proxy(component.findComponent(findClass("Build_Screen_C")))[1] | |
if not screen then | |
screen = computer.getPCIDevices(findClass("ScreenDriver_C"))[1] | |
end | |
local station = component.proxy(component.findComponent(findClass("Build_TrainStation_C")))[1] | |
local trains = station:getTrackGraph():getTrains() | |
print("Found", #trains, "trains.") |
View Sample_MMA8452Q_Device.nut
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
// Sample code using MMA8452Q accelerometer | |
// Electric Imp Device Squirrel code | |
// License: | |
// This code is provided under the Creative Commons Attribution-ShareAlike 3.0 License | |
// http://creativecommons.org/licenses/by-sa/3.0/us/legalcode | |
// If you find bugs report to duppypro on github or @duppy #MMA8452Q on twitter | |
// If you find this useful, send a good word to @duppy #MMA8452Q | |
// Thanks to @jayrz for finding the first bug. | |
///////////////////////////////////////////////// |