This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import cc.arduino.*; | |
import processing.serial.*; | |
Arduino arduino; | |
int servo1Pin = 9; // Control pin for servo motor | |
int servo2Pin = 10; // Control pin for servo motor | |
int servo3Pin = 11; // Control pin for servo motor | |
int penposn; | |
void setup(){ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Convert a JPG image to gcode for Mr Beam | |
* To use, put the .jpg you want to use in the /data folder of your sketch and adjust the canvas size(x,y) to suit the image, | |
* Use the feedrate, laserfloor and lasermax variables to determine how fast and how hard it burns. | |
This program is free software: you can redistribute it and/or modify | |
it under the terms of the GNU General Public License as published by | |
the Free Software Foundation, either version 3 of the License, or | |
(at your option) any later version. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Wire.h> | |
//wire library | |
/* | |
Sourced from | |
http://www.instructables.com/id/Thermostat-Microcontroller-with-an-Arduino-and-a-T/step4/TC74-Arduino-code/ | |
and modified a bit! | |
*/ | |
//works better when you connect SDA and SCLK |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//insert gpl code headers here | |
//macro cycle: | |
//setup: intitalise, read all devices and send, wait for gps acquisition | |
//loop: null | |
//interrupt: | |
//1)read in ADC's (direct port sampling) | |
//2)read out GPS timestamp (TIMEMARK) and position (UART or SPI) | |
//3)read out extra data (temp, pressure, humidity) (I2C) | |
//3.1)maybe read some more out of the adc's (3 samples?) direct port sampling, cycle clock | |
//4)apply high level trigger (threshold?) test. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
DigitalReadSerial | |
Reads a digital input on pin 2, prints the result to the serial monitor | |
This example code is in the public domain. | |
*/ | |
// digital pin 2 has a pushbutton attached to it. Give it a name: | |
//int pushButton = 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
DigitalReadSerial | |
Reads a digital input on pin 2, prints the result to the serial monitor | |
This example code is in the public domain. | |
*/ | |
// digital pin 2 has a pushbutton attached to it. Give it a name: | |
//int pushButton = 2; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// HTU21D-F is on Arduino Due I2C Bus 2, followed the guidance on forum.arduino.cc/index.php?topic=216359.0 to make it work | |
//modifications to HTU21DF.h and .cpp not included in this file. Also commented out delay.h as it's AVR not ARM. | |
#include <Adafruit_Sensor.h> | |
#include <Adafruit_L3GD20_U.h> | |
#include <Adafruit_BMP085_U.h> | |
#include <Adafruit_LSM303_U.h> | |
#include <Adafruit_10DOF.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_GPS.h> | |
#include <Adafruit_Sensor.h> | |
#include <Adafruit_L3GD20_U.h> | |
#include <Adafruit_BMP085_U.h> | |
#include <Adafruit_LSM303_U.h> | |
#include <Adafruit_10DOF.h> | |
#include <Adafruit_HTU21DF.h> | |
#include <Wire.h> | |
#define mySerial Serial1 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
unsigned long start_time; | |
unsigned long stop_time; | |
unsigned long values[2000]; | |
void setup() { | |
Serial.begin(115200); | |
REG_ADC_MR = 0x10380180; // change from 10380200 to 10380180, 1 is the PREESCALER and 8 means FREERUN | |
ADC -> ADC_CHER = 0x03; // enable ADC on pin A0 | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int sensorPin0 = A0; // select the input pin for the potentiometer | |
int sensorPin1 = A1; // select the input pin for the potentiometer | |
int sensorPin2 = A2; // select the input pin for the potentiometer | |
int sensorPin3 = A3; // select the input pin for the potentiometer | |
int sensorPin4 = A4; // select the input pin for the potentiometer | |
int sensorPin5 = A5; // select the input pin for the potentiometer | |
int sensorPin6= A6; // select the input pin for the potentiometer | |
int sensorPin7 = A7; // select the input pin for the potentiometer | |
int sensorPin8 = A8; // select the input pin for the potentiometer | |
int sensorPin9 = A9; // select the input pin for the potentiometer |