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
// setting a variable to pin number 13 | |
int tictacPins [] = {2,3,4,5,6,7,8,9,10,11}; // holds pin location of each LED (including the active user one at 0) | |
int userPin = 0; // holds the location on the array where the active user is displayed | |
int winnerPin = 13; // holds number of pin attached to winner notification led | |
int buttonPin = 12; // holds number of pin for button input | |
int potPin = 0; // holds number of pin for the potentionmeter | |
int potRead = 0; // holds the pot value | |
int potRange = 0; // holds the value of the pot range to go from one LED to the next | |
int activeUser = 1; // holds the active user (1 or 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
path_to_file/avrdude -Cpath_to_file/avrdude.conf -v \ | |
-patmega2560 -carduino -D -b 115200 -cstk500v2 \ | |
-P/dev/tty.port_name -Uflash:w:path_to_file/file_name.hex:i |
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
/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/bin/avrdude \ | |
-C/Applications/Arduino.app/Contents/Resources/Java/hardware/tools/avr/etc/avrdude.conf \ | |
-v -patmega2560 -carduino -D -b 115200 -cstk500v2 -P/dev/tty.usbmodem411 \ | |
-Uflash:w:/Developer/_LAB_Projects/prototypes_experiments/Polargraph/arduino_code/polargraph-read-only/embedded/branch/polargraph_server_polarshield/polargraph_server_polarshield.cpp.hex:i |
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 processing.serial.*; | |
import com.rockwellgroup.lab.ecsp5.*; // import the processingECS library | |
ECSConnection pECS; // create a new object - see docs at http://www.ecsTBD.com for more info | |
String ECS_role_name = "forest_input_arduino"; | |
// set the serial port name here, otherwise app will attempt to connect to first serial port | |
String serial_port_name = "411"; | |
boolean serial_connected = false; | |
Serial arduino; |
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 processing.serial.*; | |
import com.rockwellgroup.lab.ecsp5.*; // import the processingECS library | |
ECSConnection pECS; // create a new object - see docs at http://www.ecsTBD.com for more info | |
String ECS_role_name = "forest_output_arduino"; | |
boolean ecs_connected = false; | |
// Create serial object and set the name of the Serial port we want to connect to | |
Serial arduino; | |
String serial_port_name = "641"; |
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 processing.serial.*; | |
import com.rockwellgroup.lab.processingecs.*; // import the processingECS library | |
ProcessingECS pECS; // create a new object - see docs at http://www.ecsTBD.com for more info | |
/** | |
* Maker Faire building sketch | |
* This controls a set of 4 window outputs and reads from 4 inputs | |
*/ | |
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
array = ["testing", "puts", "and", "print"] | |
puts "(1) putting the array: ", array | |
print "(2) printing the array: ", array |
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
num = 31 | |
print "dec: ", num, " hex: ", num.to_s(16), " bin: ", num.to_s(2), "\n" | |
printf "dec: %d hex: %x bin: %08b\n", num, num, num |
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_obj.rewind | |
file_obj.pos = 10 | |
file_obj.seek(30, IO::SEEK_CUR) |
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_obj = File.new(filename [, mode string or options hash]) | |
file_obj = File.open(filename [, mode string or options hash]) | |
File.open(filename [, mode string or options hash]) {|file_obj| block} |