arduino-mk 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (51) hide show
  1. data/README.md +60 -0
  2. data/lib/arduino-mk.rb +10 -0
  3. data/lib/arduino-mk/base.rb +61 -0
  4. data/lib/arduino-mk/error_improver.rb +42 -0
  5. data/lib/arduino-mk/makefile/runner.rb +23 -0
  6. data/lib/arduino-mk/makefile/template.rb +27 -0
  7. data/lib/arduino-mk/null_project.rb +5 -0
  8. data/lib/arduino-mk/null_project/null.c +1 -0
  9. data/lib/arduino-mk/option_parser.rb +35 -0
  10. data/lib/arduino-mk/project_copier.rb +9 -0
  11. data/vendor/Arduino-Makefile/Arduino.mk +1306 -0
  12. data/vendor/Arduino-Makefile/CONTRIBUTING.md +35 -0
  13. data/vendor/Arduino-Makefile/Common.mk +46 -0
  14. data/vendor/Arduino-Makefile/HISTORY.md +225 -0
  15. data/vendor/Arduino-Makefile/README.md +189 -0
  16. data/vendor/Arduino-Makefile/ard-reset-arduino.1 +48 -0
  17. data/vendor/Arduino-Makefile/arduino-mk-vars.md +1101 -0
  18. data/vendor/Arduino-Makefile/bin/ard-reset-arduino +38 -0
  19. data/vendor/Arduino-Makefile/chipKIT.mk +109 -0
  20. data/vendor/Arduino-Makefile/examples/ATtinyBlink/ATtinyBlink.ino +23 -0
  21. data/vendor/Arduino-Makefile/examples/ATtinyBlink/Makefile +13 -0
  22. data/vendor/Arduino-Makefile/examples/AnalogInOutSerial/AnalogInOutSerial.ino +53 -0
  23. data/vendor/Arduino-Makefile/examples/AnalogInOutSerial/Makefile +4 -0
  24. data/vendor/Arduino-Makefile/examples/Blink/Blink.ino +19 -0
  25. data/vendor/Arduino-Makefile/examples/Blink/Makefile +5 -0
  26. data/vendor/Arduino-Makefile/examples/BlinkChipKIT/BlinkChipKIT.pde +19 -0
  27. data/vendor/Arduino-Makefile/examples/BlinkChipKIT/Makefile +5 -0
  28. data/vendor/Arduino-Makefile/examples/BlinkInAVRC/Makefile +16 -0
  29. data/vendor/Arduino-Makefile/examples/BlinkInAVRC/blink.c +38 -0
  30. data/vendor/Arduino-Makefile/examples/BlinkWithoutDelay/BlinkWithoutDelay.ino +65 -0
  31. data/vendor/Arduino-Makefile/examples/BlinkWithoutDelay/Makefile +4 -0
  32. data/vendor/Arduino-Makefile/examples/Fade/Fade.ino +31 -0
  33. data/vendor/Arduino-Makefile/examples/Fade/Makefile +4 -0
  34. data/vendor/Arduino-Makefile/examples/HelloWorld/HelloWorld.ino +58 -0
  35. data/vendor/Arduino-Makefile/examples/HelloWorld/Makefile +4 -0
  36. data/vendor/Arduino-Makefile/examples/MakefileExample/Makefile-example.mk +55 -0
  37. data/vendor/Arduino-Makefile/examples/README.md +7 -0
  38. data/vendor/Arduino-Makefile/examples/TinySoftWareSerial/Makefile +14 -0
  39. data/vendor/Arduino-Makefile/examples/TinySoftWareSerial/TinySoftwareSerial.ino +12 -0
  40. data/vendor/Arduino-Makefile/examples/WebServer/Makefile +6 -0
  41. data/vendor/Arduino-Makefile/examples/WebServer/WebServer.ino +82 -0
  42. data/vendor/Arduino-Makefile/examples/master_reader/Makefile +6 -0
  43. data/vendor/Arduino-Makefile/examples/master_reader/master_reader.ino +32 -0
  44. data/vendor/Arduino-Makefile/examples/toneMelody/Makefile +4 -0
  45. data/vendor/Arduino-Makefile/examples/toneMelody/pitches.h +95 -0
  46. data/vendor/Arduino-Makefile/examples/toneMelody/toneMelody.ino +49 -0
  47. data/vendor/Arduino-Makefile/licence.txt +502 -0
  48. data/vendor/Arduino-Makefile/packaging/debian/README.md +23 -0
  49. data/vendor/Arduino-Makefile/packaging/fedora/README.md +39 -0
  50. data/vendor/Arduino-Makefile/packaging/fedora/arduino-mk.spec +70 -0
  51. metadata +110 -0
@@ -0,0 +1,4 @@
1
+ BOARD_TAG = uno
2
+ ARDUINO_LIBS =
3
+
4
+ include ../../Arduino.mk
@@ -0,0 +1,58 @@
1
+ /*
2
+ LiquidCrystal Library - Hello World
3
+
4
+ Demonstrates the use a 16x2 LCD display. The LiquidCrystal
5
+ library works with all LCD displays that are compatible with the
6
+ Hitachi HD44780 driver. There are many of them out there, and you
7
+ can usually tell them by the 16-pin interface.
8
+
9
+ This sketch prints "Hello World!" to the LCD
10
+ and shows the time.
11
+
12
+ The circuit:
13
+ * LCD RS pin to digital pin 12
14
+ * LCD Enable pin to digital pin 11
15
+ * LCD D4 pin to digital pin 5
16
+ * LCD D5 pin to digital pin 4
17
+ * LCD D6 pin to digital pin 3
18
+ * LCD D7 pin to digital pin 2
19
+ * LCD R/W pin to ground
20
+ * 10K resistor:
21
+ * ends to +5V and ground
22
+ * wiper to LCD VO pin (pin 3)
23
+
24
+ Library originally added 18 Apr 2008
25
+ by David A. Mellis
26
+ library modified 5 Jul 2009
27
+ by Limor Fried (http://www.ladyada.net)
28
+ example added 9 Jul 2009
29
+ by Tom Igoe
30
+ modified 22 Nov 2010
31
+ by Tom Igoe
32
+
33
+ This example code is in the public domain.
34
+
35
+ http://www.arduino.cc/en/Tutorial/LiquidCrystal
36
+ */
37
+
38
+ // include the library code:
39
+ #include <LiquidCrystal.h>
40
+
41
+ // initialize the library with the numbers of the interface pins
42
+ LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
43
+
44
+ void setup() {
45
+ // set up the LCD's number of columns and rows:
46
+ lcd.begin(16, 2);
47
+ // Print a message to the LCD.
48
+ lcd.print("hello, world!");
49
+ }
50
+
51
+ void loop() {
52
+ // set the cursor to column 0, line 1
53
+ // (note: line 1 is the second row, since counting begins with 0):
54
+ lcd.setCursor(0, 1);
55
+ // print the number of seconds since reset:
56
+ lcd.print(millis()/1000);
57
+ }
58
+
@@ -0,0 +1,4 @@
1
+ BOARD_TAG = uno
2
+ ARDUINO_LIBS = LiquidCrystal
3
+
4
+ include ../../Arduino.mk
@@ -0,0 +1,55 @@
1
+ ### DISCLAIMER
2
+ ### This is an example Makefile and it MUST be configured to suit your needs.
3
+ ### For detailled explanations about all the avalaible options,
4
+ ### please refer to https://github.com/sudar/Arduino-Makefile/blob/master/arduino-mk-vars.md
5
+
6
+ ### PROJECT_DIR
7
+ ### This is the path to where you have created/cloned your project
8
+ PROJECT_DIR = /Users/Ladislas/dev/leka/moti
9
+
10
+ ### ARDMK_DIR
11
+ ### Path to the Arduino-Makefile directory.
12
+ ARDMK_DIR = $(PROJECT_DIR)/arduino-mk
13
+
14
+ ### ARDUINO_DIR
15
+ ### Path to the Arduino application and ressources directory.
16
+ ARDUINO_DIR = /Applications/Arduino.app/Contents/Resources/Java
17
+
18
+ ### USER_LIB_PATH
19
+ ### Path to where the your project's libraries are stored.
20
+ USER_LIB_PATH := $(PROJECT_DIR)/lib
21
+
22
+ ### BOARD_TAG
23
+ ### It must be set to the board you are currently using. (i.e uno, mega2560, etc.)
24
+ BOARD_TAG = mega2560
25
+
26
+ ### MONITOR_BAUDRATE
27
+ ### It must be set to Serial baudrate value you are using.
28
+ MONITOR_BAUDRATE = 115200
29
+
30
+ ### AVR_TOOLS_DIR
31
+ ### Path to the AVR tools directory such as avr-gcc, avr-g++, etc.
32
+ AVR_TOOLS_DIR = /usr/local
33
+
34
+ ### AVRDDUDE
35
+ ### Path to avrdude directory.
36
+ AVRDDUDE = /usr/local/bin/avrdude
37
+
38
+ ### CPPFLAGS
39
+ ### Flags you might want to set for debugging purpose. Comment to stop.
40
+ CPPFLAGS = -pedantic -Wall -Wextra
41
+
42
+ ### MONITOR_PORT
43
+ ### The port your board is connected to. Using an '*' tries all the ports and finds the right one.
44
+ MONITOR_PORT = /dev/tty.usbmodem*
45
+
46
+ ### don't touch this
47
+ CURRENT_DIR = $(shell basename $(CURDIR))
48
+
49
+ ### OBJDIR
50
+ ### This is were you put the binaries you just compile using 'make'
51
+ OBJDIR = $(PROJECT_DIR)/bin/$(BOARD_TAG)/$(CURRENT_DIR)
52
+
53
+ ### path to Arduino.mk, inside the ARDMK_DIR, don't touch.
54
+ include $(ARDMK_DIR)/Arduino.mk
55
+
@@ -0,0 +1,7 @@
1
+ This folder contains the list of example Arduino sketches and makefile showing the different usage patterns
2
+
3
+ - Blink - Shows normal usage
4
+ - HelloWorld - Shows how to include Arduino libraries
5
+ - BlinkInAVRC - Shows how to use plain AVR C code
6
+ - BlinkChipKIT - Shows how to use ChipKIT
7
+ - ATtinyBlink - Shows how to use different cores like ATtiny
@@ -0,0 +1,14 @@
1
+ # Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
2
+
3
+ # if you have placed the alternate core in your sketchbook directory, then you can just mention the core name alone.
4
+ ALTERNATE_CORE = attiny
5
+ # If not, you might have to include the full path.
6
+ #ALTERNATE_CORE_PATH = /home/sudar/Dropbox/code/arduino-sketches/hardware/attiny/
7
+
8
+ BOARD_TAG = attiny85-8
9
+
10
+ ARDUINO_LIBS = SoftwareSerial
11
+
12
+ include $(ARDMK_DIR)/Arduino.mk
13
+
14
+ # !!! Important. You have to use make ispload to upload when using ISP programmer
@@ -0,0 +1,12 @@
1
+ #include <SoftwareSerial.h>
2
+
3
+ SoftwareSerial mySerial(3, 4); // RX, TX
4
+
5
+ void setup() {
6
+ mySerial.begin(9600);
7
+ }
8
+
9
+ void loop() {
10
+ mySerial.println(millis());
11
+ delay(1000);
12
+ }
@@ -0,0 +1,6 @@
1
+ # Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
2
+
3
+ BOARD_TAG = uno
4
+ ARDUINO_LIBS = Ethernet SPI
5
+
6
+ include ../../Arduino.mk
@@ -0,0 +1,82 @@
1
+ /*
2
+ Web Server
3
+
4
+ A simple web server that shows the value of the analog input pins.
5
+ using an Arduino Wiznet Ethernet shield.
6
+
7
+ Circuit:
8
+ * Ethernet shield attached to pins 10, 11, 12, 13
9
+ * Analog inputs attached to pins A0 through A5 (optional)
10
+
11
+ created 18 Dec 2009
12
+ by David A. Mellis
13
+ modified 4 Sep 2010
14
+ by Tom Igoe
15
+
16
+ */
17
+
18
+ #include <SPI.h>
19
+ #include <Ethernet.h>
20
+
21
+ // Enter a MAC address and IP address for your controller below.
22
+ // The IP address will be dependent on your local network:
23
+ byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED };
24
+ IPAddress ip(192,168,1, 178);
25
+
26
+ // Initialize the Ethernet server library
27
+ // with the IP address and port you want to use
28
+ // (port 80 is default for HTTP):
29
+ EthernetServer server(80);
30
+
31
+ void setup()
32
+ {
33
+ // start the Ethernet connection and the server:
34
+ Ethernet.begin(mac, ip);
35
+ server.begin();
36
+ }
37
+
38
+ void loop()
39
+ {
40
+ // listen for incoming clients
41
+ EthernetClient client = server.available();
42
+ if (client) {
43
+ // an http request ends with a blank line
44
+ boolean currentLineIsBlank = true;
45
+ while (client.connected()) {
46
+ if (client.available()) {
47
+ char c = client.read();
48
+ // if you've gotten to the end of the line (received a newline
49
+ // character) and the line is blank, the http request has ended,
50
+ // so you can send a reply
51
+ if (c == '\n' && currentLineIsBlank) {
52
+ // send a standard http response header
53
+ client.println("HTTP/1.1 200 OK");
54
+ client.println("Content-Type: text/html");
55
+ client.println();
56
+
57
+ // output the value of each analog input pin
58
+ for (int analogChannel = 0; analogChannel < 6; analogChannel++) {
59
+ client.print("analog input ");
60
+ client.print(analogChannel);
61
+ client.print(" is ");
62
+ client.print(analogRead(analogChannel));
63
+ client.println("<br />");
64
+ }
65
+ break;
66
+ }
67
+ if (c == '\n') {
68
+ // you're starting a new line
69
+ currentLineIsBlank = true;
70
+ }
71
+ else if (c != '\r') {
72
+ // you've gotten a character on the current line
73
+ currentLineIsBlank = false;
74
+ }
75
+ }
76
+ }
77
+ // give the web browser time to receive the data
78
+ delay(1);
79
+ // close the connection:
80
+ client.stop();
81
+ }
82
+ }
@@ -0,0 +1,6 @@
1
+ # Arduino Make file. Refer to https://github.com/sudar/Arduino-Makefile
2
+
3
+ BOARD_TAG = uno
4
+ ARDUINO_LIBS = Wire
5
+
6
+ include ../../Arduino.mk
@@ -0,0 +1,32 @@
1
+ // Wire Master Reader
2
+ // by Nicholas Zambetti <http://www.zambetti.com>
3
+
4
+ // Demonstrates use of the Wire library
5
+ // Reads data from an I2C/TWI slave device
6
+ // Refer to the "Wire Slave Sender" example for use with this
7
+
8
+ // Created 29 March 2006
9
+
10
+ // This example code is in the public domain.
11
+
12
+
13
+ #include <Wire.h>
14
+
15
+ void setup()
16
+ {
17
+ Wire.begin(); // join i2c bus (address optional for master)
18
+ Serial.begin(9600); // start serial for output
19
+ }
20
+
21
+ void loop()
22
+ {
23
+ Wire.requestFrom(2, 6); // request 6 bytes from slave device #2
24
+
25
+ while(Wire.available()) // slave may send less than requested
26
+ {
27
+ char c = Wire.read(); // receive a byte as character
28
+ Serial.print(c); // print the character
29
+ }
30
+
31
+ delay(500);
32
+ }
@@ -0,0 +1,4 @@
1
+ BOARD_TAG = uno
2
+ ARDUINO_LIBS =
3
+
4
+ include ../../Arduino.mk
@@ -0,0 +1,95 @@
1
+ /*************************************************
2
+ * Public Constants
3
+ *************************************************/
4
+
5
+ #define NOTE_B0 31
6
+ #define NOTE_C1 33
7
+ #define NOTE_CS1 35
8
+ #define NOTE_D1 37
9
+ #define NOTE_DS1 39
10
+ #define NOTE_E1 41
11
+ #define NOTE_F1 44
12
+ #define NOTE_FS1 46
13
+ #define NOTE_G1 49
14
+ #define NOTE_GS1 52
15
+ #define NOTE_A1 55
16
+ #define NOTE_AS1 58
17
+ #define NOTE_B1 62
18
+ #define NOTE_C2 65
19
+ #define NOTE_CS2 69
20
+ #define NOTE_D2 73
21
+ #define NOTE_DS2 78
22
+ #define NOTE_E2 82
23
+ #define NOTE_F2 87
24
+ #define NOTE_FS2 93
25
+ #define NOTE_G2 98
26
+ #define NOTE_GS2 104
27
+ #define NOTE_A2 110
28
+ #define NOTE_AS2 117
29
+ #define NOTE_B2 123
30
+ #define NOTE_C3 131
31
+ #define NOTE_CS3 139
32
+ #define NOTE_D3 147
33
+ #define NOTE_DS3 156
34
+ #define NOTE_E3 165
35
+ #define NOTE_F3 175
36
+ #define NOTE_FS3 185
37
+ #define NOTE_G3 196
38
+ #define NOTE_GS3 208
39
+ #define NOTE_A3 220
40
+ #define NOTE_AS3 233
41
+ #define NOTE_B3 247
42
+ #define NOTE_C4 262
43
+ #define NOTE_CS4 277
44
+ #define NOTE_D4 294
45
+ #define NOTE_DS4 311
46
+ #define NOTE_E4 330
47
+ #define NOTE_F4 349
48
+ #define NOTE_FS4 370
49
+ #define NOTE_G4 392
50
+ #define NOTE_GS4 415
51
+ #define NOTE_A4 440
52
+ #define NOTE_AS4 466
53
+ #define NOTE_B4 494
54
+ #define NOTE_C5 523
55
+ #define NOTE_CS5 554
56
+ #define NOTE_D5 587
57
+ #define NOTE_DS5 622
58
+ #define NOTE_E5 659
59
+ #define NOTE_F5 698
60
+ #define NOTE_FS5 740
61
+ #define NOTE_G5 784
62
+ #define NOTE_GS5 831
63
+ #define NOTE_A5 880
64
+ #define NOTE_AS5 932
65
+ #define NOTE_B5 988
66
+ #define NOTE_C6 1047
67
+ #define NOTE_CS6 1109
68
+ #define NOTE_D6 1175
69
+ #define NOTE_DS6 1245
70
+ #define NOTE_E6 1319
71
+ #define NOTE_F6 1397
72
+ #define NOTE_FS6 1480
73
+ #define NOTE_G6 1568
74
+ #define NOTE_GS6 1661
75
+ #define NOTE_A6 1760
76
+ #define NOTE_AS6 1865
77
+ #define NOTE_B6 1976
78
+ #define NOTE_C7 2093
79
+ #define NOTE_CS7 2217
80
+ #define NOTE_D7 2349
81
+ #define NOTE_DS7 2489
82
+ #define NOTE_E7 2637
83
+ #define NOTE_F7 2794
84
+ #define NOTE_FS7 2960
85
+ #define NOTE_G7 3136
86
+ #define NOTE_GS7 3322
87
+ #define NOTE_A7 3520
88
+ #define NOTE_AS7 3729
89
+ #define NOTE_B7 3951
90
+ #define NOTE_C8 4186
91
+ #define NOTE_CS8 4435
92
+ #define NOTE_D8 4699
93
+ #define NOTE_DS8 4978
94
+
95
+
@@ -0,0 +1,49 @@
1
+ /*
2
+ Melody
3
+
4
+ Plays a melody
5
+
6
+ circuit:
7
+ * 8-ohm speaker on digital pin 8
8
+
9
+ created 21 Jan 2010
10
+ modified 30 Aug 2011
11
+ by Tom Igoe
12
+
13
+ This example code is in the public domain.
14
+
15
+ http://arduino.cc/en/Tutorial/Tone
16
+
17
+ */
18
+ #include "pitches.h"
19
+
20
+ // notes in the melody:
21
+ int melody[] = {
22
+ NOTE_C4, NOTE_G3,NOTE_G3, NOTE_A3, NOTE_G3,0, NOTE_B3, NOTE_C4};
23
+
24
+ // note durations: 4 = quarter note, 8 = eighth note, etc.:
25
+ int noteDurations[] = {
26
+ 4, 8, 8, 4,4,4,4,4 };
27
+
28
+ void setup() {
29
+ // iterate over the notes of the melody:
30
+ for (int thisNote = 0; thisNote < 8; thisNote++) {
31
+
32
+ // to calculate the note duration, take one second
33
+ // divided by the note type.
34
+ //e.g. quarter note = 1000 / 4, eighth note = 1000/8, etc.
35
+ int noteDuration = 1000/noteDurations[thisNote];
36
+ tone(8, melody[thisNote],noteDuration);
37
+
38
+ // to distinguish the notes, set a minimum time between them.
39
+ // the note's duration + 30% seems to work well:
40
+ int pauseBetweenNotes = noteDuration * 1.30;
41
+ delay(pauseBetweenNotes);
42
+ // stop the tone playing:
43
+ noTone(8);
44
+ }
45
+ }
46
+
47
+ void loop() {
48
+ // no need to repeat the melody.
49
+ }