From 260c5d5ee1983fcb45ce0a8c1017d975ae6ad79d Mon Sep 17 00:00:00 2001 From: "David A. Mellis" Date: Wed, 26 Apr 2006 11:09:43 +0000 Subject: [PATCH] Committing individual examples instead of one .zip --- .../macosx/Arduino.xcodeproj/project.pbxproj | 20 +- build/macosx/make.sh | 7 +- build/shared/dist/examples.zip | Bin 42054 -> 0 bytes .../digital IO/digital_read/digital_read.pde | 31 +++ .../digital_read_and_blink.pde | 24 +++ .../dist/examples/lcd/lcd_8bits/lcd_8bits.pde | 110 ++++++++++ .../dist/examples/led_blink/led_blink.pde | 28 +++ .../knight_rider_1/knight_rider_1.pde | 86 ++++++++ .../knight_rider_2/knight_rider_2.pde | 46 +++++ .../knight_rider_3/knight_rider_3.pde | 51 +++++ .../led_drivers/max7219_v1/max7219_v1.pde | 194 ++++++++++++++++++ .../leds/led_drivers/shift_out/shift_out.pde | 79 +++++++ .../examples/motors/dc_motor/dc_motor.pde | 36 ++++ .../motors/dc_two_motors/dc_two_motors.pde | 121 +++++++++++ .../stepper_unipolar/stepper_unipolar.pde | 57 +++++ .../stepper_unipolar_advanced.pde | 73 +++++++ .../processing_send_potentiometer.pde | 42 ++++ .../program_template/program_template.pde | 29 +++ .../PD_inputs_to_PD/PD_inputs_to_PD.pde | 71 +++++++ .../PD_send_potentiometer.pde | 37 ++++ .../PD_two_potentiometers.pde | 31 +++ .../keyboard_serial/keyboard_serial.pde | 60 ++++++ .../keyboard_serial_faded_volume.pde | 62 ++++++ .../pwm_sound/play_melody/play_melody.pde | 67 ++++++ .../pwm_sound/play_melody_2/play_melody_2.pde | 67 ++++++ .../play_melody_faded_volume.pde | 69 +++++++ .../accelerometer_memsic2125.pde | 91 ++++++++ .../ultrasound_PING/ultrasound_PING.pde | 73 +++++++ .../analog_read_led/analog_read_led.pde | 29 +++ .../knock_sensor/knock_sensor.pde | 37 ++++ .../read_joystick/read_joystick.pde | 54 +++++ .../analog_read_send/analog_read_send.pde | 32 +++ .../double_counter/double_counter.pde | 37 ++++ .../serialCom_strings/serialCom_strings.pde | 86 ++++++++ .../serial_read_advanced.pde | 43 ++++ .../serial_read_basic/serial_read_basic.pde | 35 ++++ .../serial_write_basic/serial_write_basic.pde | 40 ++++ build/windows/make.sh | 17 +- readme.txt | 1 + 39 files changed, 2057 insertions(+), 16 deletions(-) delete mode 100644 build/shared/dist/examples.zip create mode 100644 build/shared/dist/examples/digital IO/digital_read/digital_read.pde create mode 100644 build/shared/dist/examples/digital IO/digital_read_and_blink/digital_read_and_blink.pde create mode 100644 build/shared/dist/examples/lcd/lcd_8bits/lcd_8bits.pde create mode 100644 build/shared/dist/examples/led_blink/led_blink.pde create mode 100644 build/shared/dist/examples/leds/knight_rider/knight_rider_1/knight_rider_1.pde create mode 100644 build/shared/dist/examples/leds/knight_rider/knight_rider_2/knight_rider_2.pde create mode 100644 build/shared/dist/examples/leds/knight_rider/knight_rider_3/knight_rider_3.pde create mode 100644 build/shared/dist/examples/leds/led_drivers/max7219_v1/max7219_v1.pde create mode 100644 build/shared/dist/examples/leds/led_drivers/shift_out/shift_out.pde create mode 100644 build/shared/dist/examples/motors/dc_motor/dc_motor.pde create mode 100644 build/shared/dist/examples/motors/dc_two_motors/dc_two_motors.pde create mode 100644 build/shared/dist/examples/motors/stepper_unipolar/stepper_unipolar.pde create mode 100644 build/shared/dist/examples/motors/stepper_unipolar_advanced/stepper_unipolar_advanced.pde create mode 100644 build/shared/dist/examples/processing/processing_send_potentiometer/processing_send_potentiometer.pde create mode 100644 build/shared/dist/examples/program_template/program_template.pde create mode 100644 build/shared/dist/examples/puredata/PD_inputs_to_PD/PD_inputs_to_PD.pde create mode 100644 build/shared/dist/examples/puredata/PD_send_potentiometer/PD_send_potentiometer.pde create mode 100644 build/shared/dist/examples/puredata/PD_two_potentiometers/PD_two_potentiometers.pde create mode 100644 build/shared/dist/examples/pwm_sound/keyboard_serial/keyboard_serial.pde create mode 100644 build/shared/dist/examples/pwm_sound/keyboard_serial_faded_volume/keyboard_serial_faded_volume.pde create mode 100644 build/shared/dist/examples/pwm_sound/play_melody/play_melody.pde create mode 100644 build/shared/dist/examples/pwm_sound/play_melody_2/play_melody_2.pde create mode 100644 build/shared/dist/examples/pwm_sound/play_melody_faded_volume/play_melody_faded_volume.pde create mode 100644 build/shared/dist/examples/sensors_complex/accelerometer_memsic2125/accelerometer_memsic2125.pde create mode 100644 build/shared/dist/examples/sensors_complex/ultrasound_PING/ultrasound_PING.pde create mode 100644 build/shared/dist/examples/sensors_resistive/analog_read_led/analog_read_led.pde create mode 100644 build/shared/dist/examples/sensors_resistive/knock_sensor/knock_sensor.pde create mode 100644 build/shared/dist/examples/sensors_resistive/read_joystick/read_joystick.pde create mode 100644 build/shared/dist/examples/serial_comm/analog_read_send/analog_read_send.pde create mode 100644 build/shared/dist/examples/serial_comm/double_counter/double_counter.pde create mode 100644 build/shared/dist/examples/serial_comm/serialCom_strings/serialCom_strings.pde create mode 100644 build/shared/dist/examples/serial_comm/serial_read_advanced/serial_read_advanced.pde create mode 100644 build/shared/dist/examples/serial_comm/serial_read_basic/serial_read_basic.pde create mode 100644 build/shared/dist/examples/serial_comm/serial_write_basic/serial_write_basic.pde diff --git a/build/macosx/Arduino.xcodeproj/project.pbxproj b/build/macosx/Arduino.xcodeproj/project.pbxproj index b5a2c1045..bb28e79a1 100644 --- a/build/macosx/Arduino.xcodeproj/project.pbxproj +++ b/build/macosx/Arduino.xcodeproj/project.pbxproj @@ -39,6 +39,7 @@ 33FFFE1D0965BC050016AC38 /* CopyFiles */, 33FF070C0965BF760016AC38 /* CopyFiles */, 33FF07130965BFA80016AC38 /* CopyFiles */, + 336EA3E309FF84FA0052D765 /* CopyFiles */, 33FF071D0965C1C20016AC38 /* CopyFiles */, 33FF07170965BFFE0016AC38 /* ShellScript */, ); @@ -154,6 +155,7 @@ /* Begin PBXBuildFile section */ 330B21540968180400345666 /* librxtxSerial.jnilib in CopyFiles */ = {isa = PBXBuildFile; fileRef = 330B21530968180400345666 /* librxtxSerial.jnilib */; }; 332D4DB609CF147F00BF81F6 /* Sizer.java in Sources */ = {isa = PBXBuildFile; fileRef = 332D4DB509CF147F00BF81F6 /* Sizer.java */; }; + 336EA55B09FF87F60052D765 /* examples in CopyFiles */ = {isa = PBXBuildFile; fileRef = 336EA4DB09FF87E30052D765 /* examples */; }; 339514EE097AEB5900193C89 /* STDCTokenTypes.txt in Resources */ = {isa = PBXBuildFile; fileRef = 33FFFE420965BD110016AC38 /* STDCTokenTypes.txt */; }; 339514FA097AEB8000193C89 /* license.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02B60965BD170016AC38 /* license.txt */; }; 339514FB097AEB8000193C89 /* readme.txt in CopyFiles */ = {isa = PBXBuildFile; fileRef = 33FF02B70965BD170016AC38 /* readme.txt */; }; @@ -288,6 +290,16 @@ /* End PBXContainerItemProxy section */ /* Begin PBXCopyFilesBuildPhase section */ + 336EA3E309FF84FA0052D765 /* CopyFiles */ = { + isa = PBXCopyFilesBuildPhase; + buildActionMask = 2147483647; + dstPath = ""; + dstSubfolderSpec = 16; + files = ( + 336EA55B09FF87F60052D765 /* examples in CopyFiles */, + ); + runOnlyForDeploymentPostprocessing = 0; + }; 33CF03C809662DA200F2C9A9 /* CopyFiles */ = { isa = PBXCopyFilesBuildPhase; buildActionMask = 2147483647; @@ -369,6 +381,7 @@ 330B21530968180400345666 /* librxtxSerial.jnilib */ = {isa = PBXFileReference; lastKnownFileType = "compiled.mach-o.bundle"; path = librxtxSerial.jnilib; sourceTree = ""; }; 332D4DB509CF147F00BF81F6 /* Sizer.java */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.java; path = Sizer.java; sourceTree = ""; }; 333269E1099BB1FC007D3AE2 /* tools.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = tools.zip; sourceTree = ""; }; + 336EA4DB09FF87E30052D765 /* examples */ = {isa = PBXFileReference; lastKnownFileType = folder; path = examples; sourceTree = ""; }; 337CD3F309EFC183002B890C /* fetch.sh */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.script.sh; path = fetch.sh; sourceTree = ""; }; 33AF620A0965D67800B514A9 /* antlr.jar */ = {isa = PBXFileReference; lastKnownFileType = archive.jar; path = antlr.jar; sourceTree = ""; }; 33AF620B0965D67900B514A9 /* applet.html */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = text.html; path = applet.html; sourceTree = ""; }; @@ -382,7 +395,6 @@ 33BEE0CD09D7446100430D5B /* Library.java */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.java; path = Library.java; sourceTree = ""; }; 33CF03B009662CA800F2C9A9 /* arduino.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = arduino.icns; path = dist/arduino.icns; sourceTree = ""; }; 33DD8FB6096AC8DA0013AF8F /* Arduino.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = Arduino.app; sourceTree = BUILT_PRODUCTS_DIR; }; - 33FF01DC0965BD160016AC38 /* examples.zip */ = {isa = PBXFileReference; lastKnownFileType = archive.zip; path = examples.zip; sourceTree = ""; }; 33FF01DE0965BD160016AC38 /* about.jpg */ = {isa = PBXFileReference; lastKnownFileType = image.jpeg; path = about.jpg; sourceTree = ""; }; 33FF02770965BD160016AC38 /* buttons.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = buttons.gif; sourceTree = ""; }; 33FF02780965BD160016AC38 /* icon.gif */ = {isa = PBXFileReference; lastKnownFileType = image.gif; path = icon.gif; sourceTree = ""; }; @@ -561,7 +573,7 @@ 33FF01DB0965BD160016AC38 /* dist */ = { isa = PBXGroup; children = ( - 33FF01DC0965BD160016AC38 /* examples.zip */, + 336EA4DB09FF87E30052D765 /* examples */, ); path = dist; sourceTree = ""; @@ -1057,18 +1069,16 @@ files = ( ); inputPaths = ( - ../shared/dist/examples.zip, ../shared/reference.zip, dist/tools.zip, ); outputPaths = ( $BUILT_PRODUCTS_DIR/tools, - $BUILT_PRODUCTS_DIR/examples, $BUILT_PRODUCTS_DIR/reference, ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "unzip -od $BUILT_PRODUCTS_DIR/examples ../shared/dist/examples.zip\nunzip -od $BUILT_PRODUCTS_DIR ../shared/reference.zip\nunzip -od $BUILT_PRODUCTS_DIR dist/tools.zip"; + shellScript = "unzip -od $BUILT_PRODUCTS_DIR ../shared/reference.zip\nunzip -od $BUILT_PRODUCTS_DIR dist/tools.zip"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/build/macosx/make.sh b/build/macosx/make.sh index 41b5cbba6..86091e1d4 100755 --- a/build/macosx/make.sh +++ b/build/macosx/make.sh @@ -23,7 +23,7 @@ else mkdir -p work/classes/processing/app/syntax mkdir -p work/classes/processing/app/tools mkdir -p work/lib/build - mkdir -p work/examples + #mkdir -p work/examples cp dist/librxtxSerial.jnilib work/ cp -pR dist/drivers work/ @@ -34,8 +34,9 @@ else # cvs doesn't seem to want to honor the +x bit chmod +x work/Arduino.app/Contents/MacOS/JavaApplicationStub - echo Extracting examples... - unzip -d work/examples ../shared/dist/examples.zip + #echo Extracting examples... + #unzip -d work/examples ../shared/dist/examples.zip + cp -pR ../shared/ # copy the avr-gcc distribution echo Copying tools \(this may take a minute\)... diff --git a/build/shared/dist/examples.zip b/build/shared/dist/examples.zip deleted file mode 100644 index 95f8758c7f049c5b4228378ea7c58ac1365c14b0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 42054 zcmeFZWpq{9wk;fYcNd7eyAXGGcefpPAxb<%i4o#LoVW{dAwt}RxVz_tsyY;*>eM~w z-S5Zu<3S7T25t7W_Fkj+(Z?KfY@Nj!KK19rqV%if0$sLKg9Kp zFrvO;bB#a;ll+RRsfa;Mt4nYV6ME)w1uWZ_AjgAmZ8;)@6-l(imJMmdQj2*@fRXxB zkh1ES{dr3vo5M&O9Bx8?9Q=Zl7PAtDi>Zn;0DG$(laA zTsvvO)2h8syKQU$Fi{xwyp^Kf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;@01FvjlEQy)0Zi+(T_8D# z0x6K(X=zE|a~iw(2h(SW|3N(MU!h6h(}Ktxnga9{p$~Fw;Jc(VJ>d)srxq?m=@3W; zcHsg|9e{3&p6k?SiWmNRWY7!zc>O?F0oM=oD@oD+$J80C>Nmk-s}ONUpw=IZqlo?e zT%O4m=qM1WM&R7SZrsrK8<-M6(z6oDBveEB43L1Q8hoN~duH zz%#tk{|+3+7;t7Fl7qmRfsGGr0DH@zIq5TJ1_mEWBkhmOAmVILB2fTK8D0`H|J~Ag z!vJ!INVT2EnH(^ZWzdIPXO0A*`0z)H5P_;JfYuH4A%sf)e*y!H00}_ks?H+-{o1gp z^uO%<($P8l9tNVK1Ec^vlxBE|-u??{014>Z7l@|Lc{G@yo&&Dx|Fi{E-uUA~fk=G- zOZ=q)Rx-S-{-YHjIiPvqN%Ue=z}L5=abE91SD}>mR@~@-m23{|sWk3uXSaOTk|0Lw~Gs zIv*66vVL6VdF+O;SN)J8PhfeTFqCWb|2HErMu9U1DftA>7%VyHQ!TsUxibc=(>w75 zSZ0tyKwu#gFBCJs|6l=V4#){o7I+>fdVs}c(4_IXoS-V1{zwW^ECnpO;0Kt<@ZvT3 z4yKkpl|(C=yB}PuvdSO zG7n%rJ@gc%{xv?VLEscYiavl-bUITX7}%7p|1d?+Y4s-$9g??yjD8%xAzAytY;Nci zWyW8kLmLCKf#mQ5*}y&_=$pVS+dr@Y=C%Sd#?O9AkbH4q%C0EDsWQ9{|C5cg3mM42pjA7ySNBvpky|BtaOM)Cs)_E&ja$AhTa4fwUm$!a!Q56GnkfsN{4$ zEkIW1i6cVNM}dwANgf5J-$8E{S^vSpKg0k=fy^MOq(Ek;lly?oJY3IZ2FSrXAqGkH w0}_KI`TpdZ-#zc+Bq3t$pR3zGJyB!>u=*S&B-1N`p{CAf{Q7v#791NjkKkpKVy diff --git a/build/shared/dist/examples/digital IO/digital_read/digital_read.pde b/build/shared/dist/examples/digital IO/digital_read/digital_read.pde new file mode 100644 index 000000000..8f15d5326 --- /dev/null +++ b/build/shared/dist/examples/digital IO/digital_read/digital_read.pde @@ -0,0 +1,31 @@ +/* Basic Digital Read + * ------------------ + * + * turns on and off a light emitting diode(LED) connected to digital + * pin 13, when pressing a pushbutton attached to pin 7. It illustrates the + * concept of Active-Low, which consists in connecting buttons using a + * 1K to 10K pull-up resistor. + * + * Created 1 December 2005 + * copyleft 2005 DojoDave + * http://arduino.berlios.de + * + */ + +int ledPin = 13; // choose the pin for the LED +int inPin = 7; // choose the input pin (for a pushbutton) +int val = 0; // variable for reading the pin status + +void setup() { + pinMode(ledPin, OUTPUT); // declare LED as output + pinMode(inPin, INPUT); // declare pushbutton as input +} + +void loop(){ + val = digitalRead(inPin); // read input value + if (val == HIGH) { // check if the input is HIGH (button released) + digitalWrite(ledPin, LOW); // turn LED OFF + } else { + digitalWrite(ledPin, HIGH); // turn LED ON + } +} diff --git a/build/shared/dist/examples/digital IO/digital_read_and_blink/digital_read_and_blink.pde b/build/shared/dist/examples/digital IO/digital_read_and_blink/digital_read_and_blink.pde new file mode 100644 index 000000000..6d4dfc0e2 --- /dev/null +++ b/build/shared/dist/examples/digital IO/digital_read_and_blink/digital_read_and_blink.pde @@ -0,0 +1,24 @@ +/* Blink when Digital Read + * ------------------------ + */ + +int ledPin = 13; // choose the pin for the LED +int inPin = 7; // choose the input pin (for a pushbutton) +int val = 0; // variable for reading the pin status + +void setup() { + pinMode(ledPin, OUTPUT); // declare LED as output + pinMode(inPin, INPUT); // declare pushbutton as input +} + +void loop(){ + val = digitalRead(inPin); // read input value + if (val == HIGH) { // check if the input is HIGH (button released) + digitalWrite(ledPin, LOW); // turn LED OFF + } else { + digitalWrite(ledPin, HIGH); // blink the LED and go OFF + delay(200); + digitalWrite(ledPin, LOW); + delay(1000); + } +} diff --git a/build/shared/dist/examples/lcd/lcd_8bits/lcd_8bits.pde b/build/shared/dist/examples/lcd/lcd_8bits/lcd_8bits.pde new file mode 100644 index 000000000..0232c017c --- /dev/null +++ b/build/shared/dist/examples/lcd/lcd_8bits/lcd_8bits.pde @@ -0,0 +1,110 @@ +/* LCD 8bits + * --------- + * + * This is the first example in how to use an LCD screen + * configured with data transfers over 8 bits. The example + * uses all the digital pins on the Arduino board, but can + * easily display data on the display + * + * There are the following pins to be considered: + * + * - DI, RW, DB0..DB7, Enable (11 in total) + * + * the pinout for LCD displays is standard and there is plenty + * of documentation to be found on the internet. + * + * Picture at: + * http://arduino.berlios.de/index.php/Tutorial/LCD8Bits + * + * (cleft) 2005 DojoDave for K3 + * + */ + +int DI = 12; +int RW = 11; +int DB[] = {3, 4, 5, 6, 7, 8, 9, 10}; +int Enable = 2; + +void LcdCommandWrite(int value) { + // poll all the pins + int i = 0; + for (i=DB[0]; i <= DI; i++) { + digitalWrite(i,value & 01); + value >>= 1; + } + digitalWrite(Enable,LOW); + delayMicroseconds(1); + // send a pulse to enable + digitalWrite(Enable,HIGH); + delayMicroseconds(1); // pause 1 ms according to datasheet + digitalWrite(Enable,LOW); + delayMicroseconds(1); // pause 1 ms according to datasheet +} + +void LcdDataWrite(int value) { + // poll all the pins + int i = 0; + digitalWrite(DI, HIGH); + digitalWrite(RW, LOW); + for (i=DB[0]; i <= DB[7]; i++) { + digitalWrite(i,value & 01); + value >>= 1; + } + digitalWrite(Enable,LOW); + delayMicroseconds(1); + // send a pulse to enable + digitalWrite(Enable,HIGH); + delayMicroseconds(1); + digitalWrite(Enable,LOW); + delayMicroseconds(1); // pause 1 ms according to datasheet +} + +void setup (void) { + int i = 0; + for (i=Enable; i <= DI; i++) { + pinMode(i,OUTPUT); + } + delay(100); + // initiatize lcd after a short pause + // needed by the LCDs controller + LcdCommandWrite(0x30); // function set: + // 8-bit interface, 1 display lines, 5x7 font + delay(64); + LcdCommandWrite(0x30); // function set: + // 8-bit interface, 1 display lines, 5x7 font + delay(50); + LcdCommandWrite(0x30); // function set: + // 8-bit interface, 1 display lines, 5x7 font + delay(20); + LcdCommandWrite(0x06); // entry mode set: + // increment automatically, no display shift + delay(20); + LcdCommandWrite(0x0E); // display control: + // turn display on, cursor on, no blinking + delay(20); + LcdCommandWrite(0x01); // clear display, set cursor position to zero + delay(100); + LcdCommandWrite(0x80); // display control: + // turn display on, cursor on, no blinking + delay(20); +} + +void loop (void) { + LcdCommandWrite(0x02); // set cursor position to zero + delay(10); + // Write the welcome message + LcdDataWrite('H'); + LcdDataWrite('o'); + LcdDataWrite('l'); + LcdDataWrite('a'); + LcdDataWrite(' '); + LcdDataWrite('C'); + LcdDataWrite('a'); + LcdDataWrite('r'); + LcdDataWrite('a'); + LcdDataWrite('c'); + LcdDataWrite('o'); + LcdDataWrite('l'); + LcdDataWrite('a'); + delay(500); +} diff --git a/build/shared/dist/examples/led_blink/led_blink.pde b/build/shared/dist/examples/led_blink/led_blink.pde new file mode 100644 index 000000000..afeed87d7 --- /dev/null +++ b/build/shared/dist/examples/led_blink/led_blink.pde @@ -0,0 +1,28 @@ +/* Blinking LED + * ------------ + * + * turns on and off a light emitting diode(LED) connected to a digital + * pin, in intervals of 2 seconds. Ideally we use pin 13 on the Arduino + * board because it has a resistor attached to it, needing only an LED + * + * Created 1 June 2005 + * copyleft 2005 DojoDave + * http://arduino.berlios.de + * + * based on an orginal by H. Barragan for the Wiring i/o board + */ + +int ledPin = 13; // LED connected to digital pin 13 + +void setup() +{ + pinMode(ledPin, OUTPUT); // sets the digital pin as output +} + +void loop() +{ + digitalWrite(ledPin, HIGH); // sets the LED on + delay(1000); // waits for a second + digitalWrite(ledPin, LOW); // sets the LED off + delay(1000); // waits for a second +} diff --git a/build/shared/dist/examples/leds/knight_rider/knight_rider_1/knight_rider_1.pde b/build/shared/dist/examples/leds/knight_rider/knight_rider_1/knight_rider_1.pde new file mode 100644 index 000000000..d99c5847a --- /dev/null +++ b/build/shared/dist/examples/leds/knight_rider/knight_rider_1/knight_rider_1.pde @@ -0,0 +1,86 @@ +/* Knight Rider 1 + * -------------- + * + * Knight Rider is an AI car that showed up in the TV series from + * the 80's with David Hasselhoff. The car had plenty of LED effects. + * + * Basically this is an extension of Blink_LED. This program handles + * 6 LEDs connected to pins 2 to 7. This is the first of a series of + * three examples useful to understand the for(;;) loop + * + * Picture at: + * http://arduino.berlios.de/index.php/Tutorial/KnightRider + * + * (cleft) 2005 K3, Malmo University + * @author: David Cuartielles + * @hardware: David Cuartielles, Aaron Hallborg + */ + +int pin2 = 2; +int pin3 = 3; +int pin4 = 4; +int pin5 = 5; +int pin6 = 6; +int pin7 = 7; +int timer = 100; + +void setup(){ + pinMode(pin2, OUTPUT); + pinMode(pin3, OUTPUT); + pinMode(pin4, OUTPUT); + pinMode(pin5, OUTPUT); + pinMode(pin6, OUTPUT); + pinMode(pin7, OUTPUT); +} + +void loop() { + digitalWrite(pin2, HIGH); + delay(timer); + digitalWrite(pin2, LOW); + delay(timer); + + digitalWrite(pin3, HIGH); + delay(timer); + digitalWrite(pin3, LOW); + delay(timer); + + digitalWrite(pin4, HIGH); + delay(timer); + digitalWrite(pin4, LOW); + delay(timer); + + digitalWrite(pin5, HIGH); + delay(timer); + digitalWrite(pin5, LOW); + delay(timer); + + digitalWrite(pin6, HIGH); + delay(timer); + digitalWrite(pin6, LOW); + delay(timer); + + digitalWrite(pin7, HIGH); + delay(timer); + digitalWrite(pin7, LOW); + delay(timer); + + digitalWrite(pin6, HIGH); + delay(timer); + digitalWrite(pin6, LOW); + delay(timer); + + digitalWrite(pin5, HIGH); + delay(timer); + digitalWrite(pin5, LOW); + delay(timer); + + digitalWrite(pin4, HIGH); + delay(timer); + digitalWrite(pin4, LOW); + delay(timer); + + digitalWrite(pin3, HIGH); + delay(timer); + digitalWrite(pin3, LOW); + delay(timer); +} diff --git a/build/shared/dist/examples/leds/knight_rider/knight_rider_2/knight_rider_2.pde b/build/shared/dist/examples/leds/knight_rider/knight_rider_2/knight_rider_2.pde new file mode 100644 index 000000000..ef1cf1025 --- /dev/null +++ b/build/shared/dist/examples/leds/knight_rider/knight_rider_2/knight_rider_2.pde @@ -0,0 +1,46 @@ +/* Knight Rider 2 + * -------------- + * + * Knight Rider is an AI car that showed up in the TV series from + * the 80's with David Hasselhoff. The car had plenty of LED effects. + * + * Basically this is an extension of Blink_LED. This program handles + * 6 LEDs connected to pins 2 to 7. This is the second of a series of + * three examples useful to understand the for(;;) loop + * + * In this example we declare an array with the pin numbers we use as inputs, + * then we browse the array up and down to turn the different pins on/off + * + * Picture at: + * http://arduino.berlios.de/index.php/Tutorial/KnightRider + * + * (cleft) 2005 K3, Malmo University + * @author: David Cuartielles + * @hardware: David Cuartielles, Aaron Hallborg + */ + +int pinArray[] = {2, 3, 4, 5, 6, 7}; +int count = 0; +int timer = 100; + +void setup(){ + // we make all the declarations at once + for (count=0;count<6;count++) { + pinMode(pinArray[count], OUTPUT); + } +} + +void loop() { + for (count=0;count<6;count++) { + digitalWrite(pinArray[count], HIGH); + delay(timer); + digitalWrite(pinArray[count], LOW); + delay(timer); + } + for (count=5;count>=0;count--) { + digitalWrite(pinArray[count], HIGH); + delay(timer); + digitalWrite(pinArray[count], LOW); + delay(timer); + } +} diff --git a/build/shared/dist/examples/leds/knight_rider/knight_rider_3/knight_rider_3.pde b/build/shared/dist/examples/leds/knight_rider/knight_rider_3/knight_rider_3.pde new file mode 100644 index 000000000..35edadac2 --- /dev/null +++ b/build/shared/dist/examples/leds/knight_rider/knight_rider_3/knight_rider_3.pde @@ -0,0 +1,51 @@ +/* Knight Rider 3 + * -------------- + * + * Knight Rider is an AI car that showed up in the TV series from + * the 80's with David Hasselhoff. The car had plenty of LED effects. + * + * Basically this is an extension of Blink_LED. This program handles + * 6 LEDs connected to pins 2 to 7. This is the third of a series of + * three examples useful to understand the for(;;) loop + * + * In this example we declare an array with the pin numbers we use as inputs, + * then we browse the array up and down to turn the different pins on/off + * + * This example concentrates in making the visuals fluid. + * + * Picture at: + * http://arduino.berlios.de/index.php/Tutorial/KnightRider + * + * (cleft) 2005 K3, Malmo University + * @author: David Cuartielles + * @hardware: David Cuartielles, Aaron Hallborg + */ + +int pinArray[] = {2, 3, 4, 5, 6, 7}; +int count = 0; +int timer = 30; + +void setup(){ + for (count=0;count<6;count++) { + pinMode(pinArray[count], OUTPUT); + } +} + +void loop() { + for (count=0;count<5;count++) { + digitalWrite(pinArray[count], HIGH); + delay(timer); + digitalWrite(pinArray[count + 1], HIGH); + delay(timer); + digitalWrite(pinArray[count], LOW); + delay(timer*2); + } + for (count=5;count>0;count--) { + digitalWrite(pinArray[count], HIGH); + delay(timer); + digitalWrite(pinArray[count - 1], HIGH); + delay(timer); + digitalWrite(pinArray[count], LOW); + delay(timer*2); + } +} diff --git a/build/shared/dist/examples/leds/led_drivers/max7219_v1/max7219_v1.pde b/build/shared/dist/examples/leds/led_drivers/max7219_v1/max7219_v1.pde new file mode 100644 index 000000000..6abfd3427 --- /dev/null +++ b/build/shared/dist/examples/leds/led_drivers/max7219_v1/max7219_v1.pde @@ -0,0 +1,194 @@ +int serialVal = 0; +int value = 0; +int i = 0; +boolean reading = false; +boolean writing = false; +int times = 0; +int serialBuff[7]; + +// define wiring pins +byte pin_max7219_clock = 4; +byte pin_max7219_load = 2; +byte pin_max7219_dataIn = 3; + +// specify wiring pin i/o directions +void setPinModes() +{ + pinMode(pin_max7219_dataIn, OUTPUT); + pinMode(pin_max7219_clock, OUTPUT); + pinMode(pin_max7219_load, OUTPUT); +} + +// define max7219 registers +byte max7219_reg_noop = 0x00; +byte max7219_reg_digit0 = 0x01; +byte max7219_reg_digit1 = 0x02; +byte max7219_reg_digit2 = 0x03; +byte max7219_reg_digit3 = 0x04; +byte max7219_reg_digit4 = 0x05; +byte max7219_reg_digit5 = 0x06; +byte max7219_reg_digit6 = 0x07; +byte max7219_reg_digit7 = 0x08; +byte max7219_reg_decodeMode = 0x09; +byte max7219_reg_intensity = 0x0a; +byte max7219_reg_scanLimit = 0x0b; +byte max7219_reg_shutdown = 0x0c; +byte max7219_reg_displayTest = 0x0f; + +// define max7219 as rows and cols (for nexus 8x8 displays) +byte max7219_row0 = 0x01; +byte max7219_row1 = 0x02; +byte max7219_row2 = 0x03; +byte max7219_row3 = 0x04; +byte max7219_row4 = 0x05; +byte max7219_row5 = 0x06; +byte max7219_row6 = 0x07; +byte max7219_row7 = 0x08; +byte max7219_col0 = 0x80; +byte max7219_col1 = 0x01; +byte max7219_col2 = 0x02; +byte max7219_col3 = 0x04; +byte max7219_col4 = 0x08; +byte max7219_col5 = 0x10; +byte max7219_col6 = 0x20; +byte max7219_col7 = 0x40; + + +// function to control max7219 data line +void max7219_setData(boolean value) +{ + digitalWrite(pin_max7219_dataIn, value); +} + +// function to control max7219 clock line +void max7219_setClock(boolean value) +{ + digitalWrite(pin_max7219_clock, value); +} + +// function to control max7219 load line +void max7219_setLoad(boolean value) +{ + digitalWrite(pin_max7219_load, value); +} + +// function that puts a byte of data to the max7219 +void max7219_putByte(byte data) +{ + byte i = 8; + byte mask; + while(i > 0) { + mask = 0x01 << (i - 1); // get bitmask + max7219_setClock(LOW); // tick + if (data & mask){ // choose bit + max7219_setData(HIGH); // send 1 + }else{ + max7219_setData(LOW); // send 0 + } + max7219_setClock(HIGH); // tock + --i; // move to lesser bit + } +} + +// function that puts a byte of data into a max7219 register +void max7219_put(byte reg, byte data) +{ + max7219_setLoad(HIGH); // begin + max7219_putByte(reg); // specify register + max7219_putByte(data); // put data + max7219_setLoad(LOW); // latch in data + max7219_setLoad(HIGH); // end +} + +// function that sets brightness of the max7219 +void max7219_setIntensity(byte intensity) +{ + // range: 0x00 to 0x0f + max7219_put(max7219_reg_intensity, intensity & 0x0f); +} +//////////////////////////////////////////// +// function that sets the same value for all registers of the max7219 + +void max7219_all(byte value) +{ + max7219_put(0x01, value); + max7219_put(0x02, value); + max7219_put(0x03, value); + max7219_put(0x04, value); + max7219_put(0x05, value); + max7219_put(0x06, value); + max7219_put(0x07, value); + max7219_put(0x08, value); +} + +/////////////////////////////////////////// +void printBuff(){ + for (i=1;i <= 8;i++){ + max7219_put(0x0+i, serialBuff[i-1]); + } +} +//////////////////////////////////////////// + +void readBuff(){ + printString("into readbuff method"); + serialVal = serialRead(); + if (serialVal != -1){ + printString("information there"); + if ((serialVal == 43) && !reading){ + reading = true; + printString("plus"); + } + + if ((serialVal == 45) && (times == 0 && reading)){ + writing = true; + printString("minus"); + } + + if (reading && writing){ + serialBuff[times] = serialVal; + times++; + } + + if (times >= 7){ + printString("Print to buff"); + times = 0; + reading = false; + writing = false; + printBuff(); + } + + + } +} + +////////////////////////////////////////////////////////////// + +// function that initializes the max7219 to use a matrix of leds +void max7219_init() +{ + max7219_put(max7219_reg_scanLimit, 0x07); // use all 8 columns + max7219_put(max7219_reg_decodeMode, 0x00); // using an led matrix (not digits) + max7219_put(max7219_reg_shutdown, 0x01); // not in shutdown mode + max7219_put(max7219_reg_displayTest, 0x00); // no display test + max7219_all(0x00); // empty registers + max7219_setIntensity(0x0f); // set initial brightness to dim +} + + + +// program initialization routine +void setup() +{ + setPinModes(); + max7219_init(); +} + +// program loop +void loop() +{ + printString("in the loop"); + //max7219_all(0x00); + //delay(500); + readBuff(); + +} diff --git a/build/shared/dist/examples/leds/led_drivers/shift_out/shift_out.pde b/build/shared/dist/examples/leds/led_drivers/shift_out/shift_out.pde new file mode 100644 index 000000000..5ad50bec2 --- /dev/null +++ b/build/shared/dist/examples/leds/led_drivers/shift_out/shift_out.pde @@ -0,0 +1,79 @@ +/* Shift Out + * --------- + * + * This example uses the LED driver 4794 from Philips to drive + * 8 LEDs at once. The 4794 is a chip that can be chained so that + * we will be able of adding 8 outputs each time you add a new chip + * + * We use four pins to connect to the chip: + * + * - data: this one sends the data out to the chip + * + * - strob: controls the load of data to the chip's output + * + * - clock: synchronizes the load of data + * + * - oe: turns the output on/off, we use it to control the luminosity of the LEDs + * + * Pictures at: + * http://arduino.berlios.de/index.php/Tutorial/LEDDriver + * + * (copyleft) 2005 K3, Malmo University + * @author: David Cuartielles, Marcus Hannerstig + * @hardware: David Cuartielles, Marcos Yarza + * @project: SMEE - Experiential Vehicles + * + */ + + +int data = 9; +int strob = 8; +int clock = 10; +int oe = 11; +int count = 0; +int dato = 0; // dato is a varible we use to send data to the LEDs + +void setup() +{ + //beginSerial(9600); // uncomment the serial-related lines to monitor the program's progress + pinMode(data, OUTPUT); // declare all the control pins as outputs + pinMode(clock, OUTPUT); + pinMode(strob, OUTPUT); + pinMode(oe, OUTPUT); +} + + +// sends a pulse to the 4794 indicating that +// it is time to load data +void PulseClock(void) { + digitalWrite(clock, LOW); + delayMicroseconds(20); + digitalWrite(clock, HIGH); + delayMicroseconds(50); + digitalWrite(clock, LOW); +} + +void loop() +{ + dato = 129; // if dato equals 129 the first and last LED will be on + + // go through the "dato" variable and send it bit by bit over the data pin + for (count = 0; count < 8; count++) { + digitalWrite(data, dato & 01); + //serialWrite((dato & 01) + 48); + dato>>=1; + if (count == 7){ + digitalWrite(oe, LOW); + digitalWrite(strob, HIGH); + } + PulseClock(); + digitalWrite(oe, HIGH); + } + + delayMicroseconds(20); + digitalWrite(strob, LOW); + delay(100); + + //printNewline(); + delay(100); // waits for a second +} diff --git a/build/shared/dist/examples/motors/dc_motor/dc_motor.pde b/build/shared/dist/examples/motors/dc_motor/dc_motor.pde new file mode 100644 index 000000000..ed7b10498 --- /dev/null +++ b/build/shared/dist/examples/motors/dc_motor/dc_motor.pde @@ -0,0 +1,36 @@ +/* DC motor + * -------- + * + * Switch a motor on and off making use of a transistor + * we use of a BD137 from Fairchild. It is possible to + * play with the motor's innertia, and use a potentiometer to + * control the speed. + * + * (cleft) 2005 DojoDave for DojoCorp at Madrid Medialab - Spain + */ + +int motorPin = 6; // selec the pin where the motor is connected at +int value = 0; // variable to store the reading from the potentiometer +int potPin = 0; // analog pin where to plug the potentiometer at + +void setup() { + pinMode(motorPin, OUTPUT); // declare the motor as an output + beginSerial(9600); // connect to the serial port to send values back +} + +void loop() { + // read the potentiometer + value = analogRead(potPin); + + // print its value back to the computer + printInteger(value); + printNewline(); + + // turn the motor on + digitalWrite(motorPin,HIGH); + delay(50); + digitalWrite(motorPin,LOW); + + // this will control how long the motor is off + delay(value); +} diff --git a/build/shared/dist/examples/motors/dc_two_motors/dc_two_motors.pde b/build/shared/dist/examples/motors/dc_two_motors/dc_two_motors.pde new file mode 100644 index 000000000..9393808f5 --- /dev/null +++ b/build/shared/dist/examples/motors/dc_two_motors/dc_two_motors.pde @@ -0,0 +1,121 @@ +/* Driving two DC motors + * ----------------------- + * + * Custom timer originally intended to DC motor + * control purposes and made from two nested loops: + * - "scan cycle" is the main loop + * - "control cycle" is the internal loop + * Timing id adjusted by changing number of iterations en each loop + * and the internal delay of each control cycle iteration (tic). If scan + * cycle code takes significative time to jam current control cycle, this + * delay could be easily reduced or bypassed. + * + * (copyleft) 2005 by Quique + * + * posted to the Arduino Forum + * + * + */ + + int ledPin0 = 13; // LED connected to digital pin 13 + int motorPin1 = 9; // Motor 1 connected to digital pin 9 + int motorPin2 = 8; // Motor 1 connected to digital pin 8 + + int potPin1 = 5; // Potentiometer1 connected to analog pin 5 ( 5 is 1 in some boards) + int potPin2 = 4; // Potentiometer1 connected to analog pin 5 ( 4 is 2 in some boards) + +// Timing Setup + + int scanCycle = 10; // Number of control cycles in a scan cycle + int controlCycle = 200; // Control cycle iterations + int tic = 6; // Control cycle iteration aditional delay in microseconds + + int currentSCycle = 0; // Current scan cycle iteration + int currentCCycle = 0; // Current control cycle iteration + boolean scanEnable = true; // Allows read analog & digital inputs + +// End timing setup + + int counter = 0; // Scan cycle counter used to change led status + int motor1_PW; // motor 1 Pulse Width + int motor2_PW; // motor 2 Pulse Width + +/* +* Switch the boolean value assigned to any variable +*/ +boolean boolSwitch (boolean *target) +{ + if ( *target ) {*target = false;} else { *target = true; } + return *target; +} + +void setup() +{ + pinMode (ledPin0, OUTPUT); // sets the digital pin as output + pinMode (motorPin1, OUTPUT); // sets the digital pin as output + pinMode (motorPin2, OUTPUT); // sets the digital pin as output +} + +void loop() +{ +// Scan cycle + + if (scanEnable) + { + // + // Scan cycle logic here + // + motor1_PW = analogRead (potPin1)/5; // Pot 1 read scale change + motor2_PW = analogRead (potPin2)/5; // Pot 1 read scale change + + // Swith led in pin 13 each 10 scan cycles. We can assume that while + // Led is on (or off), porgram has taken 10 scan cycles. So, if we adjust + // blink time to 1 sec, we are able to scanning inputs each 100 msec. + if (counter++ >= 10) + { + digitalWrite (ledPin0, boolSwitch (ledPin0)); // Led blink each 10 scan cycles i.e. if + // led is on 1 second, we are scaning knobs each + // 100 miliseconds + counter =0; + } + } + +// Control cycle + for (currentCCycle = 0; currentCCycle < controlCycle; currentCCycle ++) + { + delayMicroseconds (tic); + // + // Control cycle logic here + // + if ( motor1_PW > currentCCycle ) + { + digitalWrite ( motorPin1, LOW); + } + else + { + digitalWrite ( motorPin1, HIGH); + } + + if ( motor2_PW > currentCCycle ) + { + digitalWrite ( motorPin2, LOW); + } + else + { + digitalWrite ( motorPin2, HIGH); + } + + } + +// Detect completed scan cycle + if ( currentSCycle ++ > scanCycle) + { + scanEnable = true; // Allow readings of external inputs + currentSCycle = 0; // Reset scan cycle counter + } + else + { + scanEnable = false; // + } +} + diff --git a/build/shared/dist/examples/motors/stepper_unipolar/stepper_unipolar.pde b/build/shared/dist/examples/motors/stepper_unipolar/stepper_unipolar.pde new file mode 100644 index 000000000..416647aab --- /dev/null +++ b/build/shared/dist/examples/motors/stepper_unipolar/stepper_unipolar.pde @@ -0,0 +1,57 @@ +/* Stepper Copal Unipolar + * ---------------------- + * + * Program to drive a stepper motor coming from a 5'25 disk drive + * according to the documentation I found, this stepper: "[...] motor + * made by Copal Electronics, with 1.8 degrees per step and 96 ohms + * per winding, with center taps brought out to separate leads [...]" + * [http://www.cs.uiowa.edu/~jones/step/example.html] + * + * It is a bipolar stepper motor with 5 wires: + * + * - red: power connector, I have it at 5V and works fine + * - orange and black: coil 1 + * - brown and yellow: coil 2 + * + * (cleft) 2005 DojoDave for K3 + * http://www.0j0.org | http://arduino.berlios.de + * + * @author: David Cuartielles + * @date: 20 Oct. 2005 + */ + +int motorPin1 = 8; +int motorPin2 = 9; +int motorPin3 = 10; +int motorPin4 = 11; +int delayTime = 500; + +void setup() { + pinMode(motorPin1, OUTPUT); + pinMode(motorPin2, OUTPUT); + pinMode(motorPin3, OUTPUT); + pinMode(motorPin4, OUTPUT); +} + +void loop() { + digitalWrite(motorPin1, HIGH); + digitalWrite(motorPin2, LOW); + digitalWrite(motorPin3, LOW); + digitalWrite(motorPin4, LOW); + delay(delayTime); + digitalWrite(motorPin1, LOW); + digitalWrite(motorPin2, HIGH); + digitalWrite(motorPin3, LOW); + digitalWrite(motorPin4, LOW); + delay(delayTime); + digitalWrite(motorPin1, LOW); + digitalWrite(motorPin2, LOW); + digitalWrite(motorPin3, HIGH); + digitalWrite(motorPin4, LOW); + delay(delayTime); + digitalWrite(motorPin1, LOW); + digitalWrite(motorPin2, LOW); + digitalWrite(motorPin3, LOW); + digitalWrite(motorPin4, HIGH); + delay(delayTime); +} diff --git a/build/shared/dist/examples/motors/stepper_unipolar_advanced/stepper_unipolar_advanced.pde b/build/shared/dist/examples/motors/stepper_unipolar_advanced/stepper_unipolar_advanced.pde new file mode 100644 index 000000000..f46fe8e1d --- /dev/null +++ b/build/shared/dist/examples/motors/stepper_unipolar_advanced/stepper_unipolar_advanced.pde @@ -0,0 +1,73 @@ +/* Stepper Unipolar Advanced + * ------------------------- + * + * Program to drive a stepper motor coming from a 5'25 disk drive + * according to the documentation I found, this stepper: "[...] motor + * made by Copal Electronics, with 1.8 degrees per step and 96 ohms + * per winding, with center taps brought out to separate leads [...]" + * [http://www.cs.uiowa.edu/~jones/step/example.html] + * + * It is a bipolar stepper motor with 5 wires: + * + * - red: power connector, I have it at 5V and works fine + * - brown and black: coil 1 + * - orange and yellow: coil 2 + * + * We use a potentiometer to control the speed and direction of the motor + * + * (cleft) 2005 DojoDave for K3 + * http://www.0j0.org | http://arduino.berlios.de + * + * @author: David Cuartielles + * @date: 20 Oct. 2005 + */ + +int ledPin = 13; +int statusLed = LOW; +int motorPins[] = {8, 9, 10, 11}; +int count = 0; +int count2 = 0; +int delayTime = 500; +int val = 0; + +void setup() { + pinMode(ledPin, OUTPUT); + for (count = 0; count < 4; count++) { + pinMode(motorPins[count], OUTPUT); + } +} + +void moveForward() { + if ((count2 == 0) || (count2 == 1)) { + count2 = 16; + } + count2>>=1; + for (count = 3; count >= 0; count--) { + digitalWrite(motorPins[count], count2>>count&0x01); + } + delay(delayTime); +} + +void moveBackward() { + if ((count2 == 0) || (count2 == 1)) { + count2 = 16; + } + count2>>=1; + for (count = 3; count >= 0; count--) { + digitalWrite(motorPins[3 - count], count2>>count&0x01); + } + delay(delayTime); +} + +void loop() { + val = analogRead(0); + if (val > 540) { + delayTime = 2048 - 1024 * val / 512 + 1; // move faster the higher the value from the potentiometer + moveForward(); + } else if (val < 480) { + delayTime = 1024 * val / 512 + 1; // move faster the lower the value from the potentiometer + moveBackward(); + } else { + delayTime = 1024; + } +} diff --git a/build/shared/dist/examples/processing/processing_send_potentiometer/processing_send_potentiometer.pde b/build/shared/dist/examples/processing/processing_send_potentiometer/processing_send_potentiometer.pde new file mode 100644 index 000000000..86837ee02 --- /dev/null +++ b/build/shared/dist/examples/processing/processing_send_potentiometer/processing_send_potentiometer.pde @@ -0,0 +1,42 @@ +/* Potentiometer to Processing + * --------------------------- + * + * This program sends data from a potentiometer to Processing + * over the serial port (works in PC: Windows and Linux, and MAC) + * The code reads a potentiometer plugged to an analog + * input and sends the data as a byte back to the computer. + * + * In order to make the data transfer as simple as possible + * we will only send a byte back to the computer, what means + * that the data coming from the ADC will be divided by 4. + * + * (cleft) 2005 DojoDave for K3 + * + * @author: David Cuartielles + * @context: ID3 - K3 - MAH - Sweden + */ + +int ledPin = 13; // pin for the LED +int potPin = 0; // analog pin for the potentiometer +int ledStatus = LOW; // we use a variable to toggle the LEDs state +int val = 0; // variable to store the potentiometer's reading + +void setup() { + pinMode(ledPin, OUTPUT); // declare the ledPin as an output + Serial.begin(9600); // initialize the serial port +} + +void loop() { + // read the potentiometer's value and store it + val = analogRead(potPin)/4; + + // send the value over the port + Serial.print(val, BYTE); + + // wait a bit + delay(100); + + // change the state of the LED (if HIGH, then LOW, and viceversa) + ledStatus = !ledStatus; + digitalWrite(ledPin, ledStatus); +} diff --git a/build/shared/dist/examples/program_template/program_template.pde b/build/shared/dist/examples/program_template/program_template.pde new file mode 100644 index 000000000..ae63dff23 --- /dev/null +++ b/build/shared/dist/examples/program_template/program_template.pde @@ -0,0 +1,29 @@ +/* PROGRAM'S TITLE + * --------------- + * + * Comments + * + * (copyright notice) 2005 by NAME + * + * + * + */ + +// variable declaration +// type name_of_var = value; + +// function declaration +// type name_of_function(type parameters) { +// code_block; +// } + +void setup(void) { + // initialize inputs/outputs + // start serial port +} + +void loop(void) { + // program here + // code_block; +} + diff --git a/build/shared/dist/examples/puredata/PD_inputs_to_PD/PD_inputs_to_PD.pde b/build/shared/dist/examples/puredata/PD_inputs_to_PD/PD_inputs_to_PD.pde new file mode 100644 index 000000000..7444c5b6c --- /dev/null +++ b/build/shared/dist/examples/puredata/PD_inputs_to_PD/PD_inputs_to_PD.pde @@ -0,0 +1,71 @@ +/* Inputs to PD + * ------------------- + * + * This program sends data from a bunch of inputs to PD + * over the serial port (works on PC: Windows and Linux, and MAC) + * The code reads 3 potentiometers and 6 buttons plugged to Arduino + * input and sends the data back to the computer. + * + * On the other side there will be a PureData sketch running + * comport2000 and will use the data to change a sound or video + * file properties. + * + * The buttons will be characterized with '1' or '0' depending on + * their state, while potentiometers will be characterized with a + * 10 bits integer in the range 0..1024 + * + * The first sensor will be marked with 'A' (ascii 65), the second + * with 'B', and so on. The end of sensor reading is marked with + * the characters EOLN (ascii 10). + * + * (cleft) 2005 DojoDave for K3 + * + * @author: David Cuartielles + * @context: ID3 - K3 - MAH - Sweden + */ + +int ledPin = 13; // declare the pin with the LED +int potentioMeter = 0; // declare the analog pin for the potentiometer +int pushButton = 0; // declare the value +int writeChar = 65; // declare the first reading as 'A' +int value = 0; // value to read the different sensors +int ledStatus = LOW; // status of the LED + +void setup() { + pinMode(ledPin, OUTPUT); // declare the LED as output + Serial.begin(9600); // intitialize the serial port +} + +void loop() { + + writeChar = 65; //Sets the sensor idendifier + // character back to 'A'. + + // start reading the potentiometers on the analog pins + for(potentioMeter=0;potentioMeter<3;potentioMeter++){ + Serial.print(writeChar, BYTE); + Serial.print(analogRead(potentioMeter)); + Serial.println(); + writeChar = writeChar + 1; + delay(10); + } + + // read the pushbuttons + for(pushButton=2;pushButton<8;pushButton++){ + Serial.print(writeChar, BYTE); + value = digitalRead(pushButton); // reads the value at a digital input + if (value) + { + Serial.print('0'); + } else { + Serial.print('1'); + } + Serial.println(); + writeChar = writeChar + 1; + delay(10); + } + + delay(100); + ledStatus = !ledStatus; + digitalWrite(ledPin, ledStatus); +} diff --git a/build/shared/dist/examples/puredata/PD_send_potentiometer/PD_send_potentiometer.pde b/build/shared/dist/examples/puredata/PD_send_potentiometer/PD_send_potentiometer.pde new file mode 100644 index 000000000..7740c7aac --- /dev/null +++ b/build/shared/dist/examples/puredata/PD_send_potentiometer/PD_send_potentiometer.pde @@ -0,0 +1,37 @@ +/* Potentiometer to PD + * ------------------- + * + * This program sends data from a potentiometer to PD + * over the serial port (works in Windows and Linux, MAC?) + * The code reads a potentiometer plugged to an analog + * input and sends the data as a byte back to the computer. + * + * On the other side there will be a PureData sketch running + * comport2000 and will use the data to change a sound file + * properties. + * + * In order to make the data transfer as simple as possible + * we will only send a byte back to the computer, what means + * that the data coming from the ADC will be divided by 4. + * + * (cleft) 2005 DojoDave for K3 + * + * @author: David Cuartielles + * @context: ID3 - K3 - MAH - Sweden + */ + +int ledPin = 13; +int potPin = 0; +int ledStatus = LOW; + +void setup() { + pinMode(ledPin, OUTPUT); + Serial.begin(9600); +} + +void loop() { + Serial.print(analogRead(potPin)/4, BYTE); + delay(100); + ledStatus = !ledStatus; + digitalWrite(ledPin, ledStatus); +} diff --git a/build/shared/dist/examples/puredata/PD_two_potentiometers/PD_two_potentiometers.pde b/build/shared/dist/examples/puredata/PD_two_potentiometers/PD_two_potentiometers.pde new file mode 100644 index 000000000..8831413e9 --- /dev/null +++ b/build/shared/dist/examples/puredata/PD_two_potentiometers/PD_two_potentiometers.pde @@ -0,0 +1,31 @@ +/* Two Potentiometers + * ------------------ + * + * This program reads two potentiometers and + * sends the data to the computer. It combines + * both with PD or Processing + * + * (cleft) 2005 David Cuartielles for DojoCorp + * @author: D. Cuartielles + * @credit: Nima and Greg + * @date: 2005-11-18 + * @location: SFU, Vancouver, Canada + */ + +int potPin1 = 0; +int potPin2 = 1; + +void setup() { + Serial.begin(9600); +} + +void loop() { + Serial.print('A'); + Serial.print(analogRead(potPin1)); + Serial.println(); + delay(500); + Serial.print('B'); + Serial.print(analogRead(potPin2)); + Serial.println(); + delay(500); +} diff --git a/build/shared/dist/examples/pwm_sound/keyboard_serial/keyboard_serial.pde b/build/shared/dist/examples/pwm_sound/keyboard_serial/keyboard_serial.pde new file mode 100644 index 000000000..9aaa94fd1 --- /dev/null +++ b/build/shared/dist/examples/pwm_sound/keyboard_serial/keyboard_serial.pde @@ -0,0 +1,60 @@ +/* Keyboard Serial + * ---------------- + * + * Program to play tones depending on the + * data coming from the serial port. + * + * The calculation of the tones is made following the mathematical + * operation: + * + * timeHigh = 1/(2 * toneFrequency) = period / 2 + * + * where the different tones are described as in the table: + * + * note frequency period PW (timeHigh) + * c 261 Hz 3830 1915 + * d 294 Hz 3400 1700 + * e 329 Hz 3038 1519 + * f 349 Hz 2864 1432 + * g 392 Hz 2550 1275 + * a 440 Hz 2272 1136 + * b 493 Hz 2028 1014 + * C 523 Hz 1912 956 + * + * (cleft) 2005 D. Cuartielles for K3 + */ + +int ledPin = 13; +int speakerOut = 9; +byte names[] ={'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C'}; +int tones[] = {1915, 1700, 1519, 1432, 1275, 1136, 1014, 956}; +byte val = 0; +int serByte = -1; +int statePin = LOW; +int count = 0; + +void setup() { + pinMode(ledPin, OUTPUT); + pinMode(speakerOut, OUTPUT); + Serial.begin(9600); +} + +void loop() { + digitalWrite(speakerOut, LOW); + serByte = Serial.read(); + if (serByte != -1) { + val = serByte; + Serial.print(val); + statePin = !statePin; + digitalWrite(ledPin, statePin); + } + for (count=0;count<=8;count++) { + if (names[count] == val) { + digitalWrite(speakerOut, HIGH); + delayMicroseconds(tones[count]); + digitalWrite(speakerOut, LOW); + delayMicroseconds(tones[count]); + } + } +} + diff --git a/build/shared/dist/examples/pwm_sound/keyboard_serial_faded_volume/keyboard_serial_faded_volume.pde b/build/shared/dist/examples/pwm_sound/keyboard_serial_faded_volume/keyboard_serial_faded_volume.pde new file mode 100644 index 000000000..b160269e0 --- /dev/null +++ b/build/shared/dist/examples/pwm_sound/keyboard_serial_faded_volume/keyboard_serial_faded_volume.pde @@ -0,0 +1,62 @@ +/* Keyboard Serial + * ---------------- + * + * Program to play tones depending on the + * data coming from the serial port. + * + * The calculation of the tones is made following the mathematical + * operation: + * + * timeHigh = 1/(2 * toneFrequency) = period / 2 + * + * where the different tones are described as in the table: + * + * note frequency period PW (timeHigh) + * c 261 Hz 3830 1915 + * d 294 Hz 3400 1700 + * e 329 Hz 3038 1519 + * f 349 Hz 2864 1432 + * g 392 Hz 2550 1275 + * a 440 Hz 2272 1136 + * b 493 Hz 2028 1014 + * C 523 Hz 1912 956 + * + * We use the PWM on pin 9 and analogWrite to change volume + * + * (cleft) 2005 D. Cuartielles for K3 + */ + +int ledPin = 13; +int speakerOut = 9; +int volume = 300; // maximum volume is 1000 +byte names[] ={'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C'}; +int tones[] = {1915, 1700, 1519, 1432, 1275, 1136, 1014, 956}; +byte val = 0; +int serByte = -1; +int statePin = LOW; +int count = 0; + +void setup() { + pinMode(ledPin, OUTPUT); + Serial.begin(9600); +} + +void loop() { + analogWrite(speakerOut, 0); + serByte = Serial.read(); + if (serByte != -1) { + val = serByte; + Serial.print(val); + statePin = !statePin; + digitalWrite(ledPin, statePin); + } + for (count=0;count<=8;count++) { + if (names[count] == val) { + analogWrite(speakerOut,volume); + delayMicroseconds(tones[count]); + analogWrite(speakerOut, 0); + delayMicroseconds(tones[count]); + } + } +} + diff --git a/build/shared/dist/examples/pwm_sound/play_melody/play_melody.pde b/build/shared/dist/examples/pwm_sound/play_melody/play_melody.pde new file mode 100644 index 000000000..9b947e34a --- /dev/null +++ b/build/shared/dist/examples/pwm_sound/play_melody/play_melody.pde @@ -0,0 +1,67 @@ +/* Play Melody + * ----------- + * + * Program to play melodies stored in an array, it requires to know + * about timing issues and about how to play tones. + * + * The calculation of the tones is made following the mathematical + * operation: + * + * timeHigh = 1/(2 * toneFrequency) = period / 2 + * + * where the different tones are described as in the table: + * + * note frequency period PW (timeHigh) + * c 261 Hz 3830 1915 + * d 294 Hz 3400 1700 + * e 329 Hz 3038 1519 + * f 349 Hz 2864 1432 + * g 392 Hz 2550 1275 + * a 440 Hz 2272 1136 + * b 493 Hz 2028 1014 + * C 523 Hz 1912 956 + * + * (cleft) 2005 D. Cuartielles for K3 + */ + +int ledPin = 13; +int speakerOut = 9; +byte names[] = {'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C'}; +int tones[] = {1915, 1700, 1519, 1432, 1275, 1136, 1014, 956}; +byte melody[] = "2d2a1f2c2d2a2d2c2f2d2a2c2d2a1f2c2d2a2a2g2p8p8p8p"; +// count length: 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 +// 10 20 30 +int count = 0; +int count2 = 0; +int count3 = 0; +int MAX_COUNT = 24; +int statePin = LOW; + +void setup() { + pinMode(ledPin, OUTPUT); + pinMode(speakerOut, OUTPUT); +} + +void loop() { + digitalWrite(speakerOut, LOW); + for (count = 0; count < MAX_COUNT; count++) { + statePin = !statePin; + digitalWrite(ledPin, statePin); + for (count3 = 0; count3 <= (melody[count*2] - 48) * 30; count3++) { + for (count2=0;count2<8;count2++) { + if (names[count2] == melody[count*2 + 1]) { + digitalWrite(speakerOut,HIGH); + delayMicroseconds(tones[count2]); + digitalWrite(speakerOut, LOW); + delayMicroseconds(tones[count2]); + } + if (melody[count*2 + 1] == 'p') { + // make a pause of a certain size + digitalWrite(speakerOut, 0); + delayMicroseconds(500); + } + } + } + } +} + diff --git a/build/shared/dist/examples/pwm_sound/play_melody_2/play_melody_2.pde b/build/shared/dist/examples/pwm_sound/play_melody_2/play_melody_2.pde new file mode 100644 index 000000000..9b947e34a --- /dev/null +++ b/build/shared/dist/examples/pwm_sound/play_melody_2/play_melody_2.pde @@ -0,0 +1,67 @@ +/* Play Melody + * ----------- + * + * Program to play melodies stored in an array, it requires to know + * about timing issues and about how to play tones. + * + * The calculation of the tones is made following the mathematical + * operation: + * + * timeHigh = 1/(2 * toneFrequency) = period / 2 + * + * where the different tones are described as in the table: + * + * note frequency period PW (timeHigh) + * c 261 Hz 3830 1915 + * d 294 Hz 3400 1700 + * e 329 Hz 3038 1519 + * f 349 Hz 2864 1432 + * g 392 Hz 2550 1275 + * a 440 Hz 2272 1136 + * b 493 Hz 2028 1014 + * C 523 Hz 1912 956 + * + * (cleft) 2005 D. Cuartielles for K3 + */ + +int ledPin = 13; +int speakerOut = 9; +byte names[] = {'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C'}; +int tones[] = {1915, 1700, 1519, 1432, 1275, 1136, 1014, 956}; +byte melody[] = "2d2a1f2c2d2a2d2c2f2d2a2c2d2a1f2c2d2a2a2g2p8p8p8p"; +// count length: 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 +// 10 20 30 +int count = 0; +int count2 = 0; +int count3 = 0; +int MAX_COUNT = 24; +int statePin = LOW; + +void setup() { + pinMode(ledPin, OUTPUT); + pinMode(speakerOut, OUTPUT); +} + +void loop() { + digitalWrite(speakerOut, LOW); + for (count = 0; count < MAX_COUNT; count++) { + statePin = !statePin; + digitalWrite(ledPin, statePin); + for (count3 = 0; count3 <= (melody[count*2] - 48) * 30; count3++) { + for (count2=0;count2<8;count2++) { + if (names[count2] == melody[count*2 + 1]) { + digitalWrite(speakerOut,HIGH); + delayMicroseconds(tones[count2]); + digitalWrite(speakerOut, LOW); + delayMicroseconds(tones[count2]); + } + if (melody[count*2 + 1] == 'p') { + // make a pause of a certain size + digitalWrite(speakerOut, 0); + delayMicroseconds(500); + } + } + } + } +} + diff --git a/build/shared/dist/examples/pwm_sound/play_melody_faded_volume/play_melody_faded_volume.pde b/build/shared/dist/examples/pwm_sound/play_melody_faded_volume/play_melody_faded_volume.pde new file mode 100644 index 000000000..f1c55f640 --- /dev/null +++ b/build/shared/dist/examples/pwm_sound/play_melody_faded_volume/play_melody_faded_volume.pde @@ -0,0 +1,69 @@ +/* Play Melody - FD + * ---------------- + * + * Program to play melodies stored in an array, it requires to know + * about timing issues and about how to play tones. + * + * The calculation of the tones is made following the mathematical + * operation: + * + * timeHigh = 1/(2 * toneFrequency) = period / 2 + * + * where the different tones are described as in the table: + * + * note frequency period PW (timeHigh) + * c 261 Hz 3830 1915 + * d 294 Hz 3400 1700 + * e 329 Hz 3038 1519 + * f 349 Hz 2864 1432 + * g 392 Hz 2550 1275 + * a 440 Hz 2272 1136 + * b 493 Hz 2028 1014 + * C 523 Hz 1912 956 + * + * We use the PWM on pin 9 with analogWrite to change volume + * + * (cleft) 2005 D. Cuartielles for K3 + */ + +int ledPin = 13; +int speakerOut = 9; +int volume = 300; // maximum volume is 1000 +byte names[] = {'c', 'd', 'e', 'f', 'g', 'a', 'b', 'C'}; +int tones[] = {1915, 1700, 1519, 1432, 1275, 1136, 1014, 956}; +byte melody[] = "2d2a1f2c2d2a2d2c2f2d2a2c2d2a1f2c2d2a2a2g2p8p8p8p"; +// count length: 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 +// 10 20 30 +int count = 0; +int count2 = 0; +int count3 = 0; +int MAX_COUNT = 24; +int statePin = LOW; + +void setup() { + pinMode(ledPin, OUTPUT); +} + +void loop() { + analogWrite(speakerOut, 0); + for (count = 0; count < MAX_COUNT; count++) { + statePin = !statePin; + digitalWrite(ledPin, statePin); + for (count3 = 0; count3 <= (melody[count*2] - 48) * 30; count3++) { + for (count2=0;count2<8;count2++) { + if (names[count2] == melody[count*2 + 1]) { + analogWrite(speakerOut,volume); + delayMicroseconds(tones[count2]); + analogWrite(speakerOut, 0); + delayMicroseconds(tones[count2]); + } + if (melody[count*2 + 1] == 'p') { + // make a pause of a certain size + analogWrite(speakerOut, 0); + delayMicroseconds(500); + } + } + } + } +} + diff --git a/build/shared/dist/examples/sensors_complex/accelerometer_memsic2125/accelerometer_memsic2125.pde b/build/shared/dist/examples/sensors_complex/accelerometer_memsic2125/accelerometer_memsic2125.pde new file mode 100644 index 000000000..d1d7efa50 --- /dev/null +++ b/build/shared/dist/examples/sensors_complex/accelerometer_memsic2125/accelerometer_memsic2125.pde @@ -0,0 +1,91 @@ +/* Accelerometer Sensor + * -------------------- + * + * Reads an 2-D accelerometer + * attached to a couple of digital inputs and + * sends their values over the serial port; makes + * the monitor LED blink once sent + * + * + * http://www.0j0.org + * copyleft 2005 K3 - Malmo University - Sweden + * @author: Marcos Yarza + * @hardware: Marcos Yarza + * @project: SMEE - Experiential Vehicles + * @sponsor: Experiments in Art and Technology Sweden, 1:1 Scale + */ + +int ledPin = 13; +int xaccPin = 7; +int yaccPin = 6; +int value = 0; +int accel = 0; +char sign = ' '; + +int timer = 0; +int count = 0; + +void setup() { + Serial.begin(9600); // Sets the baud rate to 9600 + pinMode(ledPin, OUTPUT); + pinMode(xaccPin, INPUT); + pinMode(yaccPin, INPUT); +} + +/* (int) Operate Acceleration +* function to calculate acceleration +* returns an integer +*/ +int operateAcceleration(int time1) { + return abs(8 * (time1 / 10 - 500)); +} + +/* (void) readAccelerometer +* procedure to read the sensor, calculate +* acceleration and represent the value +*/ +void readAcceleration(int axe){ + timer = 0; + count = 0; + value = digitalRead(axe); + while(value == HIGH) { // Loop until pin reads a low + value = digitalRead(axe); + } + while(value == LOW) { // Loop until pin reads a high + value = digitalRead(axe); + } + while(value == HIGH) { // Loop until pin reads a low and count + value = digitalRead(axe); + count = count + 1; + } + timer = count * 18; //calculate the teme in miliseconds + + //operate sign + if (timer > 5000){ + sign = '+'; + } + if (timer < 5000){ + sign = '-'; + } + + //determine the value + accel = operateAcceleration(timer); + + //Represent acceleration over serial port + if (axe == xaccPin){ + Serial.print('X'); + } else { + Serial.print('Y'); + } + Serial.print(sign); + Serial.print(accel); + Serial.println(); +} + +void loop() { + readAcceleration(xaccPin); //reads and represents acceleration X + readAcceleration(yaccPin); //reads and represents acceleration Y + digitalWrite(ledPin, HIGH); + delay(300); + digitalWrite(ledPin, LOW); +} diff --git a/build/shared/dist/examples/sensors_complex/ultrasound_PING/ultrasound_PING.pde b/build/shared/dist/examples/sensors_complex/ultrasound_PING/ultrasound_PING.pde new file mode 100644 index 000000000..225010d2a --- /dev/null +++ b/build/shared/dist/examples/sensors_complex/ultrasound_PING/ultrasound_PING.pde @@ -0,0 +1,73 @@ +/* Ultrasound Sensor + * ----------------- + * + * Reads values (00014-01199) from an ultrasound sensor (3m sensor) + * and writes the values to the serialport. The sensor is the + * so-called PING sensor from Parallax/Devantech. + * + * http://www.xlab.se | http://www.0j0.org + * copyleft 2005 Mackie for XLAB | DojoDave for DojoCorp + * + */ + +int ultraSoundSignal = 8; // Ultrasound signal pin +int val = 0; +int ultrasoundValue = 0; +int timecount = 0; // Echo counter +int ledPin = 13; // LED connected to digital pin 13 + +void setup() { + Serial.begin(9600); // Sets the baud rate to 9600 + pinMode(ledPin, OUTPUT); // Sets the digital pin as output +} + +void loop() { +timecount = 0; +val = 0; +pinMode(ultraSoundSignal, OUTPUT); // Switch signalpin to output + +/* Send low-high-low pulse to activate the trigger pulse of the sensor + * ------------------------------------------------------------------- + */ +digitalWrite(ultraSoundSignal, LOW); // Send low pulse +delayMicroseconds(2); // Wait for 2 microseconds +digitalWrite(ultraSoundSignal, HIGH); // Send high pulse +delayMicroseconds(5); // Wait for 5 microseconds +digitalWrite(ultraSoundSignal, LOW); // Holdoff + +/* Listening for echo pulse + * ------------------------------------------------------------------- + */ +pinMode(ultraSoundSignal, INPUT); // Switch signalpin to input +val = digitalRead(ultraSoundSignal); // Append signal value to val + +while(val == LOW) { // Loop until pin reads a high value + val = digitalRead(ultraSoundSignal); +} + +while(val == HIGH) { // Loop until pin reads a high value + val = digitalRead(ultraSoundSignal); + timecount = timecount +1; // Count echo pulse time +} + +/* Writing out values to the serial port + * ------------------------------------------------------------------- + */ +ultrasoundValue = timecount; // Append echo pulse time to ultrasoundValue +Serial.print('A'); // Example identifier for the sensor +Serial.print(ultrasoundValue); +Serial.println(); + +/* Lite up LED if any value is passed by the echo pulse + * ------------------------------------------------------------------- + */ +if(timecount > 0){ + digitalWrite(ledPin, HIGH); +} + +/* Delay of program + * ------------------------------------------------------------------- + */ +delay(100); + +} diff --git a/build/shared/dist/examples/sensors_resistive/analog_read_led/analog_read_led.pde b/build/shared/dist/examples/sensors_resistive/analog_read_led/analog_read_led.pde new file mode 100644 index 000000000..d941e8487 --- /dev/null +++ b/build/shared/dist/examples/sensors_resistive/analog_read_led/analog_read_led.pde @@ -0,0 +1,29 @@ +/* Analog Read to LED + * ------------------ + * + * turns on and off a light emitting diode(LED) connected to digital + * pin 13. The amount of time the LED will be on and off depends on + * the value obtained by analogRead(). In the easiest case we connect + * a potentiometer to analog pin 2. + * + * Created 1 December 2005 + * copyleft 2005 DojoDave + * http://arduino.berlios.de + * + */ + +int potPin = 2; // select the input pin for the potentiometer +int ledPin = 13; // select the pin for the LED +int val = 0; // variable to store the value coming from the sensor + +void setup() { + pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT +} + +void loop() { + val = analogRead(potPin); // read the value from the sensor + digitalWrite(ledPin, HIGH); // turn the ledPin on + delay(val); // stop the program for some time + digitalWrite(ledPin, LOW); // turn the ledPin off + delay(val); // stop the program for some time +} diff --git a/build/shared/dist/examples/sensors_resistive/knock_sensor/knock_sensor.pde b/build/shared/dist/examples/sensors_resistive/knock_sensor/knock_sensor.pde new file mode 100644 index 000000000..14cbdb341 --- /dev/null +++ b/build/shared/dist/examples/sensors_resistive/knock_sensor/knock_sensor.pde @@ -0,0 +1,37 @@ +/* Knock Sensor + * ------------ + * + * Program using a Piezo element as if it was a knock sensor. + * + * We have to basically listen to an analog pin and detect + * if the signal goes over a certain threshold. It writes + * "knock" to the serial port if the Threshold is crossed, + * and toggles the LED on pin 13. + * + * Created 10 August 2005 + * copyleft 2005 DojoDave + * http://arduino.berlios.de + * + */ + +int ledPin = 13; // led connected to control pin 13 +int knockSensor = 0; // the knock sensor will be plugged at analog pin 0 +byte val = 0; // variable to store the value read from the sensor pin +int statePin = LOW; // variable used to store the last LED status, to toggle the light +int THRESHOLD = 100; // threshold value to decide when the detected sound is a knock or not + +void setup() { + pinMode(ledPin, OUTPUT); // declare the ledPin as as OUTPUT + Serial.begin(9600); // use the serial port +} + +void loop() { + val = analogRead(knockSensor); // read the sensor and store it in the variable "val" + if (val >= THRESHOLD) { + statePin = !statePin; // toggle the status of the ledPin (this trick doesn't use time cycles) + digitalWrite(ledPin, statePin); // turn the led on or off + Serial.println("Knock!"); // send the string "Knock!" back to the computer, followed by newline + } + delay(100); // we have to make a delay to avoid overloading the serial port +} + diff --git a/build/shared/dist/examples/sensors_resistive/read_joystick/read_joystick.pde b/build/shared/dist/examples/sensors_resistive/read_joystick/read_joystick.pde new file mode 100644 index 000000000..8763c8212 --- /dev/null +++ b/build/shared/dist/examples/sensors_resistive/read_joystick/read_joystick.pde @@ -0,0 +1,54 @@ +/* Read Jostick + * ------------ + * + * Reads two analog pins that are supposed to be + * connected to a jostick made of two potentiometers + * + * We send three bytes back to the computer: one header and + * two with data as signed bytes, this will take the form: + * + * Jxy\r\n + * + * x and y are integers and sent in ASCII + * + * created 20 June 2005 + * copyleft 2005 DojoDave for DojoCorp + * http://arduino.berlios.de + * + */ + +int ledPin = 13; // declare pin 13 for the LED +int joyPin1 = 0; // slider variable connecetd to analog pin 0 +int joyPin2 = 1; // slider variable connecetd to analog pin 1 +int value1 = 0; // variable to read the value from the analog pin 0 +int value2 = 0; // variable to read the value from the analog pin 1 + +void setup() +{ + pinMode(ledPin, OUTPUT); // initializes digital pins 0 to 7 as outputs + Serial.begin(9600); // turn on the serial port +} + +// function that transformes the data from a scale 0-1024 to a scale 0-9 +// and answers back the ASCII value for it +int treatValue(int data) +{ + return (data * 9 / 1024) + 48; +} + +void loop() +{ + value1 = analogRead(joyPin1); // reads the value of the variable resistor + delay(100); // this small pause is needed between reading two + // analog pins, otherwise we get the same value twice + value2 = analogRead(joyPin2); // reads the value of the variable resistor + + digitalWrite(ledPin, HIGH); // turn LED on + delay(value1/4); // wait depending on the value read for one axis + digitalWrite(ledPin, LOW); // turn LED off + delay(value2/4); // wait depending on the value read for the other axis + Serial.print('J'); // write a capital 'J' to the serial port + Serial.print(treatValue(value1), BYTE); // send the treated value for sensor 1 + Serial.print(treatValue(value2), BYTE); // send the treated value for sensor 2 + Serial.println(); +} diff --git a/build/shared/dist/examples/serial_comm/analog_read_send/analog_read_send.pde b/build/shared/dist/examples/serial_comm/analog_read_send/analog_read_send.pde new file mode 100644 index 000000000..850bd78c9 --- /dev/null +++ b/build/shared/dist/examples/serial_comm/analog_read_send/analog_read_send.pde @@ -0,0 +1,32 @@ +/* Analog Read Send + * ---------------- + * + * turns on and off a light emitting diode(LED) connected to digital + * pin 13. The amount of time the LED will be on and off depends on + * the value obtained by analogRead(). In the easiest case we connect + * a potentiometer to analog pin 2. Sends the data back to a computer + * over the serial port. + * + * Created 1 December 2005 + * copyleft 2005 DojoDave + * http://arduino.berlios.de + * + */ + +int potPin = 2; // select the input pin for the potentiometer +int ledPin = 13; // select the pin for the LED +int val = 0; // variable to store the value coming from the sensor + +void setup() { + pinMode(ledPin, OUTPUT); // declare the ledPin as an OUTPUT + Serial.begin(9600); // use the serial port to send the values back to the computer +} + +void loop() { + val = analogRead(potPin); // read the value from the sensor + Serial.println(val); // print the value to the serial port + digitalWrite(ledPin, HIGH); // turn the ledPin on + delay(val); // stop the program for some time + digitalWrite(ledPin, LOW); // turn the ledPin off + delay(val); // stop the program for some time +} diff --git a/build/shared/dist/examples/serial_comm/double_counter/double_counter.pde b/build/shared/dist/examples/serial_comm/double_counter/double_counter.pde new file mode 100644 index 000000000..22494055b --- /dev/null +++ b/build/shared/dist/examples/serial_comm/double_counter/double_counter.pde @@ -0,0 +1,37 @@ +/* Double Counter + * -------------- + * + * This program creates a double counter + * and sends the information over the port + * back to the computer. + * It can be used to test the connection of two different + * sensors to the board at the same time. + * + * (cleft) 2005 David Cuartielles for DojoCorp + * @author: D. Cuartielles + * @credits: Greg and Nima from SFU + */ + +int count = 0; + +void setup() { + Serial.begin(9600); +} + +void loop() { + // counter A will go forwards + Serial.print('A'); + Serial.print(count); + Serial.println(); + delay(1000); + + // counter B will go backwards + Serial.print('B'); + Serial.print(1024 - count); + Serial.println(); + delay(1000); + + // increase and reset the counter (if needed) + count++; + if (count == 1024) count = 0; +} diff --git a/build/shared/dist/examples/serial_comm/serialCom_strings/serialCom_strings.pde b/build/shared/dist/examples/serial_comm/serialCom_strings/serialCom_strings.pde new file mode 100644 index 000000000..ef2c9d41b --- /dev/null +++ b/build/shared/dist/examples/serial_comm/serialCom_strings/serialCom_strings.pde @@ -0,0 +1,86 @@ +/* ------------------------------------------------ +* SERIAL COM - HANDELING MULTIPLE BYTES inside ARDUINO - 04_function development +* by beltran berrocal +* +* this prog establishes a connection with the pc and waits for it to send him +* a long string of characters like "hello Arduino!". +* Then Arduino informs the pc that it heard the whole sentence +* +* the same as examlpe 03 but it deploys 2 reusable functions. +* for doing the same job. +* readSerialString() and printSerialString() +* you just need to instantiate an array that will hold all the chars of the string +* I've put a 100 value for excess, but if you exactly know how many bytes you are expecting +* simply write it down inside the brackets [yourLengthHere] +* +* created 16 Decembre 2005; +* copyleft 2005 Progetto25zero1 +* +* --------------------------------------------------- */ + +char serInString[100]; // array that will hold the different bytes of the string. 100=100characters; + // -> you must state how long the array will be else it won't work properly + +//read a string from the serial and store it in an array +//you must supply the array variable +void readSerialString (char *strArray) { + int i = 0; + if(Serial.available()) { + Serial.print("reading Serial String: "); //optional: for confirmation + while (serialAvailable()){ + strArray[i] = Serial.read(); + i++; + Serial.write(strArray[(i-1)]); //optional: for confirmation + } + Serial.println(); //optional: for confirmation + } +} + +//Print the whole string at once - will be performed only if thers is data inside it +//you must supply the array variable +void printSerialString(char *strArray) { + int i=0; + if (strArray[i] != 0) { + while(strArray[i] != 0) { + Serial.print( strArray[i] ); + strArray[i] = 0; // optional: flush the content + i++; + } + } +} + +//utility function to know wither an array is empty or not +boolean isStringEmpty(char *strArray) { + if (strArray[0] == 0) { + return true; + } else { + return false; + } +} + +void setup() { + Serial.begin(9600); +} + +void loop () { + //simple feedback from Arduino + Serial.println("Hello World"); + + //read the serial port and create a string out of what you read + readSerialString(serInString); + + //do somenthing else perhaps wait for other data or read another Serial string + Serial.println("------------ arduino is doing somenthing else "); + + + if( isStringEmpty(serInString) == false) { //this check is optional + Serial.println("Arduino recorded that you said: "); + //try to print out collected information. it will do it only if there actually is some info. + printSerialString(serInString); + Serial.println(); + } + + Serial.println(); + //slows down the visualization in the terminal + delay(2000); +} diff --git a/build/shared/dist/examples/serial_comm/serial_read_advanced/serial_read_advanced.pde b/build/shared/dist/examples/serial_comm/serial_read_advanced/serial_read_advanced.pde new file mode 100644 index 000000000..34c8fc114 --- /dev/null +++ b/build/shared/dist/examples/serial_comm/serial_read_advanced/serial_read_advanced.pde @@ -0,0 +1,43 @@ +/* Serial Read Advanced + * -------------------- + * + * turns on and off a light emitting diode(LED) connected to digital + * pin 13. The LED will light up when receiving a 'H' over the serial + * port. The LED will blink shortly. + * + * Created 1 December 2005 + * copyleft 2005 DojoDave + * http://arduino.berlios.de + * + */ + +int ledPin = 13; // select the pin for the LED +int val = 0; // variable to store the data from the serial port +int serbyte = 0; // variable to store the VALID data from the port + +void setup() { + pinMode(ledPin,OUTPUT); // declare the LED's pin as output + Serial.begin(9600); // connect to the serial port +} + +void loop () { + // read the serial port + serbyte = Serial.read(); + + // if the input is '-1' then there is no data + // at the input, otherwise store it + if (val != -1) { + val = serbyte; + } + + // if the stored value is 'H' turn the LED on + if (val == 'H') { + digitalWrite(ledPin, HIGH); + } else { + digitalWrite(ledPin, LOW); + } + + delay(200); + +} + diff --git a/build/shared/dist/examples/serial_comm/serial_read_basic/serial_read_basic.pde b/build/shared/dist/examples/serial_comm/serial_read_basic/serial_read_basic.pde new file mode 100644 index 000000000..cffd7da02 --- /dev/null +++ b/build/shared/dist/examples/serial_comm/serial_read_basic/serial_read_basic.pde @@ -0,0 +1,35 @@ +/* Serial Read Basic + * ----------------- + * + * turns on and off a light emitting diode(LED) connected to digital + * pin 13. The LED will light up when receiving a 'H' over the serial + * port. The LED will blink shortly. + * + * Created 1 December 2005 + * copyleft 2005 DojoDave + * http://arduino.berlios.de + * + */ + +int ledPin = 13; // select the pin for the LED +int val = 0; // variable to store the data from the serial port + +void setup() { + pinMode(ledPin,OUTPUT); // declare the LED's pin as output + Serial.begin(9600); // connect to the serial port +} + +void loop () { + // read the serial port + val = Serial.read(); + + // if the input is '-1' then there is no data + // at the input, otherwise check out if it is 'H' + if (val != -1) { + if (val == 'H') { + digitalWrite(ledPin, HIGH); + delay(200); + digitalWrite(ledPin, LOW); + } + } +} diff --git a/build/shared/dist/examples/serial_comm/serial_write_basic/serial_write_basic.pde b/build/shared/dist/examples/serial_comm/serial_write_basic/serial_write_basic.pde new file mode 100644 index 000000000..fa4f2be48 --- /dev/null +++ b/build/shared/dist/examples/serial_comm/serial_write_basic/serial_write_basic.pde @@ -0,0 +1,40 @@ +/* Serial Write Basic + * ------------------ + * + * turns on and off a light emitting diode(LED) connected to digital + * pin 13. The LED will light up when pressing a button. At the same + * time, Arduino will send two different strings over the serial + * port depending if the button is pressed or released. + * + * Created 1 December 2005 + * copyleft 2005 DojoDave + * http://arduino.berlios.de + * + */ + +int ledPin = 13; // select the pin for the LED +int buttonPin = 2; // select the pin for the button +int val = 0; // variable to store the data from the serial port + +void setup() { + pinMode(ledPin,OUTPUT); // declare the LED's pin as output + pinMode(buttonPin, INPUT); // delcare the button pin as input + Serial.begin(9600); // connect to the serial port +} + +void loop () { + // read the button and store the value + val = digitalRead(buttonPin); + + // if the button is at HIGH, turn the LED on, off otherwise + if (val == HIGH) { + Serial.print("HIGH"); + digitalWrite(ledPin, HIGH); + } else { + Serial.print("LOW"); + digitalWrite(ledPin, LOW); + } + + Serial.println(); + delay(1000); // convenient to use delays when sending stuff back to the comp. +} diff --git a/build/windows/make.sh b/build/windows/make.sh index 1091d961d..82ab2a9d1 100755 --- a/build/windows/make.sh +++ b/build/windows/make.sh @@ -73,14 +73,15 @@ else #cp dist/core/makefile.win work/core/Makefile cp -r ../../targets work/lib/ - # take care of the examples - mkdir work/examples - cd work/examples - cp ../../../shared/dist/examples.zip . - echo Extracting examples ... - unzip -q -d . examples.zip - rm -f examples.zip - cd ../.. + # take care of the examples + cp -r ../shared/dist/examples work/ + #mkdir work/examples + #cd work/examples + #cp ../../../shared/dist/examples.zip . + #echo Extracting examples ... + #unzip -q -d . examples.zip + #rm -f examples.zip + #cd ../.. # chmod +x the crew find work -name "*.dll" -exec chmod +x {} ';' diff --git a/readme.txt b/readme.txt index 6bd07b97d..5963d9a99 100644 --- a/readme.txt +++ b/readme.txt @@ -58,6 +58,7 @@ Now display binary sketch size on upload, and give error if too big. Added C++ serial library. Resynced with Processing/Wiring IDE code (improved auto-format, faster logging to serial monitor console, other bug fixes) +New library system. 0003 - 2006.01.16