├── .gitignore ├── README.md ├── examples └── Digispark_Examples │ ├── CharliePlexMarquee │ └── charlieplex.ino │ ├── Charlieplex │ └── Charlieplex.ino │ ├── EEPROM │ └── EEPROM.ino │ ├── Expander │ └── Expander.ino │ ├── Infrared │ └── Infrared.ino │ ├── MotorShield │ └── MotorShield.ino │ ├── Rfm12b │ └── Rfm12b.ino │ └── Start │ └── Start.ino ├── hardware └── digispark │ ├── boards.txt │ ├── bootloaders │ ├── empty │ │ ├── empty2313at1.hex │ │ ├── empty2313at8.hex │ │ ├── empty24at16.hex │ │ ├── empty25at1.hex │ │ ├── empty25at8.hex │ │ ├── empty4313at1.hex │ │ ├── empty4313at8.hex │ │ ├── empty44at1.hex │ │ ├── empty44at8.hex │ │ ├── empty45at1.hex │ │ ├── empty45at8.hex │ │ ├── empty84at1.hex │ │ ├── empty84at16.hex │ │ ├── empty84at8.hex │ │ ├── empty85at1.hex │ │ ├── empty85at16.hex │ │ └── empty85at8.hex │ └── micronucleus │ │ ├── micronucleus-1.05-jumper-upgrade.hex │ │ └── micronucleus-1.06-upgrade.hex │ ├── cores │ ├── empty │ │ ├── Arduino.h │ │ ├── WProgram.h │ │ └── main.cpp │ └── tiny │ │ ├── Arduino.h │ │ ├── HardwareSerial.cpp │ │ ├── HardwareSerial.h │ │ ├── Print.cpp │ │ ├── Print.h │ │ ├── PwmTimer.h │ │ ├── Stream.h │ │ ├── TinyDebugSerial.cpp │ │ ├── TinyDebugSerial.h │ │ ├── TinyDebugSerial115200.cpp │ │ ├── TinyDebugSerial38400.cpp │ │ ├── TinyDebugSerial9600.cpp │ │ ├── TinyDebugSerialErrors.cpp │ │ ├── Tone.cpp │ │ ├── ToneTimer.h │ │ ├── UserTimer.h │ │ ├── WCharacter.h │ │ ├── WConstants.h │ │ ├── WInterrupts.c │ │ ├── WMath.cpp │ │ ├── WProgram.h │ │ ├── WString.cpp │ │ ├── WString.h │ │ ├── binary.h │ │ ├── core_adc.h │ │ ├── core_build_options.h │ │ ├── core_macros.h │ │ ├── core_pins.h │ │ ├── core_timers.h │ │ ├── main.cpp │ │ ├── new.cpp │ │ ├── new.h │ │ ├── pins_arduino.c │ │ ├── pins_arduino.h │ │ ├── wiring.c │ │ ├── wiring.h │ │ ├── wiring_analog.c │ │ ├── wiring_digital.c │ │ ├── wiring_private.h │ │ ├── wiring_pulse.c │ │ └── wiring_shift.c │ ├── license.txt │ ├── programmers.txt │ └── readme.txt └── libraries ├── Arduino_SoftwareSerial ├── SoftwareSerial.cpp ├── SoftwareSerial.h ├── examples │ ├── SoftwareSerialExample │ │ └── SoftwareSerialExample.ino │ └── TwoPortReceive │ │ └── TwoPortReceive.ino └── keywords.txt ├── DFPlayer_Mini_Mp3 ├── DFPlayer_Mini_Mp3.cpp ├── DFPlayer_Mini_Mp3.h ├── README.md ├── examples │ ├── DFPlayer_DigisparkSoftSerial │ │ └── DFPlayer_DigisparkSoftSerial.ino │ ├── DFPlayer_Mini_Test │ │ └── DFPlayer_Mini_Test.ino │ ├── DFPlayer_SoftwareSerial │ │ └── DFPlayer_SoftwareSerial.ino │ ├── DFPlayer_receive │ │ └── DFPlayer_receive.ino │ └── DFPlayer_sample │ │ └── DFPlayer_sample.ino ├── keywords.txt └── license.txt ├── DigisparkIRLib ├── .gitattributes ├── .gitignore ├── CHANGELOG.txt ├── IRLib.cpp ├── IRLib.h ├── IRLibMatch.h ├── IRLibTimer.h ├── LICENSE.txt ├── README.txt └── examples │ ├── DigiIrDump │ └── DigiIrDump.ino │ ├── DigiIrRgbCtrl │ └── DigiIrRgbCtrl.ino │ ├── IRhashdecode │ └── IRhashdecode.ino │ ├── IRrecord │ └── IRrecord.ino │ ├── IRrecvDump │ └── IRrecvDump.ino │ ├── IRsendDemo │ └── IRsendDemo.ino │ ├── IRsendJVC │ └── IRsendJVC.ino │ ├── IRserial_remote │ ├── IRserial_remote.ino │ ├── IRserial_remote.py │ ├── POV-Ray │ │ └── remotebg.pov │ ├── click.wav │ └── remotebg.png │ ├── IRservo │ └── IRservo.ino │ └── Samsung36 │ └── Samsung36.ino ├── DigisparkJoystick ├── ArduinoNotes.txt ├── Changelog.txt ├── CommercialLicense.txt ├── DigiJoystick.h ├── DigiKeyboard.h.old ├── JoystickReadme.txt ├── License.txt ├── Readme.txt ├── USB-ID-FAQ.txt ├── USB-IDs-for-free.txt ├── USBID-License.txt ├── asmcommon.inc ├── examples │ └── Joystick │ │ └── Joystick.ino ├── keywords.txt ├── oddebug.c ├── oddebug.h ├── osccal.c ├── osccal.c.lst ├── osccal.h ├── osccal.o ├── osctune.h ├── usbconfig-prototype.h ├── usbconfig.h ├── usbdrv.c ├── usbdrv.h ├── usbdrvasm.S ├── usbdrvasm.asm ├── usbdrvasm12.inc ├── usbdrvasm128.inc ├── usbdrvasm15.inc ├── usbdrvasm16.inc ├── usbdrvasm165.inc ├── usbdrvasm18-crc.inc ├── usbdrvasm20.inc └── usbportability.h ├── DigisparkKeyboard ├── ArduinoNotes.txt ├── Changelog.txt ├── CommercialLicense.txt ├── DigiKeyboard.h ├── License.txt ├── Readme.txt ├── USB-ID-FAQ.txt ├── USB-IDs-for-free.txt ├── USBID-License.txt ├── asmcommon.inc ├── examples │ └── Keyboard │ │ └── Keyboard.ino ├── keywords.txt ├── oddebug.c ├── oddebug.h ├── osccal.c ├── osccal.c.lst ├── osccal.h ├── osccal.o ├── osctune.h ├── scancode-ascii-table.h ├── usbconfig-prototype.h ├── usbconfig.h ├── usbdrv.c ├── usbdrv.h ├── usbdrvasm.S ├── usbdrvasm.asm ├── usbdrvasm12.inc ├── usbdrvasm128.inc ├── usbdrvasm15.inc ├── usbdrvasm16.inc ├── usbdrvasm165.inc ├── usbdrvasm18-crc.inc ├── usbdrvasm20.inc └── usbportability.h ├── DigisparkLCD ├── LiquidCrystal_I2C.cpp ├── LiquidCrystal_I2C.h ├── examples │ └── BasicUsage │ │ └── BasicUsage.ino ├── info │ ├── BC557.pdf │ ├── Image.jpg │ ├── PCF8574P.pdf │ ├── Schematic_diagram.jpg │ ├── notes_for_pollin_interface.txt │ └── readme.txt └── keywords.txt ├── DigisparkLPD8806 ├── LPD8806.cpp ├── LPD8806.h ├── README.md └── examples │ ├── LEDbeltKit │ └── LEDbeltKit.pde │ ├── advancedLEDbeltKit │ └── advancedLEDbeltKit.pde │ ├── longstrandtest │ └── longstrandtest.pde │ └── strandtest │ └── strandtest.pde ├── DigisparkMouse ├── ArduinoNotes.txt ├── Changelog.txt ├── CommercialLicense.txt ├── DigiMouse.h ├── License.txt ├── MouseReadme.txt ├── Readme.txt ├── USB-ID-FAQ.txt ├── USB-IDs-for-free.txt ├── USBID-License.txt ├── asmcommon.inc ├── examples │ └── Mouse │ │ └── Mouse.ino ├── keywords.txt ├── oddebug.c ├── oddebug.h ├── osccal.c ├── osccal.c.lst ├── osccal.h ├── osccal.o ├── osctune.h ├── usbconfig-prototype.h ├── usbconfig.h ├── usbdrv.c ├── usbdrv.h ├── usbdrvasm.S ├── usbdrvasm.asm ├── usbdrvasm12.inc ├── usbdrvasm128.inc ├── usbdrvasm15.inc ├── usbdrvasm16.inc ├── usbdrvasm165.inc ├── usbdrvasm18-crc.inc ├── usbdrvasm20.inc └── usbportability.h ├── DigisparkRGB ├── DigisparkRGB.cpp ├── DigisparkRGB.h ├── examples │ └── DigisparkRGB │ │ └── DigisparkRGB.ino └── keywords.txt ├── DigisparkRcSeq ├── Examples │ ├── DigiRcSeqZodiac │ │ └── DigiRcSeqZodiac.ino │ ├── MultiPosSwitch │ │ └── MultiPosSwitch.ino │ ├── OnePropTo5 │ │ └── OnePropTo5.ino │ ├── RcSeqAdvancedDoors │ │ └── RcSeqAdvancedDoors.ino │ ├── RcSeqDemo │ │ └── RcSeqDemo.ino │ ├── RcSeqZodiac │ │ └── RcSeqZodiac.ino │ └── UneVoieVers8 │ │ └── UneVoieVers8.ino ├── RcSeq.cpp ├── RcSeq.h ├── Readme.md └── keywords.txt ├── DigisparkSimpleServo ├── .DS_Store ├── README.txt ├── SimpleServo.cpp ├── SimpleServo.h ├── examples │ └── .DS_Store └── keywords.txt ├── DigisparkSoftRcPulseIn ├── Readme.md ├── SoftRcPulseIn.cpp ├── SoftRcPulseIn.h ├── examples │ ├── SoftRcPulseInDebug │ │ └── SoftRcPulseInDebug.ino │ ├── SoftRcPulseInDemo │ │ └── SoftRcPulseInDemo.ino │ └── SoftRcPulseInOutDemo │ │ └── SoftRcPulseInOutDemo.ino └── keywords.txt ├── DigisparkSoftRcPulseOut ├── Readme.md ├── SoftRcPulseOut.cpp ├── SoftRcPulseOut.h ├── examples │ ├── Knob │ │ └── Knob.ino │ ├── SerialServo │ │ └── SerialServo.ino │ ├── SoftRcPulseInOutDemo │ │ └── SoftRcPulseInOutDemo.ino │ ├── Sweep │ │ └── Sweep.ino │ ├── SweepNoDelay │ │ └── SweepNoDelay.ino │ ├── Usb2Servos │ │ └── Usb2Servos.ino │ └── knob_moyennee │ │ └── knob_moyennee.ino └── keywords.txt ├── DigisparkSoftSerial ├── Readme.md ├── SoftSerial.cpp ├── SoftSerial.h ├── examples │ ├── Digi_1io_SerialDbg │ │ └── Digi_1io_SerialDbg.ino │ ├── SoftSerialExample │ │ └── SoftSerialExample.ino │ └── TwoPortReceive │ │ └── TwoPortReceive.ino └── keywords.txt ├── DigisparkTinyCppmGen ├── Readme.md ├── TinyCppmGen.cpp ├── TinyCppmGen.h ├── examples │ ├── RcCppmChSubst │ │ └── RcCppmChSubst.ino │ └── TinyCppmGenSweep │ │ └── TinyCppmGenSweep.ino └── keywords.txt ├── DigisparkTinyCppmReader ├── Readme.md ├── TinyCppmReader.cpp ├── TinyCppmReader.h ├── examples │ ├── RcCppmChSubst │ │ └── RcCppmChSubst.ino │ └── RcCppmReader │ │ └── RcCppmReader.ino └── keywords.txt ├── DigisparkTinyPinChange ├── Readme.md ├── TinyPinChange.cpp ├── TinyPinChange.h ├── examples │ ├── Edge │ │ └── Edge.ino │ ├── FallingEdge │ │ └── FallingEdge.ino │ ├── RisingEdge │ │ └── RisingEdge.ino │ └── TinyRcScope │ │ └── TinyRcScope.ino └── keywords.txt ├── DigisparkTinyRTClib ├── README.md ├── TinyRTClib.cpp ├── TinyRTClib.h ├── examples │ ├── datecalc │ │ └── datecalc.pde │ ├── ds1307 │ │ └── ds1307.pde │ └── softrtc │ │ └── softrtc.pde └── keywords.txt ├── DigisparkTinySoftPwm ├── Readme.md ├── TinySoftPwm.cpp ├── TinySoftPwm.h ├── examples │ ├── SoftPwm13Pins │ │ └── SoftPwm13Pins.ino │ └── TinySoftPwmDemo │ │ └── TinySoftPwmDemo.ino └── keywords.txt ├── DigisparkUSB ├── ArduinoNotes.txt ├── Changelog.txt ├── CommercialLicense.txt ├── DigiUSB.cpp ├── DigiUSB.h ├── DigisparkReadme.txt ├── License.txt ├── Readme.txt ├── USB-ID-FAQ.txt ├── USB-IDs-for-free.txt ├── USBID-License.txt ├── asmcommon.inc ├── examples │ ├── DigiBlink │ │ └── DigiBlink.ino │ ├── DigiScope │ │ └── DigiScope.ino │ ├── DigiUSB2LCD │ │ └── DigiUSB2LCD.ino │ └── Echo │ │ └── Echo.ino ├── keywords.txt ├── libs-device │ ├── Readme.txt │ ├── osccal.c │ ├── osccal.c.lst │ ├── osccal.h │ ├── osccal.o │ └── osctune.h ├── oddebug.c ├── oddebug.h ├── osccal.c ├── osccal.c.lst ├── osccal.h ├── osccal.o ├── osctune.h ├── rx_buffer.h ├── usbconfig-prototype.h ├── usbconfig.h ├── usbdrv.c ├── usbdrv.h ├── usbdrvasm.S ├── usbdrvasm.asm ├── usbdrvasm12.inc ├── usbdrvasm128.inc ├── usbdrvasm15.inc ├── usbdrvasm16.inc ├── usbdrvasm165.inc ├── usbdrvasm18-crc.inc ├── usbdrvasm20.inc └── usbportability.h ├── DigisparkVirtualWire ├── CHANGES ├── LICENSE ├── MANIFEST ├── Makefile ├── README ├── VirtualWire.cpp ├── VirtualWire.h ├── examples │ ├── client │ │ └── client.pde │ ├── receiver │ │ └── receiver.pde │ ├── server │ │ └── server.pde │ └── transmitter │ │ └── transmitter.pde ├── keywords.txt └── util │ └── crc16.h ├── RcBusRx ├── RcBusRx.cpp ├── RcBusRx.h ├── Readme.md ├── examples │ ├── 0_RcBusRxDemo │ │ └── 0_RcBusRxDemo.ino │ ├── 1_SbusRxDemo │ │ └── 1_SbusRxDemo.ino │ ├── 2_SrxlRxDemo │ │ └── 2_SrxlRxDemo.ino │ ├── 3_SumdRxDemo │ │ └── 3_SumdRxDemo.ino │ ├── 4_IbusRxDemo │ │ └── 4_IbusRxDemo.ino │ └── 5_JetiRxDemo │ │ └── 5_JetiRxDemo.ino ├── images │ └── RcBusRxDemo.png └── keywords.txt ├── RcRxSerial ├── RcRxSerial.cpp ├── RcRxSerial.h ├── examples │ └── RcTxRxSerialDemo │ │ └── RcTxRxSerialDemo.ino └── keywords.txt ├── RcTxSerial ├── RcTxSerial.cpp ├── RcTxSerial.h ├── examples │ └── RcTxRxSerialDemo │ │ └── RcTxRxSerialDemo.ino └── keywords.txt ├── Rcul ├── Rcul.h └── keywords.txt ├── SBusRx ├── Readme.md ├── SBusRx.cpp ├── SBusRx.h ├── examples │ └── SbusRxBasic │ │ └── SbusRxBasic.ino └── keywords.txt ├── SBusTx ├── Readme.md ├── SBusTx.cpp ├── SBusTx.h ├── examples │ ├── SBusServoTester │ │ └── SBusServoTester.ino │ └── SBusTxRxLoopback │ │ └── SBusTxRxLoopback.ino ├── keywords.txt └── screenshot.png ├── SrxlRx ├── SrxlRx.cpp ├── SrxlRx.h └── keywords.txt ├── TinyDbg ├── Readme.md ├── TinyDbg.cpp ├── TinyDbg.h ├── examples │ └── TinyDbgTest │ │ └── TinyDbgTest.ino ├── images │ ├── TinyDbgSketch.png │ └── TinyDbgTermSession.png └── library.properties ├── TinyOscCal ├── Readme.md ├── TinyOscCal.cpp ├── TinyOscCal.h └── examples │ └── TinyOscCalDemo │ └── TinyOscCalDemo.ino └── TinyWireM_Digispark ├── TinyWireM.cpp ├── TinyWireM.h ├── USI_TWI_Master.cpp ├── USI_TWI_Master.h ├── examples ├── Tiny85_Temp │ └── Tiny85_Temp.pde ├── Tiny85_Temp_LCD │ └── Tiny85_Temp_LCD.pde └── Tiny85_Temp_LCD_RTC │ └── Tiny85_Temp_LCD_RTC.pde └── keywords.txt /.gitignore: -------------------------------------------------------------------------------- 1 | /libraries/Wire 2 | /libraries/EEPROM 3 | /libraries/Esplora 4 | /libraries/Ethernet 5 | /libraries/Firmata 6 | /libraries/LiquidCrystal 7 | /libraries/SD 8 | /libraries/Servo 9 | /libraries/SoftwareSerial 10 | /libraries/SPI 11 | /libraries/Stepper 12 | /libraries/WiFi 13 | Digispark.app 14 | Digispark.zip 15 | install.rb 16 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | DigisparkArduinoIntegration 2 | =========================== -------------------------------------------------------------------------------- /examples/Digispark_Examples/Charlieplex/Charlieplex.ino: -------------------------------------------------------------------------------- 1 | void setup() { 2 | // initialize the digital pin as an output. 3 | 4 | 5 | } 6 | 7 | // the loop routine runs over and over again forever: 8 | void loop() { 9 | LEDon(0, 1); 10 | delay(1000); 11 | LEDon(0, 2); 12 | delay(1000); 13 | LEDon(0, 3); 14 | delay(1000); 15 | LEDon(0, 4); 16 | delay(1000); 17 | LEDon(1, 0); 18 | delay(1000); 19 | LEDon(1, 2); 20 | delay(1000); 21 | LEDon(1, 3); 22 | delay(1000); 23 | LEDon(1, 4); 24 | delay(1000); 25 | LEDon(2, 0); 26 | delay(1000); 27 | LEDon(2, 1); 28 | delay(1000); 29 | LEDon(2, 3); 30 | delay(1000); 31 | LEDon(2, 4); 32 | delay(1000); 33 | LEDon(3, 0); 34 | delay(1000); 35 | LEDon(3, 1); 36 | delay(1000); 37 | LEDon(3, 2); 38 | delay(1000); 39 | LEDon(3, 4); 40 | delay(1000); 41 | LEDon(4, 0); 42 | delay(1000); 43 | LEDon(4, 1); 44 | delay(1000); 45 | LEDon(4, 2); 46 | delay(1000); 47 | LEDon(4, 3); 48 | delay(1000); 49 | } 50 | 51 | void LEDon(int vin, int gnd) { 52 | pinMode(0, INPUT); 53 | pinMode(1, INPUT); 54 | pinMode(2, INPUT); 55 | pinMode(3, INPUT); 56 | pinMode(4, INPUT); 57 | pinMode(5, INPUT); 58 | 59 | pinMode(vin, OUTPUT); 60 | pinMode(gnd, OUTPUT); 61 | digitalWrite(vin, HIGH); 62 | digitalWrite(gnd, LOW); 63 | } 64 | -------------------------------------------------------------------------------- /examples/Digispark_Examples/EEPROM/EEPROM.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define disk1 0x50 //Address of 24LC256 eeprom chip 4 | int returned = 0; 5 | void setup(void) 6 | { 7 | //Serial.begin(9600); 8 | TinyWireM.begin(); 9 | 10 | unsigned int address = 0; 11 | pinMode(5, OUTPUT); 12 | 13 | writeEEPROM(disk1, address, 5); 14 | returned = readEEPROM(disk1, address); 15 | 16 | while(returned>0){ 17 | digitalWrite(5,HIGH); 18 | delay(500); 19 | digitalWrite(5,LOW); 20 | delay(500); 21 | returned--; 22 | } 23 | 24 | } 25 | 26 | void loop(){} 27 | 28 | void writeEEPROM(int deviceaddress, unsigned int eeaddress, byte data ) 29 | { 30 | TinyWireM.beginTransmission(deviceaddress); 31 | TinyWireM.send((int)(eeaddress >> 8)); // MSB 32 | TinyWireM.send((int)(eeaddress & 0xFF)); // LSB 33 | TinyWireM.send(data); 34 | TinyWireM.endTransmission(); 35 | 36 | delay(5); 37 | } 38 | 39 | byte readEEPROM(int deviceaddress, unsigned int eeaddress ) 40 | { 41 | byte rdata = 0xFF; 42 | 43 | TinyWireM.beginTransmission(deviceaddress); 44 | TinyWireM.send((int)(eeaddress >> 8)); // MSB 45 | TinyWireM.send((int)(eeaddress & 0xFF)); // LSB 46 | TinyWireM.endTransmission(); 47 | 48 | TinyWireM.requestFrom(deviceaddress,1); 49 | 50 | if (TinyWireM.available()) rdata = TinyWireM.receive(); 51 | 52 | return rdata; 53 | } 54 | -------------------------------------------------------------------------------- /examples/Digispark_Examples/Expander/Expander.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #define expander 0x20 3 | 4 | byte expanderStatus = B11111111; //all off 5 | 6 | void setup() 7 | { 8 | TinyWireM.begin(); 9 | } 10 | 11 | void loop() 12 | { 13 | expanderWrite(0,HIGH); 14 | delay(1000); 15 | expanderWrite(0,LOW); 16 | delay(1000); 17 | } 18 | 19 | 20 | void expanderWrite(byte pinNumber, boolean state){ 21 | if(state == HIGH) 22 | expanderStatus &= ~(1 << pinNumber); 23 | else 24 | expanderStatus |= (1 << pinNumber); 25 | 26 | expanderWrite(expanderStatus); 27 | } 28 | 29 | void expanderWrite(byte _data ) { 30 | TinyWireM.beginTransmission(expander); 31 | TinyWireM.send(_data); 32 | TinyWireM.endTransmission(); 33 | } 34 | -------------------------------------------------------------------------------- /examples/Digispark_Examples/Infrared/Infrared.ino: -------------------------------------------------------------------------------- 1 | int irPin=2; 2 | 3 | void setup() 4 | { 5 | pinMode(irPin,INPUT); 6 | pinMode(0,OUTPUT); 7 | //Serial.begin(9600); 8 | digitalWrite(0,HIGH); 9 | //Serial.println("You pressed a button"); 10 | delay(1000); 11 | digitalWrite(0,LOW); 12 | } 13 | 14 | void loop() 15 | { 16 | 17 | if(pulseIn(irPin,LOW)) 18 | { 19 | //button pressed 20 | delay(100); 21 | digitalWrite(0,HIGH); 22 | //Serial.println("You pressed a button"); 23 | delay(1000); 24 | digitalWrite(0,LOW); 25 | } 26 | 27 | } 28 | -------------------------------------------------------------------------------- /examples/Digispark_Examples/MotorShield/MotorShield.ino: -------------------------------------------------------------------------------- 1 | /* 2 | 3 | This example code is in the public domain. 4 | */ 5 | 6 | int MotorADir = 2; 7 | int MotorASpeed = 0; 8 | int MotorBDir = 5; 9 | int MotorBSpeed = 1; 10 | 11 | // the setup routine runs once when you press reset: 12 | void setup() { 13 | // initialize the outputs. 14 | pinMode(led, OUTPUT); 15 | pinMode(led, OUTPUT); 16 | pinMode(led, OUTPUT); 17 | pinMode(led, OUTPUT); 18 | } 19 | 20 | // the loop routine runs over and over again forever: 21 | void loop() { 22 | //both motors forward full speed 23 | digitalWrite(MotorADir, HIGH); //forward 24 | digitalWrite(MotorBDir, HIGH); 25 | analogWrite(MotorASpeed, 255); //full speed 26 | analogWrite(MotorBSpeed, 255); 27 | delay(5000); // wait for 5 seconds 28 | //turn in place (if using a skid steer configuration) 29 | digitalWrite(MotorADir, HIGH); //forward 30 | digitalWrite(MotorBDir, HIGH); 31 | analogWrite(MotorASpeed, 255); 32 | analogWrite(MotorBSpeed, 0); //off 33 | delay(5000); // wait for 5 seconds 34 | //turn gradually - the other direction (if using a skid steer configuration) 35 | digitalWrite(MotorADir, HIGH); //forward 36 | digitalWrite(MotorBDir, HIGH); 37 | analogWrite(MotorASpeed, 100); 38 | analogWrite(MotorBSpeed, 255); 39 | delay(5000); // wait for 5 seconds 40 | //stop 41 | digitalWrite(MotorADir, HIGH); //forward 42 | digitalWrite(MotorBDir, HIGH); 43 | analogWrite(MotorASpeed, 0); 44 | analogWrite(MotorBSpeed, 0); //off 45 | //reverse slowly 46 | digitalWrite(MotorADir, LOW); //reverse 47 | digitalWrite(MotorBDir, LOW); 48 | analogWrite(MotorASpeed, 100); 49 | analogWrite(MotorBSpeed, 100); 50 | } 51 | -------------------------------------------------------------------------------- /examples/Digispark_Examples/Start/Start.ino: -------------------------------------------------------------------------------- 1 | 2 | // the setup routine runs once when you press reset: 3 | void setup() { 4 | // initialize the digital pin as an output. 5 | pinMode(0, OUTPUT); //LED on Model B 6 | pinMode(1, OUTPUT); //LED on Model A 7 | } 8 | 9 | // the loop routine runs over and over again forever: 10 | void loop() { 11 | digitalWrite(0, HIGH); // turn the LED on (HIGH is the voltage level) 12 | digitalWrite(1, HIGH); 13 | delay(1000); // wait for a second 14 | digitalWrite(0, LOW); // turn the LED off by making the voltage LOW 15 | digitalWrite(1, LOW); 16 | delay(1000); // wait for a second 17 | } 18 | -------------------------------------------------------------------------------- /hardware/digispark/boards.txt: -------------------------------------------------------------------------------- 1 | digispark-tiny.name=Digispark (Tiny Core) 2 | digispark-tiny.upload.maximum_size=6012 3 | digispark-tiny.build.mcu=attiny85 4 | digispark-tiny.build.f_cpu=16500000L 5 | digispark-tiny.build.core=tiny 6 | digispark-tiny.upload.using=digispark 7 | digispark-tiny.bootloader.low_fuses=0xf1 8 | digispark-tiny.bootloader.high_fuses=0x5f 9 | digispark-tiny.bootloader.extended_fuses=0xfe 10 | digispark-tiny.bootloader.path=micronucleus 11 | digispark-tiny.bootloader.file=micronucleus-1.06-upgrade.hex 12 | 13 | digispark-tiny16mhz.name=Digispark 16.0mhz - NO USB (Tiny Core) 14 | digispark-tiny16mhz.upload.maximum_size=6012 15 | digispark-tiny16mhz.build.mcu=attiny85 16 | digispark-tiny16mhz.build.f_cpu=16000000L 17 | digispark-tiny16mhz.build.core=tiny 18 | digispark-tiny16mhz.upload.using=digispark 19 | digispark-tiny16mhz.bootloader.low_fuses=0xf1 20 | digispark-tiny16mhz.bootloader.high_fuses=0x5f 21 | digispark-tiny16mhz.bootloader.extended_fuses=0xfe 22 | digispark-tiny16mhz.bootloader.path=micronucleus 23 | digispark-tiny16mhz.bootloader.file=micronucleus-1.06-upgrade.hex 24 | 25 | digispark-tiny8mhz.name=Digispark 8mhz - NO USB (Tiny Core) 26 | digispark-tiny8mhz.upload.maximum_size=6012 27 | digispark-tiny8mhz.build.mcu=attiny85 28 | digispark-tiny8mhz.build.f_cpu=8000000L 29 | digispark-tiny8mhz.build.core=tiny 30 | digispark-tiny8mhz.upload.using=digispark 31 | digispark-tiny8mhz.bootloader.low_fuses=0xf1 32 | digispark-tiny8mhz.bootloader.high_fuses=0x5f 33 | digispark-tiny8mhz.bootloader.extended_fuses=0xfe 34 | digispark-tiny8mhz.bootloader.path=micronucleus 35 | digispark-tiny8mhz.bootloader.file=micronucleus-1.06-upgrade.hex 36 | 37 | digispark-tiny1mhz.name=Digispark 1mhz - NO USB (Tiny Core) 38 | digispark-tiny1mhz.upload.maximum_size=6012 39 | digispark-tiny1mhz.build.mcu=attiny85 40 | digispark-tiny1mhz.build.f_cpu=1000000L 41 | digispark-tiny1mhz.build.core=tiny 42 | digispark-tiny1mhz.upload.using=digispark 43 | digispark-tiny1mhz.bootloader.low_fuses=0xf1 44 | digispark-tiny1mhz.bootloader.high_fuses=0x5f 45 | digispark-tiny1mhz.bootloader.extended_fuses=0xfe 46 | digispark-tiny1mhz.bootloader.path=micronucleus 47 | digispark-tiny1mhz.bootloader.file=micronucleus-1.06-upgrade.hex 48 | 49 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty2313at1.hex: -------------------------------------------------------------------------------- 1 | :1000000012C02AC029C028C027C026C02CC024C0C6 2 | :1000100023C022C021C020C01FC01EC01DC01CC0E4 3 | :100020001BC01AC019C011241FBECFEDCDBF10E0F8 4 | :10003000A0E6B0E0ECE4F1E002C005900D92A0363D 5 | :10004000B107D9F710E0A0E6B0E001C01D92A936D3 6 | :10005000B107E1F704D078C0D3CF0895089557D001 7 | :10006000FCDFFCDFFECF1F920F920FB60F92112420 8 | :100070002F933F934F935F936F937F938F939F93B0 9 | :10008000AF93BF932091640030916500409166006A 10 | :100090005091670070916800DA01C9010296A11DB4 11 | :1000A000B11D672F6A5F6D3730F06D57DA01C901F6 12 | :1000B0000396A11DB11D6093680080936400909326 13 | :1000C0006500A0936600B0936700809160009091F6 14 | :1000D0006100A0916200B09163000196A11DB11D65 15 | :1000E0008093600090936100A0936200B0936300DE 16 | :1000F000BF91AF919F918F917F916F915F914F9140 17 | :100100003F912F910F900FBE0F901F9018957894EC 18 | :1001100080B7836080BF83B7877F83BF83B7887FC3 19 | :10012000826083BF89B7826089BF8EB5887F8EBDAC 20 | :100130008FB58C7F81608FBD8EB5877E8EBD8EB56D 21 | :0C014000887F82608EBD0895F894FFCF88 22 | :00000001FF 23 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty2313at8.hex: -------------------------------------------------------------------------------- 1 | :1000000012C02AC029C028C027C026C02CC024C0C6 2 | :1000100023C022C021C020C01FC01EC01DC01CC0E4 3 | :100020001BC01AC019C011241FBECFEDCDBF10E0F8 4 | :10003000A0E6B0E0ECE4F1E002C005900D92A0363D 5 | :10004000B107D9F710E0A0E6B0E001C01D92A936D3 6 | :10005000B107E1F704D078C0D3CF0895089557D001 7 | :10006000FCDFFCDFFECF1F920F920FB60F92112420 8 | :100070002F933F934F935F936F937F938F939F93B0 9 | :10008000AF93BF932091640030916500409166006A 10 | :100090005091670070916800DA01C9010296A11DB4 11 | :1000A000B11D672F6A5F6D3730F06D57DA01C901F6 12 | :1000B0000396A11DB11D6093680080936400909326 13 | :1000C0006500A0936600B0936700809160009091F6 14 | :1000D0006100A0916200B09163000196A11DB11D65 15 | :1000E0008093600090936100A0936200B0936300DE 16 | :1000F000BF91AF919F918F917F916F915F914F9140 17 | :100100003F912F910F900FBE0F901F9018957894EC 18 | :1001100080B7836080BF83B7877F83BF83B7887FC3 19 | :10012000836083BF89B7826089BF8EB5887F8EBDAB 20 | :100130008FB58C7F81608FBD8EB5877E8EBD8EB56D 21 | :0C014000887F83608EBD0895F894FFCF87 22 | :00000001FF 23 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty24at16.hex: -------------------------------------------------------------------------------- 1 | :1000000010C015C014C013C012C011C010C00FC062 2 | :100010000EC00DC00CC00BC00AC009C008C007C08C 3 | :1000200006C011241FBECFEDCDBF02D002C0E8CF65 4 | :06003000FFCFF894FFCFA2 5 | :00000001FF 6 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty25at1.hex: -------------------------------------------------------------------------------- 1 | :100000000EC026C025C024C02AC022C021C020C0E6 2 | :100010001FC01EC01DC01CC01BC01AC019C01124A7 3 | :100020001FBECFEDCDBF10E0A0E6B0E0E8E5F1E007 4 | :1000300002C005900D92A036B107D9F710E0A0E6F6 5 | :10004000B0E001C01D92A936B107E1F704D082C02B 6 | :10005000D7CF0895089557D0FCDFFCDFFECF1F9265 7 | :100060000F920FB60F9211242F933F934F935F93EC 8 | :100070006F937F938F939F93AF93BF93209164006F 9 | :100080003091650040916600509167007091680062 10 | :10009000DA01C9010296A11DB11D672F6A5F6D3794 11 | :1000A00030F06D57DA01C9010396A11DB11D6093AF 12 | :1000B00068008093640090936500A0936600B093FD 13 | :1000C00067008091600090916100A0916200B09102 14 | :1000D00063000196A11DB11D8093600090936100A3 15 | :1000E000A0936200B0936300BF91AF919F918F91F5 16 | :1000F0007F916F915F914F913F912F910F900FBE24 17 | :100100000F901F901895789480B7806880BF80B753 18 | :10011000806480BF8CB580648CBD8FEF8DBD80B74F 19 | :10012000807F846080BF89B7846089BF83B7887F00 20 | :1001300083BF8AB58C7F81608ABD83B7877F83BF89 21 | :1001400083B7887F826083BF86B1887F836086B9EA 22 | :08015000379A0895F894FFCFDF 23 | :00000001FF 24 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty25at8.hex: -------------------------------------------------------------------------------- 1 | :100000000EC026C025C024C02AC022C021C020C0E6 2 | :100010001FC01EC01DC01CC01BC01AC019C01124A7 3 | :100020001FBECFEDCDBF10E0A0E6B0E0E8E5F1E007 4 | :1000300002C005900D92A036B107D9F710E0A0E6F6 5 | :10004000B0E001C01D92A936B107E1F704D082C02B 6 | :10005000D7CF0895089557D0FCDFFCDFFECF1F9265 7 | :100060000F920FB60F9211242F933F934F935F93EC 8 | :100070006F937F938F939F93AF93BF93209164006F 9 | :100080003091650040916600509167007091680062 10 | :10009000DA01C9010296A11DB11D672F6A5F6D3794 11 | :1000A00030F06D57DA01C9010396A11DB11D6093AF 12 | :1000B00068008093640090936500A0936600B093FD 13 | :1000C00067008091600090916100A0916200B09102 14 | :1000D00063000196A11DB11D8093600090936100A3 15 | :1000E000A0936200B0936300BF91AF919F918F91F5 16 | :1000F0007F916F915F914F913F912F910F900FBE24 17 | :100100000F901F901895789480B7806880BF80B753 18 | :10011000806480BF8CB580648CBD8FEF8DBD80B74F 19 | :10012000807F876080BF89B7846089BF83B7887FFD 20 | :1001300083BF8AB58C7F81608ABD83B7877F83BF89 21 | :1001400083B7887F836083BF86B1887F866086B9E6 22 | :08015000379A0895F894FFCFDF 23 | :00000001FF 24 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty4313at1.hex: -------------------------------------------------------------------------------- 1 | :1000000014C01BC01AC019C018C017C016C015C034 2 | :1000100014C013C012C011C010C00FC00EC00DC05C 3 | :100020000CC00BC00AC009C008C011241FBECFE518 4 | :10003000D1E0DEBFCDBF02D002C0E2CFFFCFF89447 5 | :02004000FFCFF0 6 | :00000001FF 7 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty4313at8.hex: -------------------------------------------------------------------------------- 1 | :1000000014C01BC01AC019C018C017C016C015C034 2 | :1000100014C013C012C011C010C00FC00EC00DC05C 3 | :100020000CC00BC00AC009C008C011241FBECFE518 4 | :10003000D1E0DEBFCDBF02D002C0E2CFFFCFF89447 5 | :02004000FFCFF0 6 | :00000001FF 7 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty44at1.hex: -------------------------------------------------------------------------------- 1 | :1000000010C017C016C015C014C013C012C011C054 2 | :1000100010C00FC00EC00DC00CC00BC00AC009C07C 3 | :1000200008C011241FBECFE5D1E0DEBFCDBF02D096 4 | :0A00300002C0E6CFFFCFF894FFCF27 5 | :00000001FF 6 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty44at8.hex: -------------------------------------------------------------------------------- 1 | :1000000010C017C016C015C014C013C012C011C054 2 | :1000100010C00FC00EC00DC00CC00BC00AC009C07C 3 | :1000200008C011241FBECFE5D1E0DEBFCDBF02D096 4 | :0A00300002C0E6CFFFCFF894FFCF27 5 | :00000001FF 6 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty45at1.hex: -------------------------------------------------------------------------------- 1 | :100000000EC028C027C026C02CC024C023C022C0D8 2 | :1000100021C020C01FC01EC01DC01CC01BC0112499 3 | :100020001FBECFE5D1E0DEBFCDBF10E0A0E6B0E05F 4 | :10003000E2E5F1E002C005900D92A036B107D9F7D4 5 | :1000400010E0A0E6B0E001C01D92A936B107E1F7CB 6 | :1000500004D07DC0D5CF0895089557D0FCDFFCDFD4 7 | :10006000FECF1F920F920FB60F9211242F933F9342 8 | :100070004F935F936F937F938F939F93AF93BF93B0 9 | :1000800020916400309165004091660050916700B6 10 | :1000900070916800DA01C9010296A11DB11D672F98 11 | :1000A0006A5F6D3730F06D57DA01C9010396A11D03 12 | :1000B000B11D609368008093640090936500A093E5 13 | :1000C0006600B09367008091600090916100A091FC 14 | :1000D0006200B09163000196A11DB11D8093600084 15 | :1000E00090936100A0936200B0936300BF91AF91C1 16 | :1000F0009F918F917F916F915F914F913F912F9140 17 | :100100000F900FBE0F901F901895789480B780685D 18 | :1001100080BF80B7806480BF8CB580648CBD8FEF5A 19 | :100120008DBD80B7807F846080BF89B7846089BFC0 20 | :1001300083B7887F83BF8AB58C7F81608ABD83B790 21 | :10014000877F83BF83B7887F826083BF0895F894D9 22 | :02015000FFCFDF 23 | :00000001FF 24 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty45at8.hex: -------------------------------------------------------------------------------- 1 | :100000000EC028C027C026C02CC024C023C022C0D8 2 | :1000100021C020C01FC01EC01DC01CC01BC0112499 3 | :100020001FBECFE5D1E0DEBFCDBF10E0A0E6B0E05F 4 | :10003000E2E5F1E002C005900D92A036B107D9F7D4 5 | :1000400010E0A0E6B0E001C01D92A936B107E1F7CB 6 | :1000500004D07DC0D5CF0895089557D0FCDFFCDFD4 7 | :10006000FECF1F920F920FB60F9211242F933F9342 8 | :100070004F935F936F937F938F939F93AF93BF93B0 9 | :1000800020916400309165004091660050916700B6 10 | :1000900070916800DA01C9010296A11DB11D672F98 11 | :1000A0006A5F6D3730F06D57DA01C9010396A11D03 12 | :1000B000B11D609368008093640090936500A093E5 13 | :1000C0006600B09367008091600090916100A091FC 14 | :1000D0006200B09163000196A11DB11D8093600084 15 | :1000E00090936100A0936200B0936300BF91AF91C1 16 | :1000F0009F918F917F916F915F914F913F912F9140 17 | :100100000F900FBE0F901F901895789480B780685D 18 | :1001100080BF80B7806480BF8CB580648CBD8FEF5A 19 | :100120008DBD80B7807F876080BF89B7846089BFBD 20 | :1001300083B7887F83BF8AB58C7F81608ABD83B790 21 | :10014000877F83BF83B7887F836083BF0895F894D8 22 | :02015000FFCFDF 23 | :00000001FF 24 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty84at1.hex: -------------------------------------------------------------------------------- 1 | :1000000010C02AC029C028C027C026C025C024C0CF 2 | :1000100023C022C021C027C01FC01EC01DC01CC0DD 3 | :100020001BC011241FBECFE5D2E0DEBFCDBF10E064 4 | :10003000A0E6B0E0ECE4F1E002C005900D92A0363D 5 | :10004000B107D9F710E0A0E6B0E001C01D92A936D3 6 | :10005000B107E1F704D078C0D3CF0895089557D001 7 | :10006000FCDFFCDFFECF1F920F920FB60F92112420 8 | :100070002F933F934F935F936F937F938F939F93B0 9 | :10008000AF93BF932091640030916500409166006A 10 | :100090005091670070916800DA01C9014096A11D76 11 | :1000A000B11D672F605D6D3730F06D57DA01C90102 12 | :1000B0004196A11DB11D60936800809364009093E8 13 | :1000C0006500A0936600B0936700809160009091F6 14 | :1000D0006100A0916200B09163000196A11DB11D65 15 | :1000E0008093600090936100A0936200B0936300DE 16 | :1000F000BF91AF919F918F917F916F915F914F9140 17 | :100100003F912F910F900FBE0F901F9018957894EC 18 | :1001100080B7826080BF80B7816080BF83B7826014 19 | :1001200083BF83B7816083BF89B7816089BF8EB584 20 | :1001300082608EBD8EB581608EBD8FB581608FBDB2 21 | :0C014000319A309A379A0895F894FFCF56 22 | :00000001FF 23 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty84at16.hex: -------------------------------------------------------------------------------- 1 | :1000000010C01FC01EC01DC01CC01BC01AC019C01C 2 | :1000100018C017C016C01CC014C013C012C011C035 3 | :1000200010C011241FBECFE5D2E0DEBFCDBF10E06F 4 | :10003000A0E6B0E001C01D92A936B107E1F704D0F7 5 | :1000400063C0DECF089508954CD0FCDFFCDFFECF07 6 | :100050001F920F920FB60F9211242F933F938F93FD 7 | :100060009F93AF93BF938091640090916500A0919E 8 | :100070006600B091670030916800232F2D5F2D3707 9 | :1000800028F02D570296A11DB11D03C00196A11D98 10 | :10009000B11D209368008093640090936500A09345 11 | :1000A0006600B09367008091600090916100A0911C 12 | :1000B0006200B09163000196A11DB11D80936000A4 13 | :1000C00090936100A0936200B0936300BF91AF91E1 14 | :1000D0009F918F913F912F910F900FBE0F901F9086 15 | :1000E0001895789480B7836080BF83B7877F83BF7C 16 | :1000F00083B7887F836083BF89B7816089BF86B1FA 17 | :0C010000876086B9379A0895F894FFCF05 18 | :00000001FF 19 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty84at8.hex: -------------------------------------------------------------------------------- 1 | :1000000010C02AC029C028C027C026C025C024C0CF 2 | :1000100023C022C021C027C01FC01EC01DC01CC0DD 3 | :100020001BC011241FBECFE5D2E0DEBFCDBF10E064 4 | :10003000A0E6B0E0ECE4F1E002C005900D92A0363D 5 | :10004000B107D9F710E0A0E6B0E001C01D92A936D3 6 | :10005000B107E1F704D078C0D3CF0895089557D001 7 | :10006000FCDFFCDFFECF1F920F920FB60F92112420 8 | :100070002F933F934F935F936F937F938F939F93B0 9 | :10008000AF93BF932091640030916500409166006A 10 | :100090005091670070916800DA01C9010296A11DB4 11 | :1000A000B11D672F6A5F6D3730F06D57DA01C901F6 12 | :1000B0000396A11DB11D6093680080936400909326 13 | :1000C0006500A0936600B0936700809160009091F6 14 | :1000D0006100A0916200B09163000196A11DB11D65 15 | :1000E0008093600090936100A0936200B0936300DE 16 | :1000F000BF91AF919F918F917F916F915F914F9140 17 | :100100003F912F910F900FBE0F901F9018957894EC 18 | :1001100080B7826080BF80B7816080BF83B7826014 19 | :1001200083BF83B7816083BF89B7816089BF8EB584 20 | :1001300082608EBD8EB581608EBD8FB581608FBDB2 21 | :0C014000329A319A379A0895F894FFCF54 22 | :00000001FF 23 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty85at1.hex: -------------------------------------------------------------------------------- 1 | :100000000EC028C027C026C025C02BC023C022C0D8 2 | :1000100021C020C01FC01EC01DC01CC01BC0112499 3 | :100020001FBECFE5D2E0DEBFCDBF10E0A0E6B0E05E 4 | :10003000E8E4F1E002C005900D92A036B107D9F7CF 5 | :1000400010E0A0E6B0E001C01D92A936B107E1F7CB 6 | :1000500004D078C0D5CF0895089557D0FCDFFCDFD9 7 | :10006000FECF1F920F920FB60F9211242F933F9342 8 | :100070004F935F936F937F938F939F93AF93BF93B0 9 | :1000800020916400309165004091660050916700B6 10 | :1000900070916800DA01C9014096A11DB11D672F5A 11 | :1000A000605D6D3730F06D57DA01C9014196A11DD1 12 | :1000B000B11D609368008093640090936500A093E5 13 | :1000C0006600B09367008091600090916100A091FC 14 | :1000D0006200B09163000196A11DB11D8093600084 15 | :1000E00090936100A0936200B0936300BF91AF91C1 16 | :1000F0009F918F917F916F915F914F913F912F9140 17 | :100100000F900FBE0F901F90189578948AB582605B 18 | :100110008ABD8AB581608ABD83B7826083BF83B799 19 | :10012000816083BF89B7826089BF80B7826080BFEA 20 | :1001300080B7816080BF80B7806480BF319A309A79 21 | :08014000379A0895F894FFCFEF 22 | :00000001FF 23 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty85at16.hex: -------------------------------------------------------------------------------- 1 | :100000000EC01DC01CC01BC021C019C018C017C025 2 | :1000100016C015C014C013C012C011C010C01124E6 3 | :100020001FBECFE5D2E0DEBFCDBF10E0A0E6B0E05E 4 | :1000300001C01D92A936B107E1F704D064C0E0CF3A 5 | :10004000089508954CD0FCDFFCDFFECF1F920F9285 6 | :100050000FB60F9211242F933F938F939F93AF93DB 7 | :10006000BF938091640090916500A0916600B0916B 8 | :10007000670030916800232F2D5F2D3728F02D5712 9 | :100080000296A11DB11D03C00196A11DB11D2093B3 10 | :1000900068008093640090936500A0936600B0931D 11 | :1000A00067008091600090916100A0916200B09122 12 | :1000B00063000196A11DB11D8093600090936100C3 13 | :1000C000A0936200B0936300BF91AF919F918F9115 14 | :1000D0003F912F910F900FBE0F901F90189578941D 15 | :1000E00080B7806880BF80B7806480BF8CB5806433 16 | :1000F0008CBD8FEF8DBD80B7807F876080BF89B753 17 | :0A010000846089BF0895F894FFCFD2 18 | :00000001FF 19 | -------------------------------------------------------------------------------- /hardware/digispark/bootloaders/empty/empty85at8.hex: -------------------------------------------------------------------------------- 1 | :100000000EC028C027C026C025C02BC023C022C0D8 2 | :1000100021C020C01FC01EC01DC01CC01BC0112499 3 | :100020001FBECFE5D2E0DEBFCDBF10E0A0E6B0E05E 4 | :10003000E8E4F1E002C005900D92A036B107D9F7CF 5 | :1000400010E0A0E6B0E001C01D92A936B107E1F7CB 6 | :1000500004D078C0D5CF0895089557D0FCDFFCDFD9 7 | :10006000FECF1F920F920FB60F9211242F933F9342 8 | :100070004F935F936F937F938F939F93AF93BF93B0 9 | :1000800020916400309165004091660050916700B6 10 | :1000900070916800DA01C9010296A11DB11D672F98 11 | :1000A0006A5F6D3730F06D57DA01C9010396A11D03 12 | :1000B000B11D609368008093640090936500A093E5 13 | :1000C0006600B09367008091600090916100A091FC 14 | :1000D0006200B09163000196A11DB11D8093600084 15 | :1000E00090936100A0936200B0936300BF91AF91C1 16 | :1000F0009F918F917F916F915F914F913F912F9140 17 | :100100000F900FBE0F901F90189578948AB582605B 18 | :100110008ABD8AB581608ABD83B7826083BF83B799 19 | :10012000816083BF89B7826089BF80B7826080BFEA 20 | :1001300080B7816080BF80B7806480BF329A319A77 21 | :08014000379A0895F894FFCFEF 22 | :00000001FF 23 | -------------------------------------------------------------------------------- /hardware/digispark/cores/empty/Arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Arduino_h 2 | #define Arduino_h 3 | 4 | #endif 5 | -------------------------------------------------------------------------------- /hardware/digispark/cores/empty/WProgram.h: -------------------------------------------------------------------------------- 1 | #ifndef WProgram_h 2 | #define WProgram_h 3 | 4 | #endif 5 | -------------------------------------------------------------------------------- /hardware/digispark/cores/empty/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | set PATH=%PATH%;C:\Arduino\arduino-1.0\hardware\tools\avr\bin 3 | set PATH=%PATH%;C:\arduino\arduino-1.0\hardware\tools\avr\etc 4 | 5 | cd %TEMP% 6 | dir *.hex /s 7 | 8 | cd C:\Users\BRIANC~1.001\AppData\Local\Temp\build5703187254703185841.tmp 9 | 10 | avr-objdump.exe -S sketch_sep22a.cpp.elf > C:\Temp\dump.cpp & C:\Temp\dump.cpp 11 | */ 12 | 13 | int main(void) 14 | { 15 | for (;;); 16 | return 0; 17 | } 18 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/Arduino.h: -------------------------------------------------------------------------------- 1 | #ifndef Arduino_h 2 | #define Arduino_h 3 | 4 | #include 5 | 6 | #endif 7 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/HardwareSerial.h: -------------------------------------------------------------------------------- 1 | /* 2 | HardwareSerial.h - Hardware serial library for Wiring 3 | Copyright (c) 2006 Nicholas Zambetti. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | 19 | Modified 28 September 2010 by Mark Sproul 20 | */ 21 | 22 | #ifndef HardwareSerial_h 23 | #define HardwareSerial_h 24 | 25 | #include 26 | 27 | #include "core_build_options.h" 28 | #include "Stream.h" 29 | 30 | struct ring_buffer; 31 | 32 | class HardwareSerial : public Stream 33 | { 34 | private: 35 | ring_buffer *_rx_buffer; 36 | volatile uint8_t *_ubrrh; 37 | volatile uint8_t *_ubrrl; 38 | volatile uint8_t *_ucsra; 39 | volatile uint8_t *_ucsrb; 40 | volatile uint8_t *_udr; 41 | uint8_t _rxen; 42 | uint8_t _txen; 43 | uint8_t _rxcie; 44 | uint8_t _udre; 45 | uint8_t _u2x; 46 | public: 47 | HardwareSerial(ring_buffer *rx_buffer, 48 | volatile uint8_t *ubrrh, volatile uint8_t *ubrrl, 49 | volatile uint8_t *ucsra, volatile uint8_t *ucsrb, 50 | volatile uint8_t *udr, 51 | uint8_t rxen, uint8_t txen, uint8_t rxcie, uint8_t udre, uint8_t u2x); 52 | void begin(long); 53 | void end(); 54 | virtual int available(void); 55 | virtual int peek(void); 56 | virtual int read(void); 57 | virtual void flush(void); 58 | virtual size_t write(uint8_t); 59 | using Print::write; // pull in write(str) and write(buf, size) from Print 60 | }; 61 | 62 | #if (defined(UBRRH) || defined(UBRR0H)) && ! DEFAULT_TO_TINY_DEBUG_SERIAL 63 | extern HardwareSerial Serial; 64 | #elif defined(USBCON) 65 | #include "usb_api.h" 66 | #endif 67 | #if defined(UBRR1H) 68 | extern HardwareSerial Serial1; 69 | #endif 70 | #if defined(UBRR2H) 71 | extern HardwareSerial Serial2; 72 | #endif 73 | #if defined(UBRR3H) 74 | extern HardwareSerial Serial3; 75 | #endif 76 | 77 | #endif 78 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/Stream.h: -------------------------------------------------------------------------------- 1 | /* 2 | Stream.h - base class for character-based streams. 3 | Copyright (c) 2010 David A. Mellis. All right reserved. 4 | 5 | This library is free software; you can redistribute it and/or 6 | modify it under the terms of the GNU Lesser General Public 7 | License as published by the Free Software Foundation; either 8 | version 2.1 of the License, or (at your option) any later version. 9 | 10 | This library is distributed in the hope that it will be useful, 11 | but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 | Lesser General Public License for more details. 14 | 15 | You should have received a copy of the GNU Lesser General Public 16 | License along with this library; if not, write to the Free Software 17 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 | */ 19 | 20 | #ifndef Stream_h 21 | #define Stream_h 22 | 23 | #include 24 | #include "Print.h" 25 | 26 | class Stream : public Print 27 | { 28 | public: 29 | virtual int available() = 0; 30 | virtual int read() = 0; 31 | virtual int peek() = 0; 32 | virtual void flush() = 0; 33 | }; 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/TinyDebugSerial.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================== 2 | 3 | TinyDebugSerial.cpp - Tiny write-only software serial. 4 | 5 | Copyright 2010 Rowdy Dog Software. 6 | 7 | This file is part of Arduino-Tiny. 8 | 9 | Arduino-Tiny is free software: you can redistribute it and/or modify it 10 | under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or (at your 12 | option) any later version. 13 | 14 | Arduino-Tiny is distributed in the hope that it will be useful, but 15 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with Arduino-Tiny. If not, see . 21 | 22 | ==============================================================================*/ 23 | 24 | #include "core_build_options.h" 25 | #include "TinyDebugSerial.h" 26 | 27 | static TinyDebugSerialWriter stub; 28 | 29 | void TinyDebugSerial::useStub( void ) 30 | { 31 | _writer = &stub; 32 | _writer->init(); 33 | } 34 | 35 | TinyDebugSerial::TinyDebugSerial( void ) 36 | { 37 | useStub(); 38 | } 39 | 40 | #if defined( DEFAULT_TO_TINY_DEBUG_SERIAL ) && DEFAULT_TO_TINY_DEBUG_SERIAL 41 | TinyDebugSerial Serial; 42 | #endif 43 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/TinyDebugSerial115200.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================== 2 | 3 | TinyDebugSerial.cpp - Tiny write-only software serial. 4 | 5 | Copyright 2010 Rowdy Dog Software. 6 | 7 | This file is part of Arduino-Tiny. 8 | 9 | Arduino-Tiny is free software: you can redistribute it and/or modify it 10 | under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or (at your 12 | option) any later version. 13 | 14 | Arduino-Tiny is distributed in the hope that it will be useful, but 15 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with Arduino-Tiny. If not, see . 21 | 22 | ==============================================================================*/ 23 | 24 | #include "TinyDebugSerial.h" 25 | 26 | TinyDebugSerialWriter_115200 tdsw115200; 27 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/TinyDebugSerial38400.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================== 2 | 3 | TinyDebugSerial.cpp - Tiny write-only software serial. 4 | 5 | Copyright 2010 Rowdy Dog Software. 6 | 7 | This file is part of Arduino-Tiny. 8 | 9 | Arduino-Tiny is free software: you can redistribute it and/or modify it 10 | under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or (at your 12 | option) any later version. 13 | 14 | Arduino-Tiny is distributed in the hope that it will be useful, but 15 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with Arduino-Tiny. If not, see . 21 | 22 | ==============================================================================*/ 23 | 24 | #include "TinyDebugSerial.h" 25 | 26 | TinyDebugSerialWriter_38400 tdsw38400; 27 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/TinyDebugSerial9600.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================== 2 | 3 | TinyDebugSerial.cpp - Tiny write-only software serial. 4 | 5 | Copyright 2010 Rowdy Dog Software. 6 | 7 | This file is part of Arduino-Tiny. 8 | 9 | Arduino-Tiny is free software: you can redistribute it and/or modify it 10 | under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or (at your 12 | option) any later version. 13 | 14 | Arduino-Tiny is distributed in the hope that it will be useful, but 15 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with Arduino-Tiny. If not, see . 21 | 22 | ==============================================================================*/ 23 | 24 | #include "TinyDebugSerial.h" 25 | 26 | TinyDebugSerialWriter_9600 tdsw9600; 27 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/TinyDebugSerialErrors.cpp: -------------------------------------------------------------------------------- 1 | /*============================================================================== 2 | 3 | TinyDebugSerial.cpp - Tiny write-only software serial. 4 | 5 | Copyright 2010 Rowdy Dog Software. 6 | 7 | This file is part of Arduino-Tiny. 8 | 9 | Arduino-Tiny is free software: you can redistribute it and/or modify it 10 | under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or (at your 12 | option) any later version. 13 | 14 | Arduino-Tiny is distributed in the hope that it will be useful, but 15 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with Arduino-Tiny. If not, see . 21 | 22 | ==============================================================================*/ 23 | 24 | #include "TinyDebugSerial.h" 25 | 26 | void TinyDebugSerialWriterInternalBug( void ) { } 27 | void TinyDebugSerialBadBaud( void ) { } 28 | void TinyDebugSerialBaudMustBeConstant( void ) { } 29 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/ToneTimer.h: -------------------------------------------------------------------------------- 1 | /*============================================================================== 2 | 3 | ToneTimer.h - Veneer for the Tone Timer. 4 | 5 | Copyright 2010 Rowdy Dog Software. 6 | 7 | This file is part of Arduino-Tiny. 8 | 9 | Arduino-Tiny is free software: you can redistribute it and/or modify it 10 | under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or (at your 12 | option) any later version. 13 | 14 | Arduino-Tiny is distributed in the hope that it will be useful, but 15 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with Arduino-Tiny. If not, see . 21 | 22 | ==============================================================================*/ 23 | 24 | #ifndef ToneTimer_h 25 | #define ToneTimer_h 26 | 27 | #include "core_build_options.h" 28 | #include "core_timers.h" 29 | 30 | #define tonetimer_(t) TIMER_PASTE_A( timer, TIMER_TO_USE_FOR_TONE, t ) 31 | #define ToneTimer_(f) TIMER_PASTE_A( Timer, TIMER_TO_USE_FOR_TONE, f ) 32 | #define TONETIMER_(c) TIMER_PASTE_A( TIMER, TIMER_TO_USE_FOR_TONE, c ) 33 | 34 | #define ToneTimer_SetToPowerup ToneTimer_(SetToPowerup) 35 | #define ToneTimer_SetWaveformGenerationMode ToneTimer_(SetWaveformGenerationMode) 36 | #define ToneTimer_OutputComparePinA ToneTimer_(OutputComparePinA) 37 | #define ToneTimer_OutputComparePinB ToneTimer_(OutputComparePinB) 38 | #define ToneTimer_SetCompareOutputModeA ToneTimer_(SetCompareOutputModeA) 39 | #define ToneTimer_SetCompareOutputModeB ToneTimer_(SetCompareOutputModeB) 40 | #define ToneTimer_DisconnectOutputs ToneTimer_(DisconnectOutputs) 41 | #define ToneTimer_ClockSelect ToneTimer_(ClockSelect) 42 | #define ToneTimer_SetCount ToneTimer_(SetCount) 43 | #define TONETIMER_NUMBER_PRESCALERS TONETIMER_(NUMBER_PRESCALERS) 44 | #define ToneTimer_SetOutputCompareMatchAndClear ToneTimer_(SetOutputCompareMatchAndClear) 45 | #define ToneTimer_InterruptsOff ToneTimer_(InterruptsOff) 46 | #define ToneTimer_EnableOutputCompareInterruptA ToneTimer_(EnableOutputCompareInterruptA) 47 | #define TONETIMER_COMPA_vect TONETIMER_(COMPA_vect) 48 | #define TONETIMER_SUPPORTS_PHASE_CORRECT_PWM TONETIMER_(SUPPORTS_PHASE_CORRECT_PWM) 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/WConstants.h: -------------------------------------------------------------------------------- 1 | #include "wiring.h" 2 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/WMath.cpp: -------------------------------------------------------------------------------- 1 | /* -*- mode: jde; c-basic-offset: 2; indent-tabs-mode: nil -*- */ 2 | 3 | /* 4 | Part of the Wiring project - http://wiring.org.co 5 | Copyright (c) 2004-06 Hernando Barragan 6 | Modified 13 August 2006, David A. Mellis for Arduino - http://www.arduino.cc/ 7 | 8 | This library is free software; you can redistribute it and/or 9 | modify it under the terms of the GNU Lesser General Public 10 | License as published by the Free Software Foundation; either 11 | version 2.1 of the License, or (at your option) any later version. 12 | 13 | This library is distributed in the hope that it will be useful, 14 | but WITHOUT ANY WARRANTY; without even the implied warranty of 15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 16 | Lesser General Public License for more details. 17 | 18 | You should have received a copy of the GNU Lesser General 19 | Public License along with this library; if not, write to the 20 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 21 | Boston, MA 02111-1307 USA 22 | 23 | $Id$ 24 | */ 25 | 26 | extern "C" { 27 | #include "stdlib.h" 28 | } 29 | 30 | void randomSeed(unsigned int seed) 31 | { 32 | if (seed != 0) { 33 | srandom(seed); 34 | } 35 | } 36 | 37 | long random(long howbig) 38 | { 39 | if (howbig == 0) { 40 | return 0; 41 | } 42 | return random() % howbig; 43 | } 44 | 45 | long random(long howsmall, long howbig) 46 | { 47 | if (howsmall >= howbig) { 48 | return howsmall; 49 | } 50 | long diff = howbig - howsmall; 51 | return random(diff) + howsmall; 52 | } 53 | 54 | long map(long x, long in_min, long in_max, long out_min, long out_max) 55 | { 56 | return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; 57 | } 58 | 59 | unsigned int makeWord(unsigned int w) { return w; } 60 | unsigned int makeWord(unsigned char h, unsigned char l) { return (h << 8) | l; } -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/WProgram.h: -------------------------------------------------------------------------------- 1 | #ifndef WProgram_h 2 | #define WProgram_h 3 | 4 | #include 5 | #include 6 | #include 7 | 8 | #include 9 | 10 | #include "core_build_options.h" 11 | #include "core_pins.h" 12 | #include "wiring.h" 13 | #include "pins_arduino.h" 14 | 15 | #ifdef __cplusplus 16 | #include "WCharacter.h" 17 | #include "WString.h" 18 | #include "TinyDebugSerial.h" 19 | #include "HardwareSerial.h" 20 | 21 | uint16_t makeWord(uint16_t w); 22 | uint16_t makeWord(byte h, byte l); 23 | 24 | #define word(...) makeWord(__VA_ARGS__) 25 | 26 | unsigned long pulseIn(uint8_t pin, uint8_t state, unsigned long timeout = 1000000L); 27 | 28 | void tone(uint8_t _pin, unsigned int frequency, unsigned long duration = 0); 29 | void noTone(uint8_t _pin = 255); 30 | 31 | // WMath prototypes 32 | long random(long); 33 | long random(long, long); 34 | void randomSeed(unsigned int); 35 | long map(long, long, long, long, long); 36 | 37 | /* 38 | fix? On the Mega processors, the analogs are also "extended" digital pins. 39 | To (sort of) work the same way with this core, the following constants 40 | would have to be valid arguments to digitalRead, digitalWrite, and pinMode 41 | ("the digitals"). Which means the digitals would have to check for pins 42 | over A0 and then subtract A0. The current plan is to wait until someone 43 | wants this feature. 44 | */ 45 | #if CORE_ANALOG_COUNT >= 1 46 | const static uint8_t A0 = CORE_ANALOG_FIRST + 0; 47 | #endif 48 | 49 | #if CORE_ANALOG_COUNT >= 2 50 | const static uint8_t A1 = CORE_ANALOG_FIRST + 1; 51 | #endif 52 | 53 | #if CORE_ANALOG_COUNT >= 3 54 | const static uint8_t A2 = CORE_ANALOG_FIRST + 2; 55 | #endif 56 | 57 | #if CORE_ANALOG_COUNT >= 4 58 | const static uint8_t A3 = CORE_ANALOG_FIRST + 3; 59 | #endif 60 | 61 | #if CORE_ANALOG_COUNT >= 5 62 | const static uint8_t A4 = CORE_ANALOG_FIRST + 4; 63 | #endif 64 | 65 | #if CORE_ANALOG_COUNT >= 6 66 | const static uint8_t A5 = CORE_ANALOG_FIRST + 5; 67 | #endif 68 | 69 | #if CORE_ANALOG_COUNT >= 7 70 | const static uint8_t A6 = CORE_ANALOG_FIRST + 6; 71 | #endif 72 | 73 | #if CORE_ANALOG_COUNT >= 8 74 | const static uint8_t A7 = CORE_ANALOG_FIRST + 7; 75 | #endif 76 | 77 | #if CORE_ANALOG_COUNT >= 9 78 | #error Update the A* definitions for the selected processor. 79 | #endif 80 | 81 | #endif 82 | 83 | #endif 84 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/core_macros.h: -------------------------------------------------------------------------------- 1 | /*============================================================================== 2 | 3 | core_macros.h - Simple but handy macros. 4 | 5 | Copyright 2010 Rowdy Dog Software. 6 | 7 | This file is part of Arduino-Tiny. 8 | 9 | Arduino-Tiny is free software: you can redistribute it and/or modify it 10 | under the terms of the GNU Lesser General Public License as published by 11 | the Free Software Foundation, either version 3 of the License, or (at your 12 | option) any later version. 13 | 14 | Arduino-Tiny is distributed in the hope that it will be useful, but 15 | WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY 16 | or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 17 | License for more details. 18 | 19 | You should have received a copy of the GNU Lesser General Public License 20 | along with Arduino-Tiny. If not, see . 21 | 22 | ==============================================================================*/ 23 | 24 | #ifndef core_macros_h 25 | #define core_macros_h 26 | 27 | 28 | /*============================================================================= 29 | Bitmask macros 30 | =============================================================================*/ 31 | 32 | #define MASK1(b1) ( (1< 2 | 3 | int main(void) 4 | { 5 | init(); 6 | 7 | setup(); 8 | 9 | for (;;) 10 | loop(); 11 | 12 | return 0; 13 | } 14 | 15 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/new.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void * operator new(size_t size) 4 | { 5 | return malloc(size); 6 | } 7 | 8 | void operator delete(void * ptr) 9 | { 10 | free(ptr); 11 | } 12 | 13 | int __cxa_guard_acquire(__guard *g) {return !*(char *)(g);}; 14 | void __cxa_guard_release (__guard *g) {*(char *)g = 1;}; 15 | void __cxa_guard_abort (__guard *) {}; 16 | 17 | void __cxa_pure_virtual(void) {}; 18 | 19 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/new.h: -------------------------------------------------------------------------------- 1 | /* Header to define new/delete operators as they aren't provided by avr-gcc by default 2 | Taken from http://www.avrfreaks.net/index.php?name=PNphpBB2&file=viewtopic&t=59453 3 | */ 4 | 5 | #ifndef NEW_H 6 | #define NEW_H 7 | 8 | #include 9 | 10 | void * operator new(size_t size); 11 | void operator delete(void * ptr); 12 | 13 | __extension__ typedef int __guard __attribute__((mode (__DI__))); 14 | 15 | extern "C" int __cxa_guard_acquire(__guard *); 16 | extern "C" void __cxa_guard_release (__guard *); 17 | extern "C" void __cxa_guard_abort (__guard *); 18 | 19 | extern "C" void __cxa_pure_virtual(void); 20 | 21 | #endif 22 | 23 | -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/pins_arduino.c: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/hardware/digispark/cores/tiny/pins_arduino.c -------------------------------------------------------------------------------- /hardware/digispark/cores/tiny/wiring_shift.c: -------------------------------------------------------------------------------- 1 | /* 2 | wiring_shift.c - shiftOut() function 3 | Part of Arduino - http://www.arduino.cc/ 4 | 5 | Copyright (c) 2005-2006 David A. Mellis 6 | 7 | This library is free software; you can redistribute it and/or 8 | modify it under the terms of the GNU Lesser General Public 9 | License as published by the Free Software Foundation; either 10 | version 2.1 of the License, or (at your option) any later version. 11 | 12 | This library is distributed in the hope that it will be useful, 13 | but WITHOUT ANY WARRANTY; without even the implied warranty of 14 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 | Lesser General Public License for more details. 16 | 17 | You should have received a copy of the GNU Lesser General 18 | Public License along with this library; if not, write to the 19 | Free Software Foundation, Inc., 59 Temple Place, Suite 330, 20 | Boston, MA 02111-1307 USA 21 | 22 | $Id: wiring.c 248 2007-02-03 15:36:30Z mellis $ 23 | */ 24 | 25 | #include "wiring_private.h" 26 | 27 | uint8_t shiftIn(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder) { 28 | uint8_t value = 0; 29 | uint8_t i; 30 | 31 | for (i = 0; i < 8; ++i) { 32 | digitalWrite(clockPin, HIGH); 33 | if (bitOrder == LSBFIRST) 34 | value |= digitalRead(dataPin) << i; 35 | else 36 | value |= digitalRead(dataPin) << (7 - i); 37 | digitalWrite(clockPin, LOW); 38 | } 39 | return value; 40 | } 41 | 42 | void shiftOut(uint8_t dataPin, uint8_t clockPin, uint8_t bitOrder, uint8_t val) 43 | { 44 | uint8_t i; 45 | 46 | for (i = 0; i < 8; i++) { 47 | if (bitOrder == LSBFIRST) 48 | digitalWrite(dataPin, !!(val & (1 << i))); 49 | else 50 | digitalWrite(dataPin, !!(val & (1 << (7 - i)))); 51 | 52 | digitalWrite(clockPin, HIGH); 53 | digitalWrite(clockPin, LOW); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /hardware/digispark/programmers.txt: -------------------------------------------------------------------------------- 1 | digispark.name=Digispark 2 | digispark.communication=usb 3 | digispark.protocol=digispark -------------------------------------------------------------------------------- /hardware/digispark/readme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/hardware/digispark/readme.txt -------------------------------------------------------------------------------- /libraries/Arduino_SoftwareSerial/examples/SoftwareSerialExample/SoftwareSerialExample.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Software serial multple serial test 3 | 4 | Receives from the hardware serial, sends to software serial. 5 | Receives from software serial, sends to hardware serial. 6 | 7 | The circuit: 8 | * RX is digital pin 10 (connect to TX of other device) 9 | * TX is digital pin 11 (connect to RX of other device) 10 | 11 | Note: 12 | Not all pins on the Mega and Mega 2560 support change interrupts, 13 | so only the following can be used for RX: 14 | 10, 11, 12, 13, 50, 51, 52, 53, 62, 63, 64, 65, 66, 67, 68, 69 15 | 16 | Not all pins on the Leonardo support change interrupts, 17 | so only the following can be used for RX: 18 | 8, 9, 10, 11, 14 (MISO), 15 (SCK), 16 (MOSI). 19 | 20 | created back in the mists of time 21 | modified 25 May 2012 22 | by Tom Igoe 23 | based on Mikal Hart's example 24 | 25 | This example code is in the public domain. 26 | 27 | */ 28 | #include 29 | 30 | SoftwareSerial mySerial(10, 11); // RX, TX 31 | 32 | void setup() 33 | { 34 | // Open serial communications and wait for port to open: 35 | Serial.begin(57600); 36 | while (!Serial) { 37 | ; // wait for serial port to connect. Needed for Leonardo only 38 | } 39 | 40 | 41 | Serial.println("Goodnight moon!"); 42 | 43 | // set the data rate for the SoftwareSerial port 44 | mySerial.begin(4800); 45 | mySerial.println("Hello, world?"); 46 | } 47 | 48 | void loop() // run over and over 49 | { 50 | if (mySerial.available()) 51 | Serial.write(mySerial.read()); 52 | if (Serial.available()) 53 | mySerial.write(Serial.read()); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /libraries/Arduino_SoftwareSerial/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map for NewSoftSerial 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | NewSoftSerial KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | end KEYWORD2 17 | read KEYWORD2 18 | available KEYWORD2 19 | isListening KEYWORD2 20 | overflow KEYWORD2 21 | flush KEYWORD2 22 | listen KEYWORD2 23 | 24 | ####################################### 25 | # Constants (LITERAL1) 26 | ####################################### 27 | 28 | -------------------------------------------------------------------------------- /libraries/DFPlayer_Mini_Mp3/README.md: -------------------------------------------------------------------------------- 1 | DFPlayer-Mini-mp3 2 | ================= 3 | 4 | Install instructions: 5 | 6 | * Download file 7 | * decompress 8 | * copy inside folder to your Arduino library folder 9 | * restart your Arduino IDE 10 | 11 | 12 | Check the wiki for more information: 13 | http://www.dfrobot.com/wiki/index.php/DFPlayer_Mini_SKU:DFR0299 14 | -------------------------------------------------------------------------------- /libraries/DFPlayer_Mini_Mp3/examples/DFPlayer_DigisparkSoftSerial/DFPlayer_DigisparkSoftSerial.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | SoftSerial mySerial(0, 1); // RX, TX 6 | 7 | // 8 | void setup () { 9 | mySerial.begin (9600); 10 | mp3_set_serial (mySerial); //set softSerial for DFPlayer-mini mp3 module 11 | mp3_set_volume (15); 12 | } 13 | 14 | 15 | // 16 | void loop () { 17 | mp3_play (1); 18 | delay (6000); 19 | mp3_next (); 20 | delay (6000); 21 | mp3_prev (); 22 | delay (6000); 23 | mp3_play (4); 24 | delay (6000); 25 | } 26 | 27 | /* 28 | mp3_play (); //start play 29 | mp3_play (5); //play "mp3/0005.mp3" 30 | mp3_next (); //play next 31 | mp3_prev (); //play previous 32 | mp3_set_volume (uint16_t volume); //0~30 33 | mp3_set_EQ (); //0~5 34 | mp3_pause (); 35 | mp3_stop (); 36 | void mp3_get_state (); //send get state command 37 | void mp3_get_volume (); 38 | void mp3_get_u_sum (); 39 | void mp3_get_tf_sum (); 40 | void mp3_get_flash_sum (); 41 | void mp3_get_tf_current (); 42 | void mp3_get_u_current (); 43 | void mp3_get_flash_current (); 44 | void mp3_single_loop (boolean state); //set single loop 45 | void mp3_DAC (boolean state); 46 | void mp3_random_play (); 47 | */ 48 | -------------------------------------------------------------------------------- /libraries/DFPlayer_Mini_Mp3/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map for DFPlayer_Mini_Mp3 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ####################################### 10 | # Methods and Functions (KEYWORD2) 11 | ####################################### 12 | 13 | mp3_set_reply KEYWORD2 14 | fill_uint16_bigend KEYWORD2 15 | mp3_set_serial KEYWORD2 16 | get_mp3_checksum KEYWORD2 17 | mp3_fill_checksum KEYWORD2 18 | mp3_play KEYWORD2 19 | mp3_next KEYWORD2 20 | mp3_prev KEYWORD2 21 | mp3_set_volume KEYWORD2 22 | mp3_set_EQ KEYWORD2 23 | mp3_set_device KEYWORD2 24 | mp3_sleep KEYWORD2 25 | mp3_reset KEYWORD2 26 | mp3_pause KEYWORD2 27 | mp3_stop KEYWORD2 28 | mp3_play_mp3 KEYWORD2 29 | mp3_get_state KEYWORD2 30 | mp3_get_volume KEYWORD2 31 | mp3_get_u_sum KEYWORD2 32 | mp3_get_tf_sum KEYWORD2 33 | mp3_get_flash_sum KEYWORD2 34 | mp3_get_tf_current KEYWORD2 35 | mp3_get_u_current KEYWORD2 36 | mp3_get_flash_current KEYWORD2 37 | mp3_single_loop KEYWORD2 38 | mp3_DAC KEYWORD2 39 | mp3_random_play KEYWORD2 40 | 41 | ####################################### 42 | # Constants (LITERAL1) 43 | ####################################### 44 | 45 | -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/.gitattributes: -------------------------------------------------------------------------------- 1 | # Auto detect text files and perform LF normalization 2 | * text=auto 3 | 4 | # Custom for Visual Studio 5 | *.cs diff=csharp 6 | *.sln merge=union 7 | *.csproj merge=union 8 | *.vbproj merge=union 9 | *.fsproj merge=union 10 | *.dbproj merge=union 11 | 12 | # Standard to msysgit 13 | *.doc diff=astextplain 14 | *.DOC diff=astextplain 15 | *.docx diff=astextplain 16 | *.DOCX diff=astextplain 17 | *.dot diff=astextplain 18 | *.DOT diff=astextplain 19 | *.pdf diff=astextplain 20 | *.PDF diff=astextplain 21 | *.rtf diff=astextplain 22 | *.RTF diff=astextplain 23 | -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/CHANGELOG.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkIRLib/CHANGELOG.txt -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/IRLibMatch.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkIRLib/IRLibMatch.h -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/IRLibTimer.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkIRLib/IRLibTimer.h -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/LICENSE.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkIRLib/LICENSE.txt -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/README.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkIRLib/README.txt -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/examples/IRhashdecode/IRhashdecode.ino: -------------------------------------------------------------------------------- 1 | /* Example program for from IRLib – an Arduino library for infrared encoding and decoding 2 | * Version 1.0 January 2013 3 | * Copyright 2013 by Chris Young http://cyborg5.com 4 | * Based on original example sketch for IRremote library 5 | * Version 0.11 September, 2009 6 | * Copyright 2009 Ken Shirriff 7 | * http://arcfn.com 8 | */ 9 | /* 10 | * IRhashdecode - decode an arbitrary IR code. 11 | * Instead of decoding using a standard encoding scheme 12 | * (e.g. Sony, NEC, RC5), the code is hashed to a 32-bit value. 13 | * This should produce a unique 32-bit number however that number cannot be used 14 | * to retransmit the same code. This is just a quick and dirty way to detect a unique code 15 | * for controlling a device when you don't really care what protocol or values 16 | * are being sent. 17 | */ 18 | 19 | #include 20 | 21 | int RECV_PIN = 11; 22 | IRrecv My_Receiver(RECV_PIN); 23 | IRdecode My_Decoder; 24 | IRdecodeHash My_Hash_Decoder; 25 | 26 | void setup() 27 | { 28 | My_Receiver.enableIRIn(); // Start the receiver 29 | Serial.begin(9600); 30 | } 31 | 32 | void loop() { 33 | if (My_Receiver.GetResults(&My_Decoder)) {//Puts results in My_Decoder 34 | //Restart the receiver so it can be capturing another code 35 | //while we are working on decoding this one. 36 | My_Receiver.resume(); 37 | My_Hash_Decoder.copyBuf(&My_Decoder);//copy the results to the hash decoder 38 | My_Decoder.decode(); 39 | Serial.print("real decode type:"); 40 | Serial.print(Pnames(My_Decoder.decode_type)); 41 | Serial.print(" value: 0x"); 42 | Serial.print(My_Decoder.value, HEX); 43 | My_Hash_Decoder.decode(); 44 | Serial.print(", hash decode: 0x"); 45 | Serial.println(My_Hash_Decoder.hash, HEX); // Do something interesting with this value 46 | } 47 | } 48 | 49 | -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/examples/IRrecvDump/IRrecvDump.ino: -------------------------------------------------------------------------------- 1 | /* Example program for from IRLib – an Arduino library for infrared encoding and decoding 2 | * Version 1.0 January 2013 3 | * Copyright 2013 by Chris Young http://cyborg5.com 4 | * Based on original example sketch for IRremote library 5 | * Version 0.11 September, 2009 6 | * Copyright 2009 Ken Shirriff 7 | * http://arcfn.com 8 | */ 9 | /* 10 | * IRLib: IRrecvDump - dump details of IR codes with IRrecv 11 | * An IR detector/demodulator must be connected to the input RECV_PIN. 12 | */ 13 | 14 | #include 15 | 16 | int RECV_PIN = 11; 17 | 18 | IRrecv My_Receiver(RECV_PIN); 19 | 20 | IRdecode My_Decoder; 21 | unsigned int Buffer[RAWBUF]; 22 | 23 | void setup() 24 | { 25 | Serial.begin(9600); 26 | My_Receiver.enableIRIn(); // Start the receiver 27 | My_Decoder.UseExtnBuf(Buffer); 28 | } 29 | 30 | void loop() { 31 | if (My_Receiver.GetResults(&My_Decoder)) { 32 | //Restart the receiver so it can be capturing another code 33 | //while we are working on decoding this one. 34 | My_Receiver.resume(); 35 | My_Decoder.decode(); 36 | My_Decoder.DumpResults(); 37 | } 38 | } 39 | 40 | -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/examples/IRsendDemo/IRsendDemo.ino: -------------------------------------------------------------------------------- 1 | /* Example program for from IRLib – an Arduino library for infrared encoding and decoding 2 | * Version 1.0 January 2013 3 | * Copyright 2013 by Chris Young http://cyborg5.com 4 | * Based on original example sketch for IRremote library 5 | * Version 0.11 September, 2009 6 | * Copyright 2009 Ken Shirriff 7 | * http://arcfn.com 8 | */ 9 | #include 10 | 11 | IRsend My_Sender; 12 | 13 | void setup() 14 | { 15 | Serial.begin(9600); 16 | } 17 | 18 | void loop() { 19 | if (Serial.read() != -1) { 20 | //send a code every time a character is received from the serial port 21 | //Sony DVD power A8BCA 22 | My_Sender.send(SONY,0xa8bca, 20); 23 | } 24 | } 25 | 26 | -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/examples/IRsendJVC/IRsendJVC.ino: -------------------------------------------------------------------------------- 1 | /* Example program for from IRLib – an Arduino library for infrared encoding and decoding 2 | * Version 1.0 January 2013 3 | * Copyright 2013 by Chris Young http://cyborg5.com 4 | * Based on original example sketch for IRremote library 5 | * Version 0.11 September, 2009 6 | * Copyright 2009 Ken Shirriff 7 | * http://arcfn.com 8 | */ 9 | /* 10 | * JVC sends repeat codes that are identical to the regular JVC codes 11 | * however they have no header. Therefore there is an additional parameter 12 | * that tells you whether or not to send as an original code or as a repeat. 13 | * 14 | * The only device I had to test this protocol was an old JVC VCR. It would only work if at least 15 | * 2 frames are sent separated by 45us of "space". All JVC is the same bit length so we use 16 | * the third parameter as a to tell it whether or not to send the header. 17 | * Once with the third parameter "1" then delay about 50 microseconds and send again 18 | * with the third parameter "0". 19 | */ 20 | 21 | #include 22 | 23 | IRsend My_Sender; 24 | 25 | void setup() 26 | { 27 | Serial.begin(9600); 28 | } 29 | 30 | //send a code every time a character is received from the serial port 31 | void loop() { 32 | if (Serial.read() != -1) { 33 | My_Sender.send(JVC,0xc2d0,1); delayMicroseconds (50); 34 | My_Sender.send(JVC,0xc2d0,0); delayMicroseconds (50); 35 | } 36 | } 37 | 38 | -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/examples/IRserial_remote/IRserial_remote.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | IRsend My_Sender; 4 | 5 | int protocol; 6 | long code; 7 | int bits; 8 | void setup() { 9 | Serial.begin(9600); 10 | } 11 | 12 | long parseHex (void) { 13 | long Value=0; char C;delay(100); 14 | while (Serial.available()>0) { 15 | C= tolower(Serial.read()); 16 | if ((C>='0')&&(C<='9')) 17 | C=C-'0'; 18 | else 19 | if ((C>='a') && (C<='f')) 20 | C=C-'a'+10; 21 | else 22 | return Value; 23 | Value= C+(Value<<4); 24 | }; 25 | return Value; 26 | } 27 | void parseDelimiter () { 28 | char C; 29 | while(Serial.available()>0) { 30 | C=tolower(Serial.peek()); 31 | if( (C>='0') && (C<='9') )return; 32 | if( (C>='a') && (C<='f') )return; 33 | C=Serial.read();//throwaway delimiters 34 | delay (5); 35 | } 36 | } 37 | // enum IRTYPES {UNKNOWN, NEC, SONY, RC5, RC6, PANASONIC_OLD, JVC, NECX, HASH_CODE, LAST_PROTOCOL=HASH_CODE}; 38 | 39 | void loop() { 40 | if (Serial.available ()>0) { 41 | protocol = Serial.parseInt (); parseDelimiter(); 42 | code = parseHex (); parseDelimiter(); 43 | bits = Serial.parseInt (); parseDelimiter(); 44 | /* Serial.print("Prot:"); Serial.print(protocol); 45 | Serial.print(" Code:"); Serial.print(code,HEX); 46 | Serial.print(" Bits:"); Serial.println(bits); 47 | */ 48 | My_Sender.send(IRTYPES(protocol), code, bits); 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/examples/IRserial_remote/POV-Ray/remotebg.pov: -------------------------------------------------------------------------------- 1 | //POV-Ray source to generate the background image for IRserial_remote 2 | // create rectangular areas with rounded corners for use as 3 | // buttons and background objects. 4 | 5 | // Render at 1024x768 then crop 312 pixels from each side 6 | // leaving 400x768 final image. 7 | #declare Area=15; //size of area lights 8 | #declare CR=0.1; //corner radius 9 | #declare ER= 0.5; //edge radius 10 | #declare CX= 3; //width from corner to corner 11 | #declare CY= 7.75; //height from corner to corner 12 | #declare BZ=-ER; //Z offset for buttons 13 | 14 | plane {z,0 pigment{rgb<0.8,0.85,1>*0.8}}//background 15 | 16 | #macro Thing (ER,CR,CX,CY,T) 17 | #local Corner= 18 | union { 19 | torus {CR,ER rotate x*90} 20 | cylinder {ER*z,-ER*z,CR} 21 | } 22 | union { 23 | object{Corner translate< CX,CY,0>} 24 | object{Corner translate<-CX,CY,0>} 25 | object{Corner translate< CX,-CY,0>} 26 | object{Corner translate<-CX,-CY,0>} 27 | cylinder{CY*y,-CY*y,ER translate<-CX-CR,0,0>} 28 | cylinder{CY*y,-CY*y,ER translate< CX+CR,0,0>} 29 | cylinder{CX*x,-CX*x,ER translate<0,-CY-CR,0>} 30 | cylinder{CX*x,-CX*x,ER translate<0, CY+CR,0>} 31 | box{<-CX,-CY-CR,-ER>} 32 | box{<-CX-CR,-CY,-ER>} 33 | texture {T} 34 | } 35 | #end 36 | 37 | #declare BX= 0.4; #declare BY=BX;//size of the buttons 38 | #declare White_Texture=texture{pigment{rgb 1}finish {ambient 0.3}} 39 | #declare Blue_Texture=texture{pigment {rgb<0.85,0.9 ,1>}} 40 | 41 | object {Thing(ER,CR,CX,CY, White_Texture)}//main object 42 | //loop through the buttons 43 | #declare R=-4.5; 44 | #while (R<5.5) 45 | #declare C=-1.5; 46 | #while (C<=1.5) 47 | object{Thing(0.1,0.2,(BX*0.8),(BY*0.8), Blue_Texture) 48 | translate 49 | } 50 | #declare C=C+1; 51 | #end 52 | #declare R=R+1; 53 | #end 54 | 55 | 56 | light_source{<50,50,-100>*5 color 0.8 57 | #if (Area)area_light x*Area,y*Area,9,9#end 58 | } 59 | light_source{<0,0,-400>*3 rgb 1} 60 | 61 | camera{orthographic location <0,0,-120> look_at <0,0,0> angle 11 } 62 | //That's all folks! -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/examples/IRserial_remote/click.wav: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkIRLib/examples/IRserial_remote/click.wav -------------------------------------------------------------------------------- /libraries/DigisparkIRLib/examples/IRserial_remote/remotebg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkIRLib/examples/IRserial_remote/remotebg.png -------------------------------------------------------------------------------- /libraries/DigisparkJoystick/ArduinoNotes.txt: -------------------------------------------------------------------------------- 1 | Notes On Integrating AVRUSB with Arduino 2 | ======================================== 3 | 4 | * Note the license(s) under which AVRUSB is distributed. 5 | 6 | * See also: http://code.rancidbacon.com/ProjectLogArduinoUSB 7 | 8 | * Note: The pins we use on the PCB (not protoboard) hardware shield are: 9 | 10 | INT0 == PD2 == IC Pin 4 == Arduino Digital Pin 2 == D+ 11 | 12 | ---- == PD4 == -------- == Arduino Digital Pin 4 == D- 13 | 14 | ---- == PD5 == -------- == Arduino Digital Pin 5 == pull-up 15 | 16 | (DONE: Change to not use PD3 so INT1 is left free?) 17 | 18 | * In order to compile a valid 'usbconfig.h' file must exit. The content of this 19 | file will vary depending on whether the device is a generic USB device, 20 | generic HID device or specific class of HID device for example. 21 | 22 | The file 'usbconfig-prototype.h' can be used as a starting point, however 23 | it might be easier to use the 'usbconfig.h' from one of the example projects. 24 | 25 | TODO: Specify the settings that need to be changed to match the shield 26 | design we use. 27 | 28 | * (NOTE: Initial 'usbconfig.h' used will be based on the file from 29 | 'HIDKeys.2007-03-29'.) (Note: Have now upgraded to V-USB 2009-08-22.) 30 | 31 | * Versions of the Arduino IDE prior to 0018 won't compile our library 32 | so it needs to be pre-compiled with: 33 | 34 | avr-g++ -Wall -Os -I. -DF_CPU=16000000 -mmcu=atmega168 -c usbdrvasm.S -c usbdrv.c 35 | -------------------------------------------------------------------------------- /libraries/DigisparkJoystick/DigiJoystick.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkJoystick/DigiJoystick.h -------------------------------------------------------------------------------- /libraries/DigisparkJoystick/JoystickReadme.txt: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkJoystick/JoystickReadme.txt -------------------------------------------------------------------------------- /libraries/DigisparkJoystick/examples/Joystick/Joystick.ino: -------------------------------------------------------------------------------- 1 | //DigiJoystick test and usage documentation 2 | 3 | #include "DigiJoystick.h" 4 | 5 | void setup() { 6 | // Do nothing? It seems as if the USB hardware is ready to go on reset 7 | } 8 | 9 | 10 | void loop() { 11 | // If not using plentiful DigiJoystick.delay() calls, make sure to 12 | //DigiJoystick.update(); // call this at least every 50ms 13 | // calling more often than that is fine 14 | // this will actually only send the data every once in a while unless the data is different 15 | 16 | // you can set the values from a raw byte array with: 17 | // char myBuf[8] = { 18 | // x, y, xrot, yrot, zrot, slider, 19 | // buttonLowByte, buttonHighByte 20 | // }; 21 | // DigiJoystick.setValues(myBuf); 22 | 23 | // Or we can also set values like this: 24 | DigiJoystick.setX((byte) (millis() / 100)); // scroll X left to right repeatedly 25 | DigiJoystick.setY((byte) 0x30); 26 | DigiJoystick.setXROT((byte) 0x60); 27 | DigiJoystick.setYROT((byte) 0x90); 28 | DigiJoystick.setZROT((byte) 0xB0); 29 | DigiJoystick.setSLIDER((byte) 0xF0); 30 | 31 | // it's best to use DigiJoystick.delay() because it knows how to talk to 32 | // the connected computer - otherwise the USB link can crash with the 33 | // regular arduino delay() function 34 | DigiJoystick.delay(50); // wait 50 milliseconds 35 | 36 | // we can also set buttons like this (lowByte, highByte) 37 | //DigiJoystick.setButtons(0x00, 0x00); 38 | } -------------------------------------------------------------------------------- /libraries/DigisparkJoystick/keywords.txt: -------------------------------------------------------------------------------- 1 | DigiKeyboard KEYWORD1 2 | update KEYWORD2 3 | sendKeyStroke KEYWORD2 -------------------------------------------------------------------------------- /libraries/DigisparkJoystick/oddebug.c: -------------------------------------------------------------------------------- 1 | /* Name: oddebug.c 2 | * Project: AVR library 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2005-01-16 5 | * Tabsize: 4 6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id: oddebug.c 692 2008-11-07 15:07:40Z cs $ 9 | */ 10 | 11 | #include "oddebug.h" 12 | 13 | #if DEBUG_LEVEL > 0 14 | 15 | #warning "Never compile production devices with debugging enabled" 16 | 17 | static void uartPutc(char c) 18 | { 19 | while(!(ODDBG_USR & (1 << ODDBG_UDRE))); /* wait for data register empty */ 20 | ODDBG_UDR = c; 21 | } 22 | 23 | static uchar hexAscii(uchar h) 24 | { 25 | h &= 0xf; 26 | if(h >= 10) 27 | h += 'a' - (uchar)10 - '0'; 28 | h += '0'; 29 | return h; 30 | } 31 | 32 | static void printHex(uchar c) 33 | { 34 | uartPutc(hexAscii(c >> 4)); 35 | uartPutc(hexAscii(c)); 36 | } 37 | 38 | void odDebug(uchar prefix, uchar *data, uchar len) 39 | { 40 | printHex(prefix); 41 | uartPutc(':'); 42 | while(len--){ 43 | uartPutc(' '); 44 | printHex(*data++); 45 | } 46 | uartPutc('\r'); 47 | uartPutc('\n'); 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /libraries/DigisparkJoystick/osccal.c: -------------------------------------------------------------------------------- 1 | /* Name: osccal.c 2 | * Author: Christian Starkjohann 3 | * Creation Date: 2008-04-10 4 | * Tabsize: 4 5 | * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH 6 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 7 | * This Revision: $Id: osccal.c 762 2009-08-12 17:10:30Z cs $ 8 | */ 9 | 10 | #include 11 | 12 | #ifndef uchar 13 | #define uchar unsigned char 14 | #endif 15 | 16 | /* ------------------------------------------------------------------------- */ 17 | /* ------------------------ Oscillator Calibration ------------------------- */ 18 | /* ------------------------------------------------------------------------- */ 19 | 20 | /* Calibrate the RC oscillator. Our timing reference is the Start Of Frame 21 | * signal (a single SE0 bit) repeating every millisecond immediately after 22 | * a USB RESET. We first do a binary search for the OSCCAL value and then 23 | * optimize this value with a neighboorhod search. 24 | */ 25 | void calibrateOscillator(void) 26 | { 27 | uchar step = 128; 28 | uchar trialValue = 0, optimumValue; 29 | int x, optimumDev, targetValue = (unsigned)(1499 * (double)F_CPU / 10.5e6 + 0.5); 30 | 31 | /* do a binary search: */ 32 | do{ 33 | OSCCAL = trialValue + step; 34 | x = usbMeasureFrameLength(); /* proportional to current real frequency */ 35 | if(x < targetValue) /* frequency still too low */ 36 | trialValue += step; 37 | step >>= 1; 38 | }while(step > 0); 39 | /* We have a precision of +/- 1 for optimum OSCCAL here */ 40 | /* now do a neighborhood search for optimum value */ 41 | optimumValue = trialValue; 42 | optimumDev = x; /* this is certainly far away from optimum */ 43 | for(OSCCAL = trialValue - 1; OSCCAL <= trialValue + 1; OSCCAL++){ 44 | x = usbMeasureFrameLength() - targetValue; 45 | if(x < 0) 46 | x = -x; 47 | if(x < optimumDev){ 48 | optimumDev = x; 49 | optimumValue = OSCCAL; 50 | } 51 | } 52 | OSCCAL = optimumValue; 53 | } 54 | /* 55 | Note: This calibration algorithm may try OSCCAL values of up to 192 even if 56 | the optimum value is far below 192. It may therefore exceed the allowed clock 57 | frequency of the CPU in low voltage designs! 58 | You may replace this search algorithm with any other algorithm you like if 59 | you have additional constraints such as a maximum CPU clock. 60 | For version 5.x RC oscillators (those with a split range of 2x128 steps, e.g. 61 | ATTiny25, ATTiny45, ATTiny85), it may be useful to search for the optimum in 62 | both regions. 63 | */ 64 | -------------------------------------------------------------------------------- /libraries/DigisparkJoystick/osccal.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkJoystick/osccal.o -------------------------------------------------------------------------------- /libraries/DigisparkJoystick/usbdrvasm.asm: -------------------------------------------------------------------------------- 1 | /* Name: usbdrvasm.asm 2 | * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2006-03-01 5 | * Tabsize: 4 6 | * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id$ 9 | */ 10 | 11 | /* 12 | General Description: 13 | The IAR compiler/assembler system prefers assembler files with file extension 14 | ".asm". We simply provide this file as an alias for usbdrvasm.S. 15 | 16 | Thanks to Oleg Semyonov for his help with the IAR tools port! 17 | */ 18 | 19 | #include "usbdrvasm.S" 20 | 21 | end 22 | -------------------------------------------------------------------------------- /libraries/DigisparkKeyboard/ArduinoNotes.txt: -------------------------------------------------------------------------------- 1 | Notes On Integrating AVRUSB with Arduino 2 | ======================================== 3 | 4 | * Note the license(s) under which AVRUSB is distributed. 5 | 6 | * See also: http://code.rancidbacon.com/ProjectLogArduinoUSB 7 | 8 | * Note: The pins we use on the PCB (not protoboard) hardware shield are: 9 | 10 | INT0 == PD2 == IC Pin 4 == Arduino Digital Pin 2 == D+ 11 | 12 | ---- == PD4 == -------- == Arduino Digital Pin 4 == D- 13 | 14 | ---- == PD5 == -------- == Arduino Digital Pin 5 == pull-up 15 | 16 | (DONE: Change to not use PD3 so INT1 is left free?) 17 | 18 | * In order to compile a valid 'usbconfig.h' file must exit. The content of this 19 | file will vary depending on whether the device is a generic USB device, 20 | generic HID device or specific class of HID device for example. 21 | 22 | The file 'usbconfig-prototype.h' can be used as a starting point, however 23 | it might be easier to use the 'usbconfig.h' from one of the example projects. 24 | 25 | TODO: Specify the settings that need to be changed to match the shield 26 | design we use. 27 | 28 | * (NOTE: Initial 'usbconfig.h' used will be based on the file from 29 | 'HIDKeys.2007-03-29'.) (Note: Have now upgraded to V-USB 2009-08-22.) 30 | 31 | * Versions of the Arduino IDE prior to 0018 won't compile our library 32 | so it needs to be pre-compiled with: 33 | 34 | avr-g++ -Wall -Os -I. -DF_CPU=16000000 -mmcu=atmega168 -c usbdrvasm.S -c usbdrv.c 35 | -------------------------------------------------------------------------------- /libraries/DigisparkKeyboard/examples/Keyboard/Keyboard.ino: -------------------------------------------------------------------------------- 1 | #include "DigiKeyboard.h" 2 | 3 | void setup() { 4 | // don't need to set anything up to use DigiKeyboard 5 | } 6 | 7 | 8 | void loop() { 9 | // this is generally not necessary but with some older systems it seems to 10 | // prevent missing the first character after a delay: 11 | DigiKeyboard.sendKeyStroke(0); 12 | 13 | // Type out this string letter by letter on the computer (assumes US-style 14 | // keyboard) 15 | DigiKeyboard.println("Hello Digispark!"); 16 | 17 | // It's better to use DigiKeyboard.delay() over the regular Arduino delay() 18 | // if doing keyboard stuff because it keeps talking to the computer to make 19 | // sure the computer knows the keyboard is alive and connected 20 | DigiKeyboard.delay(5000); 21 | } 22 | -------------------------------------------------------------------------------- /libraries/DigisparkKeyboard/keywords.txt: -------------------------------------------------------------------------------- 1 | DigiKeyboard KEYWORD1 2 | update KEYWORD2 3 | sendKeyStroke KEYWORD2 -------------------------------------------------------------------------------- /libraries/DigisparkKeyboard/oddebug.c: -------------------------------------------------------------------------------- 1 | /* Name: oddebug.c 2 | * Project: AVR library 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2005-01-16 5 | * Tabsize: 4 6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id: oddebug.c 692 2008-11-07 15:07:40Z cs $ 9 | */ 10 | 11 | #include "oddebug.h" 12 | 13 | #if DEBUG_LEVEL > 0 14 | 15 | #warning "Never compile production devices with debugging enabled" 16 | 17 | static void uartPutc(char c) 18 | { 19 | while(!(ODDBG_USR & (1 << ODDBG_UDRE))); /* wait for data register empty */ 20 | ODDBG_UDR = c; 21 | } 22 | 23 | static uchar hexAscii(uchar h) 24 | { 25 | h &= 0xf; 26 | if(h >= 10) 27 | h += 'a' - (uchar)10 - '0'; 28 | h += '0'; 29 | return h; 30 | } 31 | 32 | static void printHex(uchar c) 33 | { 34 | uartPutc(hexAscii(c >> 4)); 35 | uartPutc(hexAscii(c)); 36 | } 37 | 38 | void odDebug(uchar prefix, uchar *data, uchar len) 39 | { 40 | printHex(prefix); 41 | uartPutc(':'); 42 | while(len--){ 43 | uartPutc(' '); 44 | printHex(*data++); 45 | } 46 | uartPutc('\r'); 47 | uartPutc('\n'); 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /libraries/DigisparkKeyboard/osccal.c: -------------------------------------------------------------------------------- 1 | /* Name: osccal.c 2 | * Author: Christian Starkjohann 3 | * Creation Date: 2008-04-10 4 | * Tabsize: 4 5 | * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH 6 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 7 | * This Revision: $Id: osccal.c 762 2009-08-12 17:10:30Z cs $ 8 | */ 9 | 10 | #include 11 | 12 | #ifndef uchar 13 | #define uchar unsigned char 14 | #endif 15 | 16 | /* ------------------------------------------------------------------------- */ 17 | /* ------------------------ Oscillator Calibration ------------------------- */ 18 | /* ------------------------------------------------------------------------- */ 19 | 20 | /* Calibrate the RC oscillator. Our timing reference is the Start Of Frame 21 | * signal (a single SE0 bit) repeating every millisecond immediately after 22 | * a USB RESET. We first do a binary search for the OSCCAL value and then 23 | * optimize this value with a neighboorhod search. 24 | */ 25 | void calibrateOscillator(void) 26 | { 27 | uchar step = 128; 28 | uchar trialValue = 0, optimumValue; 29 | int x, optimumDev, targetValue = (unsigned)(1499 * (double)F_CPU / 10.5e6 + 0.5); 30 | 31 | /* do a binary search: */ 32 | do{ 33 | OSCCAL = trialValue + step; 34 | x = usbMeasureFrameLength(); /* proportional to current real frequency */ 35 | if(x < targetValue) /* frequency still too low */ 36 | trialValue += step; 37 | step >>= 1; 38 | }while(step > 0); 39 | /* We have a precision of +/- 1 for optimum OSCCAL here */ 40 | /* now do a neighborhood search for optimum value */ 41 | optimumValue = trialValue; 42 | optimumDev = x; /* this is certainly far away from optimum */ 43 | for(OSCCAL = trialValue - 1; OSCCAL <= trialValue + 1; OSCCAL++){ 44 | x = usbMeasureFrameLength() - targetValue; 45 | if(x < 0) 46 | x = -x; 47 | if(x < optimumDev){ 48 | optimumDev = x; 49 | optimumValue = OSCCAL; 50 | } 51 | } 52 | OSCCAL = optimumValue; 53 | } 54 | /* 55 | Note: This calibration algorithm may try OSCCAL values of up to 192 even if 56 | the optimum value is far below 192. It may therefore exceed the allowed clock 57 | frequency of the CPU in low voltage designs! 58 | You may replace this search algorithm with any other algorithm you like if 59 | you have additional constraints such as a maximum CPU clock. 60 | For version 5.x RC oscillators (those with a split range of 2x128 steps, e.g. 61 | ATTiny25, ATTiny45, ATTiny85), it may be useful to search for the optimum in 62 | both regions. 63 | */ 64 | -------------------------------------------------------------------------------- /libraries/DigisparkKeyboard/osccal.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkKeyboard/osccal.o -------------------------------------------------------------------------------- /libraries/DigisparkKeyboard/usbdrvasm.asm: -------------------------------------------------------------------------------- 1 | /* Name: usbdrvasm.asm 2 | * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2006-03-01 5 | * Tabsize: 4 6 | * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id$ 9 | */ 10 | 11 | /* 12 | General Description: 13 | The IAR compiler/assembler system prefers assembler files with file extension 14 | ".asm". We simply provide this file as an alias for usbdrvasm.S. 15 | 16 | Thanks to Oleg Semyonov for his help with the IAR tools port! 17 | */ 18 | 19 | #include "usbdrvasm.S" 20 | 21 | end 22 | -------------------------------------------------------------------------------- /libraries/DigisparkLCD/examples/BasicUsage/BasicUsage.ino: -------------------------------------------------------------------------------- 1 | /* ATtiny85 as an I2C Master Ex2 BroHogan 1/21/11 2 | * Modified for Digistump - Digispark LCD Shield by Erik Kettenburg 11/2012 3 | * SETUP: 4 | * ATtiny Pin 1 = (RESET) N/U ATtiny Pin 2 = (D3) N/U 5 | * ATtiny Pin 3 = (D4) to LED1 ATtiny Pin 4 = GND 6 | * ATtiny Pin 5 = SDA on DS1621 & GPIO ATtiny Pin 6 = (D1) to LED2 7 | * ATtiny Pin 7 = SCK on DS1621 & GPIO ATtiny Pin 8 = VCC (2.7-5.5V) 8 | * NOTE! - It's very important to use pullups on the SDA & SCL lines! 9 | * PCA8574A GPIO was used wired per instructions in "info" folder in the LiquidCrystal_I2C lib. 10 | * This ex assumes A0-A2 are set HIGH for an addeess of 0x3F 11 | * LiquidCrystal_I2C lib was modified for ATtiny - on Playground with TinyWireM lib. 12 | * TinyWireM USAGE & CREDITS: - see TinyWireM.h 13 | */ 14 | 15 | //#define DEBUG 16 | #include // I2C Master lib for ATTinys which use USI - comment this out to use with standard arduinos 17 | #include // for LCD w/ GPIO MODIFIED for the ATtiny85 18 | 19 | #define GPIO_ADDR 0x27 // (PCA8574A A0-A2 @5V) typ. A0-A3 Gnd 0x20 / 0x38 for A - 0x27 is the address of the Digispark LCD modules. 20 | 21 | 22 | LiquidCrystal_I2C lcd(GPIO_ADDR,16,2); // set address & 16 chars / 2 lines 23 | 24 | 25 | void setup(){ 26 | TinyWireM.begin(); // initialize I2C lib - comment this out to use with standard arduinos 27 | lcd.init(); // initialize the lcd 28 | lcd.backlight(); // Print a message to the LCD. 29 | lcd.print("Digispark!"); 30 | } 31 | 32 | 33 | void loop(){ 34 | 35 | } 36 | 37 | -------------------------------------------------------------------------------- /libraries/DigisparkLCD/info/BC557.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkLCD/info/BC557.pdf -------------------------------------------------------------------------------- /libraries/DigisparkLCD/info/Image.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkLCD/info/Image.jpg -------------------------------------------------------------------------------- /libraries/DigisparkLCD/info/PCF8574P.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkLCD/info/PCF8574P.pdf -------------------------------------------------------------------------------- /libraries/DigisparkLCD/info/Schematic_diagram.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkLCD/info/Schematic_diagram.jpg -------------------------------------------------------------------------------- /libraries/DigisparkLCD/info/notes_for_pollin_interface.txt: -------------------------------------------------------------------------------- 1 | Notes for users with a Pollin.de interface board 2 | http://www.pollin.de/shop/dt/NDU4OTgxOTk-/Bausaetze_Module/Bausaetze/LCD_I2C_Modul.html 3 | 4 | The pollin interface board will not work with de default library. 5 | To get it working two control lines to the LCD need to be changed. 6 | 7 | Open file "LiquidCrystal_I2C.h" with a text editor like Notepad (not WordPad !) 8 | 9 | In that file look for: 10 | #define En B00010000 // Enable bit 11 | #define Rw B00100000 // Read/Write bit 12 | #define Rs B01000000 // Register select bit 13 | 14 | Replace these lines by: 15 | #define En B01000000 // Enable bit 16 | #define Rw B00100000 // Read/Write bit 17 | #define Rs B00010000 // Register select bit 18 | 19 | 20 | 21 | People at Pollin also have misunderstood the PCF8574 Datasheet and list the wrong addresses on their PCB 22 | For PCF8574A the addressing is: 23 | 24 | Jp3 Jp2 Jp1 25 | A2 A1 A0 Dec Hex 26 | L L L 56 0x38 27 | L L H 57 0x39 28 | L H L 64 0x40 29 | L H H 74 0x4A 30 | H L L 75 0x4B 31 | H L H 76 0x4C 32 | H H L 77 0x4D 33 | H H H 78 0x4E 34 | 35 | They also seem to ship boards with a PCF8574 36 | For PCF8574 the addressing is: 37 | 38 | Jp3 Jp2 Jp1 39 | A2 A1 A0 Dec Hex 40 | L L L 32 0x20 41 | L L H 33 0x21 42 | L H L 34 0x22 43 | L H H 35 0x23 44 | H L L 36 0x24 45 | H L H 37 0x25 46 | H H L 38 0x26 47 | H H H 39 0x27 48 | 49 | 50 | They have also chosen two rather high pull-up resistors (10K) for the I2C lines. Usually two 4K7 resistors should do the job. 51 | Please note that on a I2C bus only one device should have the pull-up resistors installed! 52 | 53 | I hope this helps in getting your LCD working. 54 | 55 | Mario -------------------------------------------------------------------------------- /libraries/DigisparkLCD/info/readme.txt: -------------------------------------------------------------------------------- 1 | LiquidCrystal_I2C V2.0 2 | 3 | The LiquidCrystal_I2C library is a modified version of the standard LiquidCrystal library as found on 4 | the Arduino website. 5 | This library is intended to be used when a parallel HD44780 compatible LCD is controlled over I2C using 6 | a PCF8574 extender (see datasheet for details). 7 | 4 of the 8 outputs are used for LDC data lines 4 to 7. 8 | 3 outputs are used for the Enable, register-select and Read/Write lines. 9 | The one output left can be used to control the backlight of the LCD (if available). 10 | For backlight control some extra resistors and a pnp-type transistor are required (for details see 11 | schematic diagram). 12 | 13 | The PCF8574 extender is available in two versions, the PCF8574 and the PCF8574A. 14 | The only difference between the two is the I2C base address. 15 | The base address for the PCF8574 is 0x20 and the base address for the PCF8574A is 0x38. 16 | The examples included in this zip file assume the use of an PCF8574 set for address 0x20 17 | (A0, A1 and A3 grounded). 18 | 19 | For compatibility reasons this library contains some aliases for functions that are known under different 20 | names in other libraries. This should make it fairly easy to implement the library in existing sketches 21 | without changing to much code. 22 | Functions not supported by this library will return nothing at all and in case a return value is expected 23 | the function will return 0. 24 | 25 | Update 8-12-2011: 26 | Due to the relaese of Arduino IDE 1.0 some changes were made to the library to get it working under the new IDE. 27 | Because of these changes this version of the LiquidCrystal_I2C library can not be used for older IDE versions. 28 | The old version of the LiquidCrystal_I2Clibrary can be downloaded form http://www.xs4all.nl/~hmario/arduino/LiquidCrystal_I2C/V1.0/LiquidCrystal_I2C_V1.0.zip 29 | 30 | Download the latest version from: 31 | http://www.xs4all.nl/~hmario/arduino/LiquidCrystal_I2C/LiquidCrystal_I2C.zip 32 | (Thanks to Ailton F. for beta testing.) 33 | 34 | 35 | Mario H. 36 | atmega@xs4all.nl -------------------------------------------------------------------------------- /libraries/DigisparkLCD/keywords.txt: -------------------------------------------------------------------------------- 1 | ########################################### 2 | # Syntax Coloring Map For LiquidCrystal_I2C 3 | # Version 2.0 4 | ########################################### 5 | 6 | ########################################### 7 | # Datatypes (KEYWORD1) 8 | ########################################### 9 | 10 | LiquidCrystal_I2C KEYWORD1 11 | 12 | ########################################### 13 | # Methods and Functions (KEYWORD2) 14 | ########################################### 15 | init KEYWORD2 16 | begin KEYWORD2 17 | clear KEYWORD2 18 | home KEYWORD2 19 | noDisplay KEYWORD2 20 | display KEYWORD2 21 | noBlink KEYWORD2 22 | blink KEYWORD2 23 | noCursor KEYWORD2 24 | cursor KEYWORD2 25 | scrollDisplayLeft KEYWORD2 26 | scrollDisplayRight KEYWORD2 27 | leftToRight KEYWORD2 28 | rightToLeft KEYWORD2 29 | shiftIncrement KEYWORD2 30 | shiftDecrement KEYWORD2 31 | noBacklight KEYWORD2 32 | backlight KEYWORD2 33 | autoscroll KEYWORD2 34 | noAutoscroll KEYWORD2 35 | createChar KEYWORD2 36 | setCursor KEYWORD2 37 | print KEYWORD2 38 | blink_on KEYWORD2 39 | blink_off KEYWORD2 40 | cursor_on KEYWORD2 41 | cursor_off KEYWORD2 42 | setBacklight KEYWORD2 43 | load_custom_character KEYWORD2 44 | printstr KEYWORD2 45 | ########################################### 46 | # Constants (LITERAL1) 47 | ########################################### 48 | -------------------------------------------------------------------------------- /libraries/DigisparkLPD8806/LPD8806.h: -------------------------------------------------------------------------------- 1 | #if (ARDUINO >= 100) 2 | #include 3 | #else 4 | #include 5 | #include 6 | #endif 7 | 8 | class LPD8806 { 9 | 10 | public: 11 | 12 | LPD8806(uint16_t n, uint8_t dpin, uint8_t cpin); // Configurable pins 13 | void 14 | begin(void), 15 | show(void), 16 | setPixelColor(uint16_t n, uint8_t r, uint8_t g, uint8_t b), 17 | setPixelColor(uint16_t n, uint32_t c), 18 | updatePins(uint8_t dpin, uint8_t cpin), // Change pins, configurable 19 | updateLength(uint16_t n); // Change strip length 20 | uint16_t 21 | numPixels(void); 22 | uint32_t 23 | Color(byte, byte, byte), 24 | getPixelColor(uint16_t n); 25 | 26 | private: 27 | 28 | uint16_t 29 | numLEDs; // Number of RGB LEDs in strip 30 | uint8_t 31 | *pixels, // Holds LED color values (3 bytes each) 32 | clkpin , datapin, // Clock & data pin numbers 33 | clkpinmask, datapinmask; // Clock & data PORT bitmasks 34 | volatile uint8_t 35 | *clkport , *dataport; // Clock & data PORT registers 36 | void 37 | startBitbang(void); 38 | boolean 39 | hardwareSPI, // If 'true', using hardware SPI 40 | begun; // If 'true', begin() method was previously invoked 41 | }; 42 | -------------------------------------------------------------------------------- /libraries/DigisparkLPD8806/README.md: -------------------------------------------------------------------------------- 1 | # Arduino library for LPD8806 # 2 | This Library was written for the LPD8806 PWM LED driver chips, strips and pixels. 3 | But the LPD8803/LPD8809 will probably work too. 4 | 5 | ## Where to Buy? ## 6 | Pick some up at [Adafruit Industries](http://www.adafruit.com/products/306) 7 | 8 | ## Download ## 9 | Click the Downloads Tab in the Tabbar above. 10 | Or follow [this](https://github.com/adafruit/LPD8806/zipball/master) link 11 | 12 | ## Installation ## 13 | * Uncompress the Downloaded Library 14 | * Rename the uncompressed folder to LPD8806 15 | * Check that the LPD8806 folder contains LPD8806.cpp and LPD8806.h 16 | * Place the LPD8806 library folder your /libraries/ folder, 17 | if the libraries folder does not exist - create it first! 18 | * Restart the IDE -------------------------------------------------------------------------------- /libraries/DigisparkLPD8806/examples/longstrandtest/longstrandtest.pde: -------------------------------------------------------------------------------- 1 | #include "LPD8806.h" 2 | #include "SPI.h" 3 | 4 | // Simple test for 160 (5 meters) of LPD8806-based RGB LED strip 5 | 6 | /*****************************************************************************/ 7 | 8 | // Number of RGB LEDs in strand: 9 | int nLEDs = 160; 10 | 11 | // Chose 2 pins for output; can be any valid output pins: 12 | int dataPin = 2; 13 | int clockPin = 3; 14 | 15 | // First parameter is the number of LEDs in the strand. The LED strips 16 | // are 32 LEDs per meter but you can extend or cut the strip. Next two 17 | // parameters are SPI data and clock pins: 18 | LPD8806 strip = LPD8806(nLEDs, dataPin, clockPin); 19 | 20 | // You can optionally use hardware SPI for faster writes, just leave out 21 | // the data and clock pin parameters. But this does limit use to very 22 | // specific pins on the Arduino. For "classic" Arduinos (Uno, Duemilanove, 23 | // etc.), data = pin 11, clock = pin 13. For Arduino Mega, data = pin 51, 24 | // clock = pin 52. For 32u4 Breakout Board+ and Teensy, data = pin B2, 25 | // clock = pin B1. For Leonardo, this can ONLY be done on the ICSP pins. 26 | //LPD8806 strip = LPD8806(nLEDs); 27 | 28 | void setup() { 29 | // Start up the LED strip 30 | strip.begin(); 31 | 32 | // Update the strip, to start they are all 'off' 33 | strip.show(); 34 | } 35 | 36 | void loop() { 37 | colorChase(strip.Color(127, 0, 0), 100); // Red 38 | colorChase(strip.Color( 0,127, 0), 100); // Green 39 | colorChase(strip.Color( 0, 0,127), 100); // Blue 40 | colorChase(strip.Color(127,127,127), 100); // White 41 | } 42 | 43 | // Chase one dot down the full strip. Good for testing purposes. 44 | void colorChase(uint32_t c, uint8_t wait) { 45 | int i; 46 | 47 | // Start by turning all pixels off: 48 | for(i=0; i 0 14 | 15 | #warning "Never compile production devices with debugging enabled" 16 | 17 | static void uartPutc(char c) 18 | { 19 | while(!(ODDBG_USR & (1 << ODDBG_UDRE))); /* wait for data register empty */ 20 | ODDBG_UDR = c; 21 | } 22 | 23 | static uchar hexAscii(uchar h) 24 | { 25 | h &= 0xf; 26 | if(h >= 10) 27 | h += 'a' - (uchar)10 - '0'; 28 | h += '0'; 29 | return h; 30 | } 31 | 32 | static void printHex(uchar c) 33 | { 34 | uartPutc(hexAscii(c >> 4)); 35 | uartPutc(hexAscii(c)); 36 | } 37 | 38 | void odDebug(uchar prefix, uchar *data, uchar len) 39 | { 40 | printHex(prefix); 41 | uartPutc(':'); 42 | while(len--){ 43 | uartPutc(' '); 44 | printHex(*data++); 45 | } 46 | uartPutc('\r'); 47 | uartPutc('\n'); 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /libraries/DigisparkMouse/osccal.c: -------------------------------------------------------------------------------- 1 | /* Name: osccal.c 2 | * Author: Christian Starkjohann 3 | * Creation Date: 2008-04-10 4 | * Tabsize: 4 5 | * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH 6 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 7 | * This Revision: $Id: osccal.c 762 2009-08-12 17:10:30Z cs $ 8 | */ 9 | 10 | #include 11 | 12 | #ifndef uchar 13 | #define uchar unsigned char 14 | #endif 15 | 16 | /* ------------------------------------------------------------------------- */ 17 | /* ------------------------ Oscillator Calibration ------------------------- */ 18 | /* ------------------------------------------------------------------------- */ 19 | 20 | /* Calibrate the RC oscillator. Our timing reference is the Start Of Frame 21 | * signal (a single SE0 bit) repeating every millisecond immediately after 22 | * a USB RESET. We first do a binary search for the OSCCAL value and then 23 | * optimize this value with a neighboorhod search. 24 | */ 25 | void calibrateOscillator(void) 26 | { 27 | uchar step = 128; 28 | uchar trialValue = 0, optimumValue; 29 | int x, optimumDev, targetValue = (unsigned)(1499 * (double)F_CPU / 10.5e6 + 0.5); 30 | 31 | /* do a binary search: */ 32 | do{ 33 | OSCCAL = trialValue + step; 34 | x = usbMeasureFrameLength(); /* proportional to current real frequency */ 35 | if(x < targetValue) /* frequency still too low */ 36 | trialValue += step; 37 | step >>= 1; 38 | }while(step > 0); 39 | /* We have a precision of +/- 1 for optimum OSCCAL here */ 40 | /* now do a neighborhood search for optimum value */ 41 | optimumValue = trialValue; 42 | optimumDev = x; /* this is certainly far away from optimum */ 43 | for(OSCCAL = trialValue - 1; OSCCAL <= trialValue + 1; OSCCAL++){ 44 | x = usbMeasureFrameLength() - targetValue; 45 | if(x < 0) 46 | x = -x; 47 | if(x < optimumDev){ 48 | optimumDev = x; 49 | optimumValue = OSCCAL; 50 | } 51 | } 52 | OSCCAL = optimumValue; 53 | } 54 | /* 55 | Note: This calibration algorithm may try OSCCAL values of up to 192 even if 56 | the optimum value is far below 192. It may therefore exceed the allowed clock 57 | frequency of the CPU in low voltage designs! 58 | You may replace this search algorithm with any other algorithm you like if 59 | you have additional constraints such as a maximum CPU clock. 60 | For version 5.x RC oscillators (those with a split range of 2x128 steps, e.g. 61 | ATTiny25, ATTiny45, ATTiny85), it may be useful to search for the optimum in 62 | both regions. 63 | */ 64 | -------------------------------------------------------------------------------- /libraries/DigisparkMouse/osccal.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkMouse/osccal.o -------------------------------------------------------------------------------- /libraries/DigisparkMouse/usbdrvasm.asm: -------------------------------------------------------------------------------- 1 | /* Name: usbdrvasm.asm 2 | * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2006-03-01 5 | * Tabsize: 4 6 | * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id$ 9 | */ 10 | 11 | /* 12 | General Description: 13 | The IAR compiler/assembler system prefers assembler files with file extension 14 | ".asm". We simply provide this file as an alias for usbdrvasm.S. 15 | 16 | Thanks to Oleg Semyonov for his help with the IAR tools port! 17 | */ 18 | 19 | #include "usbdrvasm.S" 20 | 21 | end 22 | -------------------------------------------------------------------------------- /libraries/DigisparkRGB/DigisparkRGB.cpp: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "DigisparkRGB.h" 6 | #include "Arduino.h" 7 | 8 | #define set(x) |= (1< 2 | /* 3 | Digispark RGB 4 | 5 | This example shows how to use soft PWM to fade 3 colors. 6 | Note: This is only necessary for PB2 (pin 2) - Blue, as Red (pin 0) and Green (pin 1) as well as pin 4 support the standard Arduino analogWrite() function. 7 | 8 | This example code is in the public domain. 9 | */ 10 | byte RED = 0; 11 | byte BLUE = 2; 12 | byte GREEN = 1; 13 | byte COLORS[] = {RED, BLUE, GREEN}; 14 | 15 | // the setup routine runs once when you press reset: 16 | void setup() { 17 | DigisparkRGBBegin(); 18 | } 19 | 20 | 21 | void loop () 22 | { 23 | //direction: up = true, down = false 24 | boolean dir = true; 25 | int i = 0; 26 | 27 | while(1) 28 | { 29 | fade(COLORS[i%3], dir); 30 | i++; 31 | dir = !dir; 32 | } 33 | } 34 | void fade(byte Led, boolean dir) 35 | { 36 | int i; 37 | 38 | //if fading up 39 | if (dir) 40 | { 41 | for (i = 0; i < 256; i++) 42 | { 43 | DigisparkRGB(Led, i); 44 | DigisparkRGBDelay(25);//1); 45 | } 46 | } 47 | else 48 | { 49 | for (i = 255; i >= 0; i--) 50 | { 51 | DigisparkRGB(Led, i); 52 | DigisparkRGBDelay(25);//1); 53 | } 54 | } 55 | } 56 | 57 | 58 | 59 | -------------------------------------------------------------------------------- /libraries/DigisparkRGB/keywords.txt: -------------------------------------------------------------------------------- 1 | DigisparkRGBBegin KEYWORD2 2 | DigisparkRGB KEYWORD2 3 | DigisparkRGBDelay KEYWORD2 -------------------------------------------------------------------------------- /libraries/DigisparkRcSeq/keywords.txt: -------------------------------------------------------------------------------- 1 | ############################################ 2 | # Syntax Coloring Map RcSeq 3 | ############################################ 4 | 5 | ############################################ 6 | # Datatypes (KEYWORD1) 7 | ############################################ 8 | RcSeq KEYWORD1 9 | 10 | ############################################ 11 | # Methods and Functions (KEYWORD2) 12 | ############################################ 13 | RcSeq_Init KEYWORD2 14 | RcSeq_DeclareSignal KEYWORD2 15 | RcSeq_SignalTimeout KEYWORD2 16 | RcSeq_DeclareKeyboard KEYWORD2 17 | RcSeq_DeclareClavier KEYWORD2 18 | RcSeq_DeclareStick KEYWORD2 19 | RcSeq_DeclareManche KEYWORD2 20 | RcSeq_DeclareServo KEYWORD2 21 | RcSeq_ServoWrite KEYWORD2 22 | RcSeq_DeclareCustomKeyboard KEYWORD2 23 | RcSeq_DeclareClavierMaison KEYWORD2 24 | RcSeq_DeclareMultiPosSwitch KEYWORD2 25 | RcSeq_DeclareInterMultiPos KEYWORD2 26 | RcSeq_DeclareCommandAndSequence KEYWORD2 27 | RcSeq_DeclareCommandeEtSequence KEYWORD2 28 | RcSeq_DeclareCommandAndShortAction KEYWORD2 29 | RcSeq_DeclareCommandeEtActionCourte KEYWORD2 30 | RcSeq_LaunchSequence KEYWORD2 31 | RcSeq_LanceSequence KEYWORD2 32 | RcSeq_LaunchShortAction KEYWORD2 33 | RcSeq_LanceActionCourte KEYWORD2 34 | RcSeq_Refresh KEYWORD2 35 | RcSeq_Rafraichit KEYWORD2 36 | RcSeq_IsSequenceInProgress KEYWORD2 37 | RcSeq_SequenceEstEnCours KEYWORD2 38 | ############################################ 39 | # Constants (LITERAL1) 40 | ############################################ 41 | SequenceSt_t LITERAL1 42 | KeyMap_t LITERAL1 43 | SHORT_ACTION_TO_PERFORM LITERAL1 44 | ACTION_COURTE_A_EFFECTUER LITERAL1 45 | MOTION_WITH_SOFT_START_AND_STOP LITERAL1 46 | MOTION_WITHOUT_SOFT_START_AND_STOP LITERAL1 47 | MVT_AVEC_DEBUT_ET_FIN_MVT_LENTS LITERAL1 48 | MVT_SANS_DEBUT_ET_FIN_MVT_LENTS LITERAL1 49 | RC_CUSTOM_KEYBOARD LITERAL1 50 | RC_CLAVIER_MAISON LITERAL1 51 | RC_SEQUENCE LITERAL1 52 | CENTER_VALUE_US LITERAL1 53 | VALEUR_CENTRALE_US LITERAL1 54 | RC_SEQ_START_CONDITION LITERAL1 55 | RC_SEQ_CONDITION_DE_DEPART LITERAL1 56 | RC_SEQ_END_OF_SEQ LITERAL1 57 | RC_SEQ_FIN_DE_SEQ LITERAL1 58 | 59 | -------------------------------------------------------------------------------- /libraries/DigisparkSimpleServo/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkSimpleServo/.DS_Store -------------------------------------------------------------------------------- /libraries/DigisparkSimpleServo/README.txt: -------------------------------------------------------------------------------- 1 | ================== 2 | SimpleServo - v0.8 3 | ================== 4 | 5 | "Shh, ya hear that? Me neither… It's simple… Maybe *too* simple…" 6 | 7 | This is a simplistic library to bundle up and generalize bit-banging servo PWM. It has some good points and trade-offs and is primarily being developed for the Digispark. 8 | 9 | First the good: 10 | - Can control any number of servos 11 | - All software, no fancy hardware required 12 | - Produces a relatively clean signal 13 | - Allows (or will) tuning pulse parameters to suit the widely varied tastes of different servos 14 | - A single instance can be used with multiple similar servos 15 | 16 | Now some limitations: 17 | - It can only control one servo at a time 18 | - The program can't do anything else while the servo is being signaled 19 | - Documentation is incomplete (at the moment) 20 | 21 | When typical servos stop receiving a control signal, they stay where they are; while they won't actively hold their position, most require some force to backdrive. So if that's enough for your project, you can move each servo in turn, and sample inputs, set LEDs and such in between. 22 | 23 | ======= 24 | Methods 25 | ======= 26 | 27 | See comments in SimpleServo.h (and SimpleServo.m) for now. 28 | 29 | *(( TODO: Document the additional methods in detail, add an example ))* 30 | 31 | ======= 32 | License 33 | ======= 34 | 35 | The MIT License (MIT) 36 | Copyright (c) 2013 Benjamin Holt 37 | 38 | Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 39 | 40 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 41 | 42 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 43 | -------------------------------------------------------------------------------- /libraries/DigisparkSimpleServo/SimpleServo.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2013 Benjamin Holt 3 | 4 | The MIT License (MIT) - See README for complete license 5 | */ 6 | 7 | #ifndef _SimpleServo_h_ 8 | #define _SimpleServo_h_ 9 | 10 | #include 11 | #include 12 | 13 | class SimpleServo { 14 | private: 15 | // Movement 16 | uint8_t _pin; 17 | uint8_t _degrees; 18 | uint16_t _microseconds; 19 | 20 | // Servo Parameters 21 | // REM: nasty bit about when to constrain vs. not... more below... 22 | uint8_t _maxDegrees; 23 | uint16_t _millisPer60degrees; 24 | uint16_t _minWriteMillis; 25 | uint16_t _maxWriteMillis; 26 | uint16_t _minPulse; 27 | uint16_t _maxPulse; 28 | uint8_t _pulseMillis; 29 | 30 | void _pulse(uint16_t); 31 | 32 | public: 33 | // TODO: update keywords file 34 | // Setup 35 | SimpleServo(); 36 | uint8_t attach(uint8_t); // Note: resets position, but not servo parameters, doesn't signal servo 37 | void detach(); 38 | uint8_t attached(); 39 | 40 | // Movement 41 | void write(uint8_t); 42 | void writeMicroseconds(uint16_t); 43 | uint32_t millisToTarget(uint8_t); // Estimates time from current (expected) position to a target; if millisPer60Degrees is too small, this will come up short and the servo may not reach the target, too large and the write methods may signal longer than needed 44 | void writeMillis(uint8_t, uint16_t); // Allows unconstrained millis 45 | void writeMicrosecondsMillis(uint16_t, uint16_t); // Allows unconstrained microseconds and millis, full manual control 46 | uint8_t read(); 47 | uint16_t readMicroseconds(); 48 | 49 | 50 | // Servo Parameters 51 | void setMaximumDegrees(uint8_t); // A lot of servos move a bit more than 180 52 | void setMillisPer60Degrees(uint16_t); // For estimating time from last set position to newly requested position; different for every servo, http://www.servodatabase.com has many specs, default is 230 from Futaba S3003 53 | void setMinimumMillis(uint16_t); // The smallest time to signal the servo; some write methods do not enforce this 54 | void setMaximumMillis(uint16_t); // This longest time to signal the servo, even if it probably has not yet reached the requested position; some write methods do not enforce this 55 | void setMinimumPulse(uint16_t); // The shortest pulse (in microseconds) to send to the servo, maps to 0deg; only writeMicrosecondsMillis does not enforce this 56 | void setMaximumPulse(uint16_t); // The shortest pulse (in microseconds) to send to the servo, maps to 0deg; only writeMicrosecondsMillis does not enforce this 57 | void setPulseMillis(uint8_t); // Delay between pulses; defaults to 16 which is a bit quicker than spec. Experiment, different servos may react differently 58 | }; 59 | #endif // _SimpleServo_h_ 60 | -------------------------------------------------------------------------------- /libraries/DigisparkSimpleServo/examples/.DS_Store: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkSimpleServo/examples/.DS_Store -------------------------------------------------------------------------------- /libraries/DigisparkSimpleServo/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SimpleServo 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SimpleServo KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | attach KEYWORD2 16 | attached KEYWORD2 17 | detach KEYWORD2 18 | read KEYWORD2 19 | setMaximumPulse KEYWORD2 20 | setMinimumPulse KEYWORD2 21 | write KEYWORD2 22 | writeMillis KEYWORD2 23 | writeMicrosecondsMillis KEYWORD2 24 | 25 | ####################################### 26 | # Constants (LITERAL1) 27 | ####################################### 28 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftRcPulseIn/examples/SoftRcPulseInDemo/SoftRcPulseInDemo.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #ifndef ESP8266 4 | #include 5 | #endif 6 | 7 | #define BROCHE_VOIE1 2 8 | 9 | SoftRcPulseIn ImpulsionVoie1; 10 | 11 | 12 | void setup() 13 | { 14 | #if !defined(__AVR_ATtiny24__) && !defined(__AVR_ATtiny44__) && !defined(__AVR_ATtiny84__) && !defined(__AVR_ATtiny25__) && !defined(__AVR_ATtiny45__) && !defined(__AVR_ATtiny85__) 15 | Serial.begin(9600); 16 | Serial.print(F("SoftRcPulseIn lib V"));Serial.print(SOFT_RC_PULSE_IN_VERSION);Serial.print(F("."));Serial.print(SOFT_RC_PULSE_IN_REVISION);Serial.println(F(" demo")); 17 | #endif 18 | ImpulsionVoie1.attache(BROCHE_VOIE1); 19 | } 20 | 21 | void loop() 22 | { 23 | if(ImpulsionVoie1.disponible()) 24 | { 25 | #if !defined(__AVR_ATtiny24__) && !defined(__AVR_ATtiny44__) && !defined(__AVR_ATtiny84__) && !defined(__AVR_ATtiny25__) && !defined(__AVR_ATtiny45__) && !defined(__AVR_ATtiny85__) 26 | Serial.print("Pulse=");Serial.println(ImpulsionVoie1.largeur_us()); 27 | #endif 28 | } 29 | } 30 | 31 | 32 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftRcPulseIn/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SoftRcPulseIn 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SoftRcPulseIn KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | attach KEYWORD2 15 | attache KEYWORD2 16 | available KEYWORD2 17 | disponible KEYWORD2 18 | timeout KEYWORD2 19 | width_us KEYWORD2 20 | largeur_us KEYWORD2 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | SOFT_RC_PULSE_IN_VERSION LITERAL1 26 | SOFT_RC_PULSE_IN_REVISION LITERAL1 27 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftRcPulseOut/examples/Knob/Knob.ino: -------------------------------------------------------------------------------- 1 | // Controlling a servo position using a potentiometer (variable resistor) 2 | // by Michal Rinott 3 | // Adapted to SoftRcPulseOut library by RC Navy (http://p.loussouarn.free.fr) 4 | // This sketch can work with ATtiny and Arduino UNO, MEGA, etc... 5 | 6 | #include 7 | #include 8 | 9 | SoftRcPulseOut myservo; // create servo object to control a servo 10 | 11 | #if defined(__AVR_ATtiny24__) || defined(__AVR_ATtiny44__) || defined(__AVR_ATtiny84__) || defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) 12 | //Here is the POT_PIN definition for ATtiny, they do NOT need a 'A' prefix for Analogic definition 13 | #define POT_PIN 2 // --analog pin-- (not digital) used to connect the potentiometer 14 | #else 15 | //Here is the POT_PIN definition for Arduino UNO, MEGA, they do need a 'A' prefix for Analogic definition 16 | #define POT_PIN A2 // --analog pin-- (not digital) used to connect the potentiometer 17 | #endif 18 | 19 | #define SERVO_PIN 3 // --digital pin-- (not analog) used to connect the servo 20 | 21 | #define REFRESH_PERIOD_MS 20 22 | 23 | #define NOW 1 24 | 25 | int val; // variable to read the value from the analog pin 26 | 27 | void setup() 28 | { 29 | myservo.attach(SERVO_PIN); // attaches the servo on pin defined by SERVO_PIN to the servo object 30 | } 31 | 32 | void loop() 33 | { 34 | val = analogRead(POT_PIN); // reads the value of the potentiometer (value between 0 and 1023) 35 | val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180) 36 | myservo.write(val); // sets the servo position according to the scaled value 37 | delay(REFRESH_PERIOD_MS); // waits for the servo to get there 38 | SoftRcPulseOut::refresh(NOW); // generates the servo pulse Now 39 | } 40 | 41 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftRcPulseOut/examples/SerialServo/SerialServo.ino: -------------------------------------------------------------------------------- 1 | // This SoftwareServo library example sketch was initially delivered without any comments. 2 | // Below my own comments for SoftRcPulseOut library: by RC Navy (http://p.loussouarn.free.fr) 3 | // Controlling the position of 2 servos using the Arduino built-in hardware UART (Arduino Serial object). 4 | // This sketch do NOT work with an ATtinyX4 and ATtinyX5 since they do not have a built-in harware UART (no Arduino Serial object). 5 | 6 | // The command (issued in the Arduino Serial Console or in a Terminal) is: 7 | // S=P with: 8 | // S=A for Servo1 and S=B for Servo2 9 | // P=Position number x 20° (Possible positions are from 0 to 9 which correspond to from 0° to 180°) 10 | // Ex: 11 | // A=7 sets Servo1 at 7 x 20 =140° 12 | // B=3 sets Servo2 at 3 x 20 =60° 13 | 14 | #include 15 | #include 16 | 17 | SoftRcPulseOut servo1; 18 | SoftRcPulseOut servo2; 19 | 20 | void setup() 21 | { 22 | pinMode(13,OUTPUT); 23 | servo1.attach(2); 24 | servo1.setMaximumPulse(2200); 25 | servo2.attach(4); 26 | servo2.setMaximumPulse(2200); 27 | Serial.begin(9600); 28 | Serial.print("Ready"); 29 | } 30 | 31 | void loop() 32 | { 33 | static int value = 0; 34 | static char CurrentServo = 0; 35 | 36 | if ( Serial.available()) { 37 | char ch = Serial.read(); 38 | switch(ch) { 39 | case 'A': 40 | CurrentServo='A'; 41 | digitalWrite(13,LOW); 42 | break; 43 | case 'B': 44 | CurrentServo='B'; 45 | digitalWrite(13,HIGH); 46 | break; 47 | case '0' ... '9': 48 | value=(ch-'0')*20; 49 | if (CurrentServo=='A') 50 | { 51 | servo1.write(value); 52 | } 53 | else if (CurrentServo=='B') 54 | { 55 | servo2.write(value); 56 | } 57 | break; 58 | } 59 | } 60 | SoftRcPulseOut::refresh(); 61 | } 62 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftRcPulseOut/examples/Sweep/Sweep.ino: -------------------------------------------------------------------------------- 1 | // Sweep 2 | // by BARRAGAN 3 | // Adapted to SoftRcPulseOut library by RC Navy (http://p.loussouarn.free.fr) 4 | // This sketch can work with ATtiny and Arduino UNO, MEGA, etc... 5 | // This example code is in the public domain. 6 | 7 | #include 8 | #include 9 | 10 | SoftRcPulseOut myservo; // create servo object to control a servo 11 | // a maximum of eight servo objects can be created 12 | #define SERVO_PIN 3 13 | 14 | #define REFRESH_PERIOD_MS 20 15 | 16 | #define NOW 1 17 | 18 | int pos = 0; // variable to store the servo position 19 | 20 | void setup() 21 | { 22 | myservo.attach(SERVO_PIN); // attaches the servo on pin defined by SERVO_PIN to the servo object 23 | } 24 | 25 | 26 | void loop() 27 | { 28 | for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees 29 | { // in steps of 1 degree 30 | myservo.write(pos); // tell servo to go to position in variable 'pos' 31 | delay(REFRESH_PERIOD_MS); // waits 20ms for refresh period 32 | SoftRcPulseOut::refresh(NOW); // generates the servo pulse Now 33 | } 34 | for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees 35 | { 36 | myservo.write(pos); // tell servo to go to position in variable 'pos' 37 | delay(REFRESH_PERIOD_MS); // waits 20ms for for refresh period 38 | SoftRcPulseOut::refresh(NOW); // generates the servo pulse Now 39 | } 40 | } 41 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftRcPulseOut/examples/SweepNoDelay/SweepNoDelay.ino: -------------------------------------------------------------------------------- 1 | // SweepNoDelay 2 | // by RC Navy (http://p.loussouarn.free.fr/arduino/arduino.html>) 3 | // This sketch can work with ATtiny and Arduino UNO, MEGA, etc... 4 | // This example code is in the public domain. 5 | 6 | #include 7 | #include 8 | 9 | SoftRcPulseOut myservo; // create servo object to control a servo 10 | // a maximum of eight servo objects can be created 11 | #define SERVO_PIN 0 12 | 13 | #define UP_DIRECTION +1 14 | #define DOWN_DIRECTION -1 15 | 16 | #define POS_MIN 0 17 | #define POS_MAX 180 18 | 19 | int pos = POS_MIN; // variable to store the servo position 20 | int step = UP_DIRECTION; 21 | 22 | void setup() 23 | { 24 | myservo.attach(SERVO_PIN); // attaches the servo on pin defined by SERVO_PIN to the servo object 25 | myservo.write(pos); 26 | } 27 | 28 | void loop() 29 | { 30 | if (SoftRcPulseOut::refresh()) // refresh() returns 1 every 20ms (after pulse update) 31 | { 32 | // We arrive here every 20ms 33 | pos += step; 34 | if(pos >= POS_MAX) step = DOWN_DIRECTION; //180 degrees reached -> Change direction 35 | if(pos <= POS_MIN) step = UP_DIRECTION; // 0 degrees reached -> Change direction 36 | myservo.write(pos); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftRcPulseOut/examples/Usb2Servos/Usb2Servos.ino: -------------------------------------------------------------------------------- 1 | // This sketch demonstrates how to command 2 servos through the USB of the Digispark. 2 | // It uses: 3 | // - library to easily generates the RC pulses for the servos. 4 | // - library to communicate with the PC 5 | // By RC Navy (http://p.loussouarn.free.fr) 6 | 7 | // The command (issued in the DigiUSB Monitor or the digiterm) is: 8 | // S=P with: 9 | // S=A for ServoA and S=B for ServoB 10 | // P=Position number x 20° (Possible positions are from 0 to 9 which correspond to from 0° to 180°) 11 | // Ex: 12 | // A=7 sets Servo1 at 7 x 20 =140° 13 | // B=3 sets Servo2 at 3 x 20 =60° 14 | // Once the servo selected, just type the value between 0 and 9 15 | // Please, note this sketch is derived from the SerialServo example of library. 16 | 17 | #include 18 | #include 19 | #include 20 | 21 | #define LED_PIN 1 /* Builtin Led on Rev2 ModelA Digispark */ 22 | #define SERVO_A_PIN 2 23 | /* /!\ Do not use Pin 3 (used by USB) /!\ */ 24 | /* /!\ Do not use Pin 4 (used by USB) /!\ */ 25 | #define SERVO_B_PIN 5 26 | 27 | SoftRcPulseOut ServoA; 28 | SoftRcPulseOut ServoB; 29 | 30 | 31 | void setup() 32 | { 33 | pinMode(LED_PIN,OUTPUT); 34 | ServoA.attach(SERVO_A_PIN); 35 | ServoB.attach(SERVO_B_PIN); 36 | DigiUSB.begin(); 37 | DigiUSB.println(" Ready"); 38 | } 39 | 40 | void loop() 41 | { 42 | static int value = 0; 43 | static char CurrentServo = 0; 44 | 45 | if ( DigiUSB.available()) { 46 | char ch = DigiUSB.read(); 47 | switch(ch) { 48 | case 'A': 49 | CurrentServo='A'; 50 | digitalWrite(LED_PIN,LOW); 51 | break; 52 | case 'B': 53 | CurrentServo='B'; 54 | digitalWrite(LED_PIN,HIGH); 55 | break; 56 | case '0' ... '9': 57 | value=(ch-'0')*20; 58 | if (CurrentServo=='A') 59 | { 60 | ServoA.write(value); 61 | } 62 | else if (CurrentServo=='B') 63 | { 64 | ServoB.write(value); 65 | } 66 | break; 67 | } 68 | } 69 | DigiUSB.refresh(); 70 | SoftRcPulseOut::refresh(); 71 | /* 72 | Put here your non-blocking code 73 | */ 74 | } 75 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftRcPulseOut/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SoftRcPulseOut 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SoftRcPulseOut KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | attach KEYWORD2 15 | attache KEYWORD2 16 | detach KEYWORD2 17 | detache KEYWORD2 18 | write KEYWORD2 19 | ecrit KEYWORD2 20 | write_us KEYWORD2 21 | ecrit_us KEYWORD2 22 | read KEYWORD2 23 | lit KEYWORD2 24 | read_us KEYWORD2 25 | lit_us KEYWORD2 26 | attached KEYWORD2 27 | estAttache KEYWORD2 28 | setMinimumPulse KEYWORD2 29 | definitImpulsionMinimum KEYWORD2 30 | setMaximumPulse KEYWORD2 31 | definitImpulsionMaximum KEYWORD2 32 | refresh KEYWORD2 33 | rafraichit KEYWORD2 34 | createInstance KEYWORD2 35 | createdInstanceNb KEYWORD2 36 | softRcPulseOutById KEYWORD2 37 | getIdByPin KEYWORD2 38 | destroyInstance KEYWORD2 39 | 40 | ####################################### 41 | # Constants (LITERAL1) 42 | ####################################### 43 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftSerial/Readme.md: -------------------------------------------------------------------------------- 1 | SoftSerial library 2 | ================== 3 | 4 | The **SoftSerial** library is exactly the same as the **SoftwareSerial** library but used with the **TinyPinChange** library which allows to share 5 | the "Pin Change Interrupt" Vector. 6 | 7 | **SoftwareSerial** monopolizes the Pin Change Interrupt Vector and do not allow sharing. 8 | 9 | With **SoftSerial**, it's possible. Don't forget to #include **TinyPinChange** in your sketch! 10 | 11 | Additionally, for small devices such as **ATtiny85** (Digispark), it's possible to declare **the same pin for TX and RX**. 12 | Data direction is set by using the new **txMode()** and **rxMode()** methods. 13 | 14 | Some examples of use cases: 15 | ------------------------- 16 | * **half-duplex bi-directional serial port on a single wire for debuging purpose** 17 | * **half-duplex serial port to interface with Bluetooth module** 18 | * **half-duplex serial port to interconnect an arduino with another one** 19 | 20 | Supported Arduinos: 21 | ------------------ 22 | * **ATmega368 (UNO)** 23 | * **ATmega2560 (MEGA)** 24 | * **ATtiny84 (Standalone)** 25 | * **ATtiny85 (Standalone or Digispark)** 26 | * **ATtiny167 (Digispark pro)** 27 | 28 | Tip and Tricks: 29 | -------------- 30 | Develop your project on an arduino UNO or MEGA, and then shrink it by loading the sketch in an ATtiny or Digispark (pro). 31 | 32 | API/methods: 33 | ----------- 34 | * The **SoftSerial** library uses the same API as the regular **SoftwareSerial** library: 35 | * begin() 36 | * end() 37 | * available() 38 | * read() 39 | * listen() 40 | * isListening() 41 | * overflow() 42 | * flush() 43 | 44 | * Two additional methods are used to manage the serial port on a single pin: 45 | * txMode() 46 | * rxMode() 47 | 48 | Design considerations: 49 | --------------------- 50 | The **SoftSerial** library relies the **TinyPinChange** library **for the RX pin**. This one shall be included in the sketch as well. 51 | 52 | On the arduino MEGA, as all the pins do not support "pin change interrupt", only the following pins are supported **for the RX pin**: 53 | 54 | * 10 -> 15 55 | * 50 -> 53 56 | * A8 -> A15 57 | 58 | On other devices (ATmega328, ATtiny84, ATtiny85 and ATtiny167), all the pins are usable. 59 | 60 | Contact 61 | ------- 62 | 63 | If you have some ideas of enhancement, please contact me by clicking on: [RC Navy](http://p.loussouarn.free.fr/contact.html). 64 | 65 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftSerial/examples/SoftSerialExample/SoftSerialExample.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Software serial multiple serial test 3 | 4 | Receives from the hardware serial, sends to software serial. 5 | Receives from software serial, sends to hardware serial. 6 | 7 | The circuit: 8 | * RX is digital pin 2 (connect to TX of other device) 9 | * TX is digital pin 3 (connect to RX of other device) 10 | 11 | created back in the mists of time 12 | modified 9 Apr 2012 13 | by Tom Igoe 14 | based on Mikal Hart's example 15 | 16 | This example code is in the public domain. 17 | 18 | adapted from for library which allows sharing the Pin Change Interrupt Vector. 19 | Single difference with : add #include at the top of your sketch. 20 | RC Navy (2012): http://p.loussouarn.free.fr 21 | 22 | */ 23 | #include /* Allows Pin Change Interrupt Vector Sharing */ 24 | #include /* Ne pas oublier d'inclure la librairie qui est utilisee par la librairie */ 25 | 26 | SoftSerial mySerial(2, 3); // RX, TX 27 | 28 | void setup() 29 | { 30 | // Open serial communications and wait for port to open: 31 | Serial.begin(57600); 32 | while (!Serial) { 33 | ; // wait for serial port to connect. Needed for Leonardo only 34 | } 35 | 36 | 37 | Serial.println("Goodnight moon!"); 38 | 39 | // set the data rate for the SoftwareSerial port 40 | mySerial.begin(4800); 41 | mySerial.println("Hello, world?"); 42 | } 43 | 44 | void loop() // run over and over 45 | { 46 | if (mySerial.available()) 47 | Serial.write(mySerial.read()); 48 | if (Serial.available()) 49 | mySerial.write(Serial.read()); 50 | } 51 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftSerial/examples/TwoPortReceive/TwoPortReceive.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Software serial multple serial test 3 | 4 | Receives from the two software serial ports, 5 | sends to the hardware serial port. 6 | 7 | In order to listen on a software port, you call port.listen(). 8 | When using two software serial ports, you have to switch ports 9 | by listen()ing on each one in turn. Pick a logical time to switch 10 | ports, like the end of an expected transmission, or when the 11 | buffer is empty. This example switches ports when there is nothing 12 | more to read from a port 13 | 14 | The circuit: 15 | Two devices which communicate serially are needed. 16 | * First serial device's TX attached to digital pin 2, RX to pin 3 17 | * Second serial device's TX attached to digital pin 4, RX to pin 5 18 | 19 | created 18 Apr. 2011 20 | modified 9 Apr 2012 21 | by Tom Igoe 22 | based on Mikal Hart's twoPortRXExample 23 | 24 | This example code is in the public domain. 25 | 26 | */ 27 | 28 | #include 29 | #include /* Ne pas oublier d'inclure la librairie qui est utilisee par la librairie */ 30 | 31 | // software serial #1: TX = digital pin 2, RX = digital pin 3 32 | SoftSerial portOne(2, 3); 33 | 34 | // software serial #2: TX = digital pin 4, RX = digital pin 5 35 | SoftSerial portTwo(4, 5); 36 | 37 | void setup() 38 | { 39 | // Open serial communications and wait for port to open: 40 | Serial.begin(9600); 41 | while (!Serial) { 42 | ; // wait for serial port to connect. Needed for Leonardo only 43 | } 44 | 45 | 46 | // Start each software serial port 47 | portOne.begin(9600); 48 | portTwo.begin(9600); 49 | } 50 | 51 | void loop() 52 | { 53 | // By default, the last intialized port is listening. 54 | // when you want to listen on a port, explicitly select it: 55 | portOne.listen(); 56 | Serial.println("Data from port one:"); 57 | // while there is data coming in, read it 58 | // and send to the hardware serial port: 59 | while (portOne.available() > 0) { 60 | char inByte = portOne.read(); 61 | Serial.write(inByte); 62 | } 63 | 64 | // blank line to separate data from the two ports: 65 | Serial.println(); 66 | 67 | // Now listen on the second port 68 | portTwo.listen(); 69 | // while there is data coming in, read it 70 | // and send to the hardware serial port: 71 | Serial.println("Data from port two:"); 72 | while (portTwo.available() > 0) { 73 | char inByte = portTwo.read(); 74 | Serial.write(inByte); 75 | } 76 | 77 | // blank line to separate data from the two ports: 78 | Serial.println(); 79 | } 80 | 81 | 82 | 83 | 84 | 85 | 86 | -------------------------------------------------------------------------------- /libraries/DigisparkSoftSerial/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map for SoftSerial 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SoftSerial KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | end KEYWORD2 17 | read KEYWORD2 18 | available KEYWORD2 19 | isListening KEYWORD2 20 | overflow KEYWORD2 21 | flush KEYWORD2 22 | listen KEYWORD2 23 | txMode KEYWORD2 24 | rxMode KEYWORD2 25 | 26 | ####################################### 27 | # Constants (LITERAL1) 28 | ####################################### 29 | 30 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyCppmGen/examples/TinyCppmGenSweep/TinyCppmGenSweep.ino: -------------------------------------------------------------------------------- 1 | /* 2 | TinyCppmGenSweep sketch 3 | by RC Navy (http://p.loussouarn.free.fr/arduino/arduino.html) 2015 4 | This sketch generates an RC CPPM frame transporting 4 RC channels. 5 | The 3 first channels have fixed pulse width (tunable), and the 4th channel sweeps between 1000 and 2000 us. 6 | It can be extended up to 8 RC channels. 7 | This sketch can work with a Digispark pro, Digispark, Arduino Leonardo, Arduino Micro, Arduino Pro Micro and Arduino UNO. 8 | 9 | PPM output pin is imposed by hardware and is target dependant: 10 | (The user has to define Timer and Channel to use in TinyCppmGen.h file of the library) 11 | 12 | - ATtiny167 (Digispark pro): 13 | TIMER(0), CHANNEL(A) -> OC0A -> PA2 -> Pin#8 14 | 15 | - ATtiny85 (Digispark): 16 | TIMER(0), CHANNEL(A) -> OC0A -> PB0 -> Pin#0 17 | TIMER(0), CHANNEL(B) -> OC0B -> PB1 -> Pin#1 18 | TIMER(1), CHANNEL(A) -> OC1A -> PB1 -> Pin#1 19 | 20 | - ATtiny84 (Ext. Clock. 16MHz) -> Fuses: LF:0xFE, HF:0xDF, EF: 0xFF 21 | TIMER(0), CHANNEL(A) -> OC0A -> PB2 -> Pin#5 | Digital 8 : D8 22 | TIMER(0), CHANNEL(B) -> OC0B -> PA7 -> Pin#6 | Digital 7 : D7 23 | 24 | - ATmega328P (Arduino UNO): 25 | TIMER(0), CHANNEL(A) -> OC0A -> PD6 -> Pin#6 26 | TIMER(0), CHANNEL(B) -> OC0B -> PD5 -> Pin#5 27 | TIMER(2), CHANNEL(A) -> OC2A -> PB3 -> Pin#11 28 | TIMER(2), CHANNEL(B) -> OC2B -> PD3 -> Pin#3 29 | 30 | - ATmega32U4 (Arduino Leonardo, Micro and Pro Micro): 31 | TIMER(0), CHANNEL(A) -> OC0A -> PB7 -> Pin#11 (/!\ pin not available on connector of Pro Micro /!\) 32 | TIMER(0), CHANNEL(B) -> OC0B -> PD0 -> Pin#3 33 | 34 | This example code is in the public domain. 35 | */ 36 | #include 37 | #include 38 | 39 | #define CH_MAX_NB 4 40 | 41 | #define STEP_US 5 42 | 43 | #define PULSE_WIDTH_MIN_US 1000 44 | #define PULSE_WIDTH_MAX_US 2000 45 | #define CPPM_PERIOD_US 20000 46 | 47 | uint16_t Width_us = PULSE_WIDTH_MAX_US; 48 | uint16_t Step_us = STEP_US; 49 | 50 | void setup() 51 | { 52 | TinyCppmGen.begin(TINY_CPPM_GEN_POS_MOD, CH_MAX_NB, CPPM_PERIOD_US); /* Change CTINY_PPM_GEN_POS_MOD to TINY_CPPM_GEN_NEG_MOD for NEGative CPPM modulation */ 53 | TinyCppmGen.setChWidth_us(1, 500); /* RC Channel#1 */ 54 | TinyCppmGen.setChWidth_us(2, 1000); /* RC Channel#2 */ 55 | TinyCppmGen.setChWidth_us(3, 1500); /* RC Channel#3 */ 56 | TinyCppmGen.setChWidth_us(4, 2000); /* RC Channel#4 */ 57 | } 58 | 59 | void loop() 60 | { 61 | TinyCppmGen.setChWidth_us(CH_MAX_NB, Width_us); /* Sweep RC Channel#4 */ 62 | Width_us += Step_us; 63 | if(Width_us > PULSE_WIDTH_MAX_US) Step_us = -STEP_US; 64 | if(Width_us < PULSE_WIDTH_MIN_US) Step_us = +STEP_US; 65 | delay(10); 66 | } 67 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyCppmGen/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map TinyCppmGen 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | TinyCppmGen KEYWORD1 9 | 10 | ####################################### 11 | # Methods and Functions (KEYWORD2) 12 | ####################################### 13 | begin KEYWORD2 14 | setChWidth_us KEYWORD2 15 | isSynchro KEYWORD2 16 | suspend KEYWORD2 17 | resume KEYWORD2 18 | 19 | ####################################### 20 | # Constants (LITERAL1) 21 | ####################################### 22 | TINY_CPPM_GEN_POS_MOD LITERAL1 23 | TINY_CPPM_GEN_NEG_MOD LITERAL1 24 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyCppmReader/TinyCppmReader.h: -------------------------------------------------------------------------------- 1 | #ifndef TINY_CPPM_READER 2 | #define TINY_CPPM_READER 1 3 | /* A tiny interrupt driven RC CPPM frame reader library using pin change interrupt 4 | Features: 5 | - Uses any input supporting interrupt pin change 6 | - Supported devices: see TinyPinChange library 7 | - Positive and negative CPPM modulation supported (don't care) 8 | - Up to 9 RC channels supported 9 | RC Navy 2015 10 | http://p.loussouarn.free.fr 11 | 01/02/2015: Creation 12 | 06/04/2015: Rcul support added (allows to create a virtual serial port over a CPPM channel) 13 | 09/11/2015: No need to create the TinyCppmReader object anymore, unused _PinMask variable removed 14 | 23/03/2020: Multi instance support added (Now, the object(s) shall be created) 15 | */ 16 | #include 17 | #include 18 | #include 19 | 20 | #define TINY_CPPM_READER_CH_MAX 9 21 | 22 | /* Public function prototypes */ 23 | class TinyCppmReader : public Rcul 24 | { 25 | public: 26 | TinyCppmReader(); 27 | static uint8_t attach(uint8_t CppmInputPin); 28 | static uint8_t detach(void); 29 | static uint8_t detectedChannelNb(void); 30 | static uint16_t width_us(uint8_t Ch); 31 | static uint16_t cppmPeriod_us(void); 32 | static uint8_t isSynchro(uint8_t ClientIdx = 7); /* Default value: 8th Synchro client -> 0 to 6 free for other clients*/ 33 | static void suspend(void); 34 | static void resume(void); 35 | static void rcChannelCollectorIsr(void); 36 | /* Rcul support */ 37 | virtual uint8_t RculIsSynchro(uint8_t ClientIdx = RCUL_DEFAULT_CLIENT_IDX); 38 | virtual uint16_t RculGetWidth_us(uint8_t Ch); 39 | virtual void RculSetWidth_us(uint16_t Width_us, uint8_t Ch = RCUL_NO_CH); 40 | private: 41 | // static data 42 | }; 43 | 44 | #endif 45 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyCppmReader/examples/RcCppmChSubst/RcCppmChSubst.ino: -------------------------------------------------------------------------------- 1 | /* 2 | RcPpmChSubst sketch 3 | by RC Navy (http://p.loussouarn.free.fr/arduino/arduino.html) 2015 4 | This sketch reads an RC PPM frame, extracts the numbers of channels and their pulse witdhs and substitutes the 4th channel with a fix pulse width (2000 us). 5 | 6 | .----------------. .---------------. 7 | | Trainer Output |-->| TinyPpmReader | 8 | | | '---------------' 9 | | | | 10 | | RC Transmitter | | Forward channels 1 to 3 and set 4th channel width to 2000 us 11 | | | V 12 | | | .---------------. 13 | | Trainer Intput |<--| TinyPpmGen | 14 | '----------------' '---------------' 15 | 16 | This sketch can work with a Digispark pro, Digispark and Arduino UNO. 17 | The PPM input shall support pin change interrupt. 18 | 19 | PPM output pin is imposed by hardware and is target dependant: 20 | (The user has to define Timer and Channel to use in TinyPpmGen.h file of the library) 21 | - ATtiny167 (Digispark pro): 22 | TIMER(0), CHANNEL(A) -> OC0A -> PA2 -> Pin#8 23 | 24 | - ATtiny85 (Digispark): 25 | TIMER(0), CHANNEL(A) -> OC0A -> PB0 -> Pin#0 26 | TIMER(0), CHANNEL(B) -> OC0B -> PB1 -> Pin#1 27 | TIMER(1), CHANNEL(A) -> OC1A -> PB1 -> Pin#1 28 | 29 | - ATmega328P (Arduino UNO): 30 | TIMER(0), CHANNEL(A) -> OC0A -> PD6 -> Pin#6 31 | TIMER(0), CHANNEL(B) -> OC0B -> PD5 -> Pin#5 32 | TIMER(2), CHANNEL(A) -> OC2A -> PB3 -> Pin#11 33 | TIMER(2), CHANNEL(B) -> OC2B -> PD3 -> Pin#3 34 | This example code is in the public domain. 35 | */ 36 | #include 37 | 38 | #include 39 | #include 40 | 41 | #include 42 | 43 | #define CPPM_INPUT_PIN 2 44 | #define CHANNEL_NB 4 45 | 46 | TinyCppmReader TinyCppmReader; // Object creation 47 | 48 | void setup() 49 | { 50 | TinyCppmReader::attach(CPPM_INPUT_PIN); /* Attach TinyPpmReader to CPPM_INPUT_PIN pin */ 51 | TinyCppmGen.begin(TINY_CPPM_GEN_POS_MOD, CHANNEL_NB); /* Change TINY_CPPM_GEN_POS_MOD to TINY_CPPM_GEN_NEG_MOD for NEGative PPM modulation */ 52 | } 53 | 54 | void loop() 55 | { 56 | if((TinyCppmReader::detectedChannelNb() >= CHANNEL_NB) && TinyCppmReader::isSynchro()) 57 | { 58 | TinyCppmGen.setChWidth_us(1, TinyCppmReader::width_us(1)); /* RC Channel#1: forward rx value */ 59 | TinyCppmGen.setChWidth_us(2, TinyCppmReader::width_us(2)); /* RC Channel#2: forward rx value */ 60 | TinyCppmGen.setChWidth_us(3, TinyCppmReader::width_us(3)); /* RC Channel#3 forward rx value: */ 61 | TinyCppmGen.setChWidth_us(4, 2000); /* RC Channel#4: replace rx pulse width with 2000 us */ 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyCppmReader/examples/RcCppmReader/RcCppmReader.ino: -------------------------------------------------------------------------------- 1 | /* 2 | RcPpmReader sketch 3 | by RC Navy (http://p.loussouarn.free.fr/arduino/arduino.html) 2015 4 | This sketch reads an RC PPM frame extracts the numbers of channels and their pulse witdhs. 5 | This sketch can work with a Digispark pro, Digispark, Arduino UNO... 6 | The PPM input shall support pin change interrupt. 7 | This example code is in the public domain. 8 | */ 9 | #include 10 | #include 11 | #include 12 | 13 | #define CPPM_INPUT_PIN 2 14 | 15 | TinyCppmReader TinyCppmReader; // Object creation 16 | 17 | void setup() 18 | { 19 | Serial.begin(115200); 20 | TinyCppmReader::attach(CPPM_INPUT_PIN); /* Attach TinyPpmReader to CPPM_INPUT_PIN pin */ 21 | } 22 | 23 | void loop() 24 | { 25 | TinyCppmReader::suspend(); /* Not needed if an hardware serial is used to display results */ 26 | Serial.print(F("* Period="));Serial.print((int)TinyCppmReader::cppmPeriod_us());Serial.println(F(" us *")); 27 | Serial.print(F("ChNb="));Serial.println((int)TinyCppmReader::detectedChannelNb()); 28 | for(uint8_t Idx = 1; Idx <= TinyCppmReader::detectedChannelNb(); Idx++) /* From Channel 1 to Max detected */ 29 | { 30 | Serial.print(F("Ch"));Serial.print(Idx);Serial.print(F("="));Serial.print(TinyCppmReader::width_us(Idx));Serial.println(F(" us")); 31 | } 32 | TinyCppmReader::resume(); /* Not needed if an hardware serial is used to display results */ 33 | delay(500); 34 | } 35 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyCppmReader/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map TinyCppmReader 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | TinyCppmReader KEYWORD1 9 | 10 | ####################################### 11 | # Methods and Functions (KEYWORD2) 12 | ####################################### 13 | attach KEYWORD2 14 | detach KEYWORD2 15 | detectedChannelNb KEYWORD2 16 | width_us KEYWORD2 17 | ppmPeriod_us KEYWORD2 18 | isSynchro KEYWORD2 19 | suspend KEYWORD2 20 | resume KEYWORD2 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyPinChange/Readme.md: -------------------------------------------------------------------------------- 1 | TinyPinChange library 2 | ===================== 3 | 4 | **TinyPinChange** is an asynchronous (interrupt-driven) library designed to detect event (rising or falling edege) on pins. 5 | 6 | Very often in the arduino world, users complain about conflicts between libraries. 7 | 8 | This **TinyPinChange** library allows to share the "pin change interrupt" vector for several "clients". 9 | 10 | For example, it's possible to use the **SoftRcPulseIn** library whilst using the **SoftSerial** library: both libraries rely on the **TinyPinChange** library. 11 | 12 | Some examples of use cases: 13 | ------------------------- 14 | * **Event detector** (on pins) 15 | * **Frequency meter** 16 | * **Pulse width meter** 17 | * **Tachometer** 18 | * **Duty cycle measurement** 19 | * **Software serial port** (see **SoftSerial** library which relies on TinyPinChange) 20 | 21 | Supported Arduinos: 22 | ------------------ 23 | * **ATmega368 (UNO)** 24 | * **ATmega2560 (MEGA)** 25 | * **ATtiny84 (Standalone)** 26 | * **ATtiny85 (Standalone or Digispark)** 27 | * **ATtiny167 (Digispark pro)** 28 | * **ATmega32U4 (Leonardo, Micro, Pro Micro)** 29 | 30 | Tip and Tricks: 31 | -------------- 32 | Develop your project on an arduino UNO or MEGA, and then shrink it by loading the sketch in an ATtiny or Digispark (pro). 33 | 34 | API/methods: 35 | ----------- 36 | * TinyPinChange_Init() 37 | * TinyPinChange_RegisterIsr() 38 | * TinyPinChange_EnablePin() 39 | * TinyPinChange_DisablePin() 40 | * TinyPinChange_GetPortEvent() 41 | * TinyPinChange_GetCurPortSt() 42 | * TinyPinChange_PinToMsk() 43 | * TinyPinChange_Edge() 44 | * TinyPinChange_RisingEdge 45 | * TinyPinChange_FallingEdge 46 | 47 | Design considerations: 48 | --------------------- 49 | On the arduino MEGA (ATmega2560), as all the pins do not support "pin change interrupt", only the following pins are supported: 50 | 51 | * 10 -> 15 52 | * 50 -> 53 53 | * A8 -> A15 54 | 55 | On the arduino Lenardo, Micro and Pro Micro (ATmega32U4), as all the pins do not support "pin change interrupt", only the following pins are supported: 56 | 57 | * 0 -> 3 (external INT0, INT1, INT2 and INT3 are used as emulated Pin Change Interrupt) 58 | * 8 -> 11 (pin 11 is not available on the connector) 59 | * 14 -> 17 (pin 17 is not available on the connector) 60 | 61 | On other devices (ATmega328, ATtiny84, ATtiny85 and ATtiny167), all the pins are usable. 62 | 63 | Contact 64 | ------- 65 | 66 | If you have some ideas of enhancement, please contact me by clicking on: [RC Navy](http://p.loussouarn.free.fr/contact.html). 67 | 68 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyPinChange/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map TinyPinChange 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | TinyPinChange KEYWORD1 9 | 10 | ####################################### 11 | # Methods and Functions (KEYWORD2) 12 | ####################################### 13 | TinyPinChange_Init KEYWORD2 14 | TinyPinChange_RegisterIsr KEYWORD2 15 | TinyPinChange_EnregistreFonctionInterruption KEYWORD2 16 | TinyPinChange_EnablePin KEYWORD2 17 | TinyPinChange_ActiveBroche KEYWORD2 18 | TinyPinChange_DisablePin KEYWORD2 19 | TinyPinChange_DesactiveBroche KEYWORD2 20 | TinyPinChange_GetPortEvent KEYWORD2 21 | TinyPinChange_RetourneEvenemenPort KEYWORD2 22 | TinyPinChange_GetCurPortSt KEYWORD2 23 | TinyPinChange_RetourneEtatCourantPort KEYWORD2 24 | TinyPinChange_PinToMsk KEYWORD2 25 | TinyPinChange_MasqueDeBroche KEYWORD2 26 | TinyPinChange_Edge KEYWORD2 27 | TinyPinChange_Front KEYWORD2 28 | TinyPinChange_RisingEdge KEYWORD2 29 | TinyPinChange_FrontMontant KEYWORD2 30 | TinyPinChange_FallingEdge KEYWORD2 31 | TinyPinChange_FrontDescendant KEYWORD2 32 | 33 | ####################################### 34 | # Constants (LITERAL1) 35 | ####################################### 36 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyRTClib/README.md: -------------------------------------------------------------------------------- 1 | TinyRTClib 2 | ========== 3 | 4 | DS1307's Arduino Adafruit library modified to run on Digispark's attiny85. 5 | 6 | I've searched everywhere for a DS1307 library that could work on my Digispark but found none. 7 | 8 | This is the Adafruit version (https://github.com/adafruit/RTClib) with their examples modified to work on Digispark's attiny85. 9 | 10 | **I'm unable to push the files into the right folders by now. That's why I've them renamed to the folders name and slashs... 11 | **Will try to add to the right place later. 12 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyRTClib/TinyRTClib.h: -------------------------------------------------------------------------------- 1 | // Code by JeeLabs http://news.jeelabs.org/code/ 2 | // Released to the public domain! Enjoy! 3 | 4 | // --Refactored by nGoline http://arduino.ngoline.com 5 | // --to fit Digispark and the attiny85 6 | 7 | // Simple general-purpose date/time class (no TZ / DST / leap second handling!) 8 | class DateTime { 9 | public: 10 | DateTime (uint32_t t =0); 11 | DateTime (uint16_t year, uint8_t month, uint8_t day, 12 | uint8_t hour =0, uint8_t min =0, uint8_t sec =0); 13 | DateTime (const char* date, const char* time); 14 | uint16_t year() const { return 2000 + yOff; } 15 | uint8_t month() const { return m; } 16 | uint8_t day() const { return d; } 17 | uint8_t hour() const { return hh; } 18 | uint8_t minute() const { return mm; } 19 | uint8_t second() const { return ss; } 20 | uint8_t dayOfWeek() const; 21 | 22 | // 32-bit times as seconds since 1/1/2000 23 | long secondstime() const; 24 | // 32-bit times as seconds since 1/1/1970 25 | uint32_t unixtime(void) const; 26 | 27 | protected: 28 | uint8_t yOff, m, d, hh, mm, ss; 29 | }; 30 | 31 | // RTC based on the DS1307 chip connected via I2C and the Wire library 32 | // -- Now using the TinyWireM library 33 | class RTC_DS1307 { 34 | public: 35 | static uint8_t begin(void); 36 | static void adjust(const DateTime& dt); 37 | uint8_t isrunning(void); 38 | static DateTime now(); 39 | }; 40 | 41 | // RTC using the internal millis() clock, has to be initialized before use 42 | // NOTE: this clock won't be correct once the millis() timer rolls over (>49d?) 43 | class RTC_Millis { 44 | public: 45 | static void begin(const DateTime& dt) { adjust(dt); } 46 | static void adjust(const DateTime& dt); 47 | static DateTime now(); 48 | 49 | protected: 50 | static long offset; 51 | }; 52 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyRTClib/examples/datecalc/datecalc.pde: -------------------------------------------------------------------------------- 1 | // Simple date conversions and calculations 2 | 3 | #include 4 | #include "TinyRTClib.h" 5 | 6 | void showDate(const char* txt, const DateTime& dt) { 7 | Serial.print(txt); 8 | Serial.print(' '); 9 | Serial.print(dt.year(), DEC); 10 | Serial.print('/'); 11 | Serial.print(dt.month(), DEC); 12 | Serial.print('/'); 13 | Serial.print(dt.day(), DEC); 14 | Serial.print(' '); 15 | Serial.print(dt.hour(), DEC); 16 | Serial.print(':'); 17 | Serial.print(dt.minute(), DEC); 18 | Serial.print(':'); 19 | Serial.print(dt.second(), DEC); 20 | 21 | Serial.print(" = "); 22 | Serial.print(dt.unixtime()); 23 | Serial.print("s / "); 24 | Serial.print(dt.unixtime() / 86400L); 25 | Serial.print("d since 1970"); 26 | 27 | Serial.println(); 28 | } 29 | 30 | void setup () { 31 | Serial.begin(115200); 32 | 33 | DateTime dt0 (0, 1, 1, 0, 0, 0); 34 | showDate("dt0", dt0); 35 | 36 | DateTime dt1 (1, 1, 1, 0, 0, 0); 37 | showDate("dt1", dt1); 38 | 39 | DateTime dt2 (2009, 1, 1, 0, 0, 0); 40 | showDate("dt2", dt2); 41 | 42 | DateTime dt3 (2009, 1, 2, 0, 0, 0); 43 | showDate("dt3", dt3); 44 | 45 | DateTime dt4 (2009, 1, 27, 0, 0, 0); 46 | showDate("dt4", dt4); 47 | 48 | DateTime dt5 (2009, 2, 27, 0, 0, 0); 49 | showDate("dt5", dt5); 50 | 51 | DateTime dt6 (2009, 12, 27, 0, 0, 0); 52 | showDate("dt6", dt6); 53 | 54 | DateTime dt7 (dt6.unixtime() + 3600); // one hour later 55 | showDate("dt7", dt7); 56 | 57 | DateTime dt8 (dt6.unixtime() + 86400L); // one day later 58 | showDate("dt8", dt8); 59 | 60 | DateTime dt9 (dt6.unixtime() + 7 * 86400L); // one week later 61 | showDate("dt9", dt9); 62 | } 63 | 64 | void loop () { 65 | } 66 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyRTClib/examples/ds1307/ds1307.pde: -------------------------------------------------------------------------------- 1 | // Date and time functions using a DS1307 RTC connected via I2C and Wire lib 2 | 3 | #include 4 | #include "TinyRTClib.h" 5 | 6 | RTC_DS1307 RTC; 7 | 8 | void setup () { 9 | Serial.begin(115200); 10 | TinyWireM.begin(); 11 | RTC.begin(); 12 | 13 | if (! RTC.isrunning()) { 14 | Serial.println("RTC is NOT running!"); 15 | // following line sets the RTC to the date & time this sketch was compiled 16 | RTC.adjust(DateTime(__DATE__, __TIME__)); 17 | } 18 | } 19 | 20 | void loop () { 21 | DateTime now = RTC.now(); 22 | 23 | Serial.print(now.year(), DEC); 24 | Serial.print('/'); 25 | Serial.print(now.month(), DEC); 26 | Serial.print('/'); 27 | Serial.print(now.day(), DEC); 28 | Serial.print(' '); 29 | Serial.print(now.hour(), DEC); 30 | Serial.print(':'); 31 | Serial.print(now.minute(), DEC); 32 | Serial.print(':'); 33 | Serial.print(now.second(), DEC); 34 | Serial.println(); 35 | 36 | Serial.print(" since midnight 1/1/1970 = "); 37 | Serial.print(now.unixtime()); 38 | Serial.print("s = "); 39 | Serial.print(now.unixtime() / 86400L); 40 | Serial.println("d"); 41 | 42 | // calculate a date which is 7 days and 30 seconds into the future 43 | DateTime future (now.unixtime() + 7 * 86400L + 30); 44 | 45 | Serial.print(" now + 7d + 30s: "); 46 | Serial.print(future.year(), DEC); 47 | Serial.print('/'); 48 | Serial.print(future.month(), DEC); 49 | Serial.print('/'); 50 | Serial.print(future.day(), DEC); 51 | Serial.print(' '); 52 | Serial.print(future.hour(), DEC); 53 | Serial.print(':'); 54 | Serial.print(future.minute(), DEC); 55 | Serial.print(':'); 56 | Serial.print(future.second(), DEC); 57 | Serial.println(); 58 | 59 | Serial.println(); 60 | delay(3000); 61 | } 62 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyRTClib/examples/softrtc/softrtc.pde: -------------------------------------------------------------------------------- 1 | // Date and time functions using just software, based on millis() & timer 2 | 3 | #include 4 | #include "TinyRTClib.h" 5 | 6 | RTC_Millis RTC; 7 | 8 | void setup () { 9 | Serial.begin(115200); 10 | // following line sets the RTC to the date & time this sketch was compiled 11 | RTC.begin(DateTime(__DATE__, __TIME__)); 12 | } 13 | 14 | void loop () { 15 | DateTime now = RTC.now(); 16 | 17 | Serial.print(now.year(), DEC); 18 | Serial.print('/'); 19 | Serial.print(now.month(), DEC); 20 | Serial.print('/'); 21 | Serial.print(now.day(), DEC); 22 | Serial.print(' '); 23 | Serial.print(now.hour(), DEC); 24 | Serial.print(':'); 25 | Serial.print(now.minute(), DEC); 26 | Serial.print(':'); 27 | Serial.print(now.second(), DEC); 28 | Serial.println(); 29 | 30 | Serial.print(" seconds since 1970: "); 31 | Serial.println(now.unixtime()); 32 | 33 | // calculate a date which is 7 days and 30 seconds into the future 34 | DateTime future (now.unixtime() + 7 * 86400L + 30); 35 | 36 | Serial.print(" now + 7d + 30s: "); 37 | Serial.print(future.year(), DEC); 38 | Serial.print('/'); 39 | Serial.print(future.month(), DEC); 40 | Serial.print('/'); 41 | Serial.print(future.day(), DEC); 42 | Serial.print(' '); 43 | Serial.print(future.hour(), DEC); 44 | Serial.print(':'); 45 | Serial.print(future.minute(), DEC); 46 | Serial.print(':'); 47 | Serial.print(future.second(), DEC); 48 | Serial.println(); 49 | 50 | Serial.println(); 51 | delay(3000); 52 | } 53 | -------------------------------------------------------------------------------- /libraries/DigisparkTinyRTClib/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For RTC 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | DateTime KEYWORD1 10 | RTC_DS1307 KEYWORD1 11 | RTC_Millis KEYWORD1 12 | 13 | ####################################### 14 | # Methods and Functions (KEYWORD2) 15 | ####################################### 16 | 17 | year KEYWORD2 18 | month KEYWORD2 19 | day KEYWORD2 20 | hour KEYWORD2 21 | minute KEYWORD2 22 | second KEYWORD2 23 | dayOfWeek KEYWORD2 24 | secondstime KEYWORD2 25 | unixtime KEYWORD2 26 | begin KEYWORD2 27 | adjust KEYWORD2 28 | isrunning KEYWORD2 29 | now KEYWORD2 30 | 31 | ####################################### 32 | # Constants (LITERAL1) 33 | ####################################### 34 | 35 | -------------------------------------------------------------------------------- /libraries/DigisparkTinySoftPwm/Readme.md: -------------------------------------------------------------------------------- 1 | TinySoftPwm library 2 | =================== 3 | 4 | **TinySoftPwm** is a library designed to generate PWM signals by software. 5 | 6 | Some examples of use cases: 7 | ------------------------- 8 | * **RGB strip LED Controller** 9 | * **DC Motor controller** 10 | * **Digital to Analog converter** 11 | 12 | Supported Arduinos: 13 | ------------------ 14 | * **ATtiny85 (Standalone or Digispark)** (up to 6 software PWM supported) 15 | * **ATtiny167 (Digispark pro)** (up to 13 software PWM supported) 16 | * **ATmega328P (UNO)** (up to 14 software PWM supported) 17 | 18 | API/methods: 19 | ----------- 20 | * TinySoftPwm_begin() 21 | * TinySoftPwm_analogWrite() 22 | * TinySoftPwm_process() 23 | 24 | 25 | Design considerations: 26 | --------------------- 27 | In order to reduce **program** and **RAM** memories, PWM pins shall be declared in the **TinySoftPwm.h** file. All the required amount of **program** and **RAM** memories are allocated at compilation time. 28 | 29 | The **TinySoftPwm_process()** method shall be called periodically: 30 | 31 | * using micros() in the loop(): in this case, asynchronous programmation shall be used: no call to blocking functions such as delay() is permitted. 32 | * or better using periodic interruption. 33 | 34 | In order to reduce the memory footprint (programm and RAM), try to use the PWM on pins which are part of the same port: PORTA or PORTB. 35 | 36 | Contact 37 | ------- 38 | 39 | If you have some ideas of enhancement, please contact me by clicking on: [RC Navy](http://p.loussouarn.free.fr/contact.html). 40 | 41 | -------------------------------------------------------------------------------- /libraries/DigisparkTinySoftPwm/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map TinySoftPwm 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | TinySoftPwm KEYWORD1 9 | 10 | ####################################### 11 | # Methods and Functions (KEYWORD2) 12 | ####################################### 13 | TinySoftPwm_begin KEYWORD2 14 | TinySoftPwm_analogWrite KEYWORD2 15 | TinySoftPwm_process KEYWORD2 16 | 17 | ####################################### 18 | # Constants (LITERAL1) 19 | ####################################### 20 | -------------------------------------------------------------------------------- /libraries/DigisparkUSB/ArduinoNotes.txt: -------------------------------------------------------------------------------- 1 | Notes On Integrating AVRUSB with Arduino 2 | ======================================== 3 | 4 | * Note the license(s) under which AVRUSB is distributed. 5 | 6 | * See also: http://code.rancidbacon.com/ProjectLogArduinoUSB 7 | 8 | * Note: The pins we use on the PCB (not protoboard) hardware shield are: 9 | 10 | INT0 == PD2 == IC Pin 4 == Arduino Digital Pin 2 == D+ 11 | 12 | ---- == PD4 == -------- == Arduino Digital Pin 4 == D- 13 | 14 | ---- == PD5 == -------- == Arduino Digital Pin 5 == pull-up 15 | 16 | (DONE: Change to not use PD3 so INT1 is left free?) 17 | 18 | * In order to compile a valid 'usbconfig.h' file must exit. The content of this 19 | file will vary depending on whether the device is a generic USB device, 20 | generic HID device or specific class of HID device for example. 21 | 22 | The file 'usbconfig-prototype.h' can be used as a starting point, however 23 | it might be easier to use the 'usbconfig.h' from one of the example projects. 24 | 25 | TODO: Specify the settings that need to be changed to match the shield 26 | design we use. 27 | 28 | * (NOTE: Initial 'usbconfig.h' used will be based on the file from 29 | 'HIDKeys.2007-03-29'.) (Note: Have now upgraded to V-USB 2009-08-22.) 30 | 31 | * At present the IDE won't compile our library so it needs to be pre-compiled 32 | with: 33 | 34 | avr-g++ -Wall -Os -I. -DF_CPU=16000000 -mmcu=atmega168 -c usbdrvasm.S -c usbdrv.c 35 | -------------------------------------------------------------------------------- /libraries/DigisparkUSB/DigiUSB.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Based on Obdev's AVRUSB code and under the same license. 3 | * 4 | * TODO: Make a proper file header. :-) 5 | */ 6 | #ifndef __DigiUSB_h__ 7 | #define __DigiUSB_h__ 8 | 9 | #include 10 | #include 11 | #include 12 | #include "usbdrv.h" 13 | #include "Print.h" 14 | 15 | 16 | typedef uint8_t byte; 17 | 18 | #include /* for _delay_ms() */ 19 | 20 | #define RING_BUFFER_SIZE 128 21 | 22 | 23 | struct ring_buffer { 24 | unsigned char buffer[RING_BUFFER_SIZE]; 25 | int head; 26 | int tail; 27 | }; 28 | 29 | 30 | 31 | 32 | 33 | class DigiUSBDevice : public Print { 34 | private: 35 | ring_buffer *_rx_buffer; 36 | ring_buffer *_tx_buffer; 37 | 38 | public: 39 | DigiUSBDevice (ring_buffer *rx_buffer, ring_buffer *tx_buffer); 40 | 41 | void begin(); 42 | 43 | // TODO: Deprecate update 44 | void update(); 45 | 46 | void refresh(); 47 | void delay(long milliseconds); 48 | 49 | int available(); 50 | int tx_remaining(); 51 | 52 | int read(); 53 | virtual size_t write(byte c); 54 | using Print::write; 55 | 56 | }; 57 | 58 | extern DigiUSBDevice DigiUSB; 59 | 60 | #endif // __DigiUSB_h__ 61 | -------------------------------------------------------------------------------- /libraries/DigisparkUSB/DigisparkReadme.txt: -------------------------------------------------------------------------------- 1 | Modified for use with an Attiny85 running at 16.5Mhz by Digistump for the Digispark MCU -------------------------------------------------------------------------------- /libraries/DigisparkUSB/examples/DigiBlink/DigiBlink.ino: -------------------------------------------------------------------------------- 1 | #define USB_CFG_DEVICE_NAME 'D','i','g','i','B','l','i','n','k' 2 | #define USB_CFG_DEVICE_NAME_LEN 9 3 | #include 4 | byte in = 0; 5 | int Blue = 0; 6 | int Red = 0; 7 | int Green = 0; 8 | 9 | int next = 0; 10 | 11 | void setup() { 12 | DigiUSB.begin(); 13 | pinMode(0,OUTPUT); 14 | pinMode(1,OUTPUT); 15 | pinMode(2,OUTPUT); 16 | } 17 | 18 | 19 | void loop() { 20 | setBlue(); 21 | DigiUSB.refresh(); 22 | setBlue(); 23 | if (DigiUSB.available() > 0) { 24 | in = 0; 25 | 26 | in = DigiUSB.read(); 27 | if (next == 0){ 28 | if(in == 115){ 29 | next = 1; 30 | DigiUSB.println("Start"); 31 | } 32 | } 33 | else if (next == 1){ 34 | Red = in; 35 | DigiUSB.print("Red "); 36 | DigiUSB.println(in,DEC); 37 | next = 2; 38 | } 39 | else if (next == 2){ 40 | Green = in; 41 | DigiUSB.print("Green "); 42 | DigiUSB.println(in,DEC); 43 | next = 3; 44 | } 45 | else if (next == 3){ 46 | Blue = in; 47 | DigiUSB.print("Blue "); 48 | DigiUSB.println(in,DEC); 49 | next = 0; 50 | } 51 | 52 | 53 | 54 | 55 | } 56 | 57 | 58 | analogWrite(0,Red); 59 | analogWrite(1,Green); 60 | setBlue(); 61 | 62 | 63 | 64 | } 65 | 66 | void setBlue(){ 67 | if(Blue == 0){ 68 | digitalWrite(2,LOW); 69 | return; 70 | } 71 | else if(Blue == 255){ 72 | digitalWrite(2,HIGH); 73 | return; 74 | } 75 | // On period 76 | for (int x=0;x 2 | 3 | void setup() { 4 | DigiUSB.begin(); 5 | } 6 | 7 | void get_input() { 8 | // when there are no characters to read 9 | while (1==1) { 10 | if(DigiUSB.available()){ 11 | //something to read 12 | DigiUSB.read(); 13 | break; 14 | } 15 | // refresh the usb port 16 | DigiUSB.refresh(); 17 | delay(10); 18 | 19 | } 20 | 21 | } 22 | 23 | 24 | void loop() { 25 | DigiUSB.refresh(); 26 | //print output 27 | float value = analogRead(1); //This is Pin3 28 | if(value>1020) 29 | value = 255; 30 | else if(value<2) 31 | value = 0; 32 | else 33 | value = value/4; 34 | //send value 35 | 36 | value = round(byte(value)); 37 | DigiUSB.write(value); 38 | 39 | //wait for response 40 | get_input(); 41 | 42 | } -------------------------------------------------------------------------------- /libraries/DigisparkUSB/examples/DigiUSB2LCD/DigiUSB2LCD.ino: -------------------------------------------------------------------------------- 1 | /* USB LCD */ 2 | 3 | //#define DEBUG 4 | #include // I2C Master lib for ATTinys which use USI - comment this out to use with standard arduinos 5 | #include // for LCD w/ GPIO MODIFIED for the ATtiny85 6 | #include 7 | 8 | #define GPIO_ADDR 0x27 // (PCA8574A A0-A2 @5V) typ. A0-A3 Gnd 0x20 / 0x38 for A - 0x27 is the address of the Digispark LCD modules. 9 | int currentLine = 0; 10 | boolean clearOnNext = 0; 11 | boolean backlight = 1; 12 | 13 | LiquidCrystal_I2C lcd(GPIO_ADDR,16,2); // set address & 16 chars / 2 lines 14 | 15 | 16 | void setup(){ 17 | DigiUSB.begin(); 18 | TinyWireM.begin(); // initialize I2C lib - comment this out to use with standard arduinos 19 | lcd.init(); // initialize the lcd 20 | lcd.backlight(); // Print a message to the LCD. 21 | lcd.setCursor(0, currentLine); 22 | } 23 | 24 | 25 | void get_input() { 26 | 27 | int lastRead; 28 | // when there are no characters to read, or the character isn't a newline 29 | while (1==1) { 30 | if(DigiUSB.available()){ 31 | //something to read 32 | lastRead = DigiUSB.read(); 33 | if(lastRead == '\n'){ 34 | 35 | 36 | if(currentLine > 0) 37 | currentLine = 0; 38 | else 39 | currentLine = 1; 40 | 41 | clearOnNext = 1; 42 | 43 | lcd.setCursor(0, currentLine); 44 | 45 | } 46 | else if(lastRead == 172){ //not sign "¬" send it with the send program to toggle the backlight 47 | if(backlight){ 48 | lcd.noBacklight(); 49 | backlight = 0; 50 | } 51 | else{ 52 | lcd.backlight(); 53 | backlight = 1; 54 | } 55 | DigiUSB.read(); //read to nothing to get rid of newline that should come after it 56 | 57 | } 58 | else{ 59 | if(clearOnNext){ 60 | lcd.print(" "); //clear a single line 61 | lcd.setCursor(0, currentLine); 62 | clearOnNext=0; 63 | } 64 | lcd.print(char(lastRead)); 65 | } 66 | 67 | 68 | 69 | } 70 | // refresh the usb port 71 | DigiUSB.refresh(); 72 | delay(10); 73 | 74 | } 75 | 76 | } 77 | 78 | 79 | void loop(){ 80 | get_input(); 81 | } -------------------------------------------------------------------------------- /libraries/DigisparkUSB/examples/Echo/Echo.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | void setup() { 4 | DigiUSB.begin(); 5 | } 6 | 7 | void get_input() { 8 | int lastRead; 9 | // when there are no characters to read, or the character isn't a newline 10 | while (true) { // loop forever 11 | if (DigiUSB.available()) { 12 | // something to read 13 | lastRead = DigiUSB.read(); 14 | DigiUSB.write(lastRead); 15 | 16 | if (lastRead == '\n') { 17 | break; // when we get a newline, break out of loop 18 | } 19 | } 20 | 21 | // refresh the usb port for 10 milliseconds 22 | DigiUSB.delay(10); 23 | } 24 | } 25 | 26 | void loop() { 27 | // print output 28 | DigiUSB.println("Waiting for input..."); 29 | // get input 30 | get_input(); 31 | } -------------------------------------------------------------------------------- /libraries/DigisparkUSB/keywords.txt: -------------------------------------------------------------------------------- 1 | DigiUSB KEYWORD1 2 | refresh KEYWORD2 -------------------------------------------------------------------------------- /libraries/DigisparkUSB/libs-device/Readme.txt: -------------------------------------------------------------------------------- 1 | This is the Readme file for the libs-device directory. This directory contains 2 | code snippets which may be useful for USB device firmware. 3 | 4 | 5 | WHAT IS INCLUDED IN THIS DIRECTORY? 6 | =================================== 7 | 8 | osccal.c and osccal.h 9 | This module contains a function which calibrates the AVR's built-in RC 10 | oscillator based on the USB frame clock. See osccal.h for a documentation 11 | of the API. 12 | 13 | osctune.h 14 | This header file contains a code snippet for usbconfig.h. With this code, 15 | you can keep the AVR's internal RC oscillator in sync with the USB frame 16 | clock. This is a continuous synchronization, not a single calibration at 17 | USB reset as with osccal.c above. Please note that this code works only 18 | if D- is wired to the interrupt, not D+. 19 | 20 | ---------------------------------------------------------------------------- 21 | (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH. 22 | http://www.obdev.at/ 23 | -------------------------------------------------------------------------------- /libraries/DigisparkUSB/libs-device/osccal.c: -------------------------------------------------------------------------------- 1 | /* Name: osccal.c 2 | * Author: Christian Starkjohann 3 | * Creation Date: 2008-04-10 4 | * Tabsize: 4 5 | * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH 6 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 7 | * This Revision: $Id: osccal.c 762 2009-08-12 17:10:30Z cs $ 8 | */ 9 | 10 | #include 11 | 12 | #ifndef uchar 13 | #define uchar unsigned char 14 | #endif 15 | 16 | /* ------------------------------------------------------------------------- */ 17 | /* ------------------------ Oscillator Calibration ------------------------- */ 18 | /* ------------------------------------------------------------------------- */ 19 | 20 | /* Calibrate the RC oscillator. Our timing reference is the Start Of Frame 21 | * signal (a single SE0 bit) repeating every millisecond immediately after 22 | * a USB RESET. We first do a binary search for the OSCCAL value and then 23 | * optimize this value with a neighboorhod search. 24 | */ 25 | void calibrateOscillator(void) 26 | { 27 | uchar step = 128; 28 | uchar trialValue = 0, optimumValue; 29 | int x, optimumDev, targetValue = (unsigned)(1499 * (double)F_CPU / 10.5e6 + 0.5); 30 | 31 | /* do a binary search: */ 32 | do{ 33 | OSCCAL = trialValue + step; 34 | x = usbMeasureFrameLength(); /* proportional to current real frequency */ 35 | if(x < targetValue) /* frequency still too low */ 36 | trialValue += step; 37 | step >>= 1; 38 | }while(step > 0); 39 | /* We have a precision of +/- 1 for optimum OSCCAL here */ 40 | /* now do a neighborhood search for optimum value */ 41 | optimumValue = trialValue; 42 | optimumDev = x; /* this is certainly far away from optimum */ 43 | for(OSCCAL = trialValue - 1; OSCCAL <= trialValue + 1; OSCCAL++){ 44 | x = usbMeasureFrameLength() - targetValue; 45 | if(x < 0) 46 | x = -x; 47 | if(x < optimumDev){ 48 | optimumDev = x; 49 | optimumValue = OSCCAL; 50 | } 51 | } 52 | OSCCAL = optimumValue; 53 | } 54 | /* 55 | Note: This calibration algorithm may try OSCCAL values of up to 192 even if 56 | the optimum value is far below 192. It may therefore exceed the allowed clock 57 | frequency of the CPU in low voltage designs! 58 | You may replace this search algorithm with any other algorithm you like if 59 | you have additional constraints such as a maximum CPU clock. 60 | For version 5.x RC oscillators (those with a split range of 2x128 steps, e.g. 61 | ATTiny25, ATTiny45, ATTiny85), it may be useful to search for the optimum in 62 | both regions. 63 | */ 64 | -------------------------------------------------------------------------------- /libraries/DigisparkUSB/libs-device/osccal.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkUSB/libs-device/osccal.o -------------------------------------------------------------------------------- /libraries/DigisparkUSB/oddebug.c: -------------------------------------------------------------------------------- 1 | /* Name: oddebug.c 2 | * Project: AVR library 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2005-01-16 5 | * Tabsize: 4 6 | * Copyright: (c) 2005 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id: oddebug.c 692 2008-11-07 15:07:40Z cs $ 9 | */ 10 | 11 | #include "oddebug.h" 12 | 13 | #if DEBUG_LEVEL > 0 14 | 15 | #warning "Never compile production devices with debugging enabled" 16 | 17 | static void uartPutc(char c) 18 | { 19 | while(!(ODDBG_USR & (1 << ODDBG_UDRE))); /* wait for data register empty */ 20 | ODDBG_UDR = c; 21 | } 22 | 23 | static uchar hexAscii(uchar h) 24 | { 25 | h &= 0xf; 26 | if(h >= 10) 27 | h += 'a' - (uchar)10 - '0'; 28 | h += '0'; 29 | return h; 30 | } 31 | 32 | static void printHex(uchar c) 33 | { 34 | uartPutc(hexAscii(c >> 4)); 35 | uartPutc(hexAscii(c)); 36 | } 37 | 38 | void odDebug(uchar prefix, uchar *data, uchar len) 39 | { 40 | printHex(prefix); 41 | uartPutc(':'); 42 | while(len--){ 43 | uartPutc(' '); 44 | printHex(*data++); 45 | } 46 | uartPutc('\r'); 47 | uartPutc('\n'); 48 | } 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /libraries/DigisparkUSB/osccal.c: -------------------------------------------------------------------------------- 1 | /* Name: osccal.c 2 | * Author: Christian Starkjohann 3 | * Creation Date: 2008-04-10 4 | * Tabsize: 4 5 | * Copyright: (c) 2008 by OBJECTIVE DEVELOPMENT Software GmbH 6 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 7 | * This Revision: $Id: osccal.c 762 2009-08-12 17:10:30Z cs $ 8 | */ 9 | 10 | #include 11 | 12 | #ifndef uchar 13 | #define uchar unsigned char 14 | #endif 15 | 16 | /* ------------------------------------------------------------------------- */ 17 | /* ------------------------ Oscillator Calibration ------------------------- */ 18 | /* ------------------------------------------------------------------------- */ 19 | 20 | /* Calibrate the RC oscillator. Our timing reference is the Start Of Frame 21 | * signal (a single SE0 bit) repeating every millisecond immediately after 22 | * a USB RESET. We first do a binary search for the OSCCAL value and then 23 | * optimize this value with a neighboorhod search. 24 | */ 25 | void calibrateOscillator(void) 26 | { 27 | uchar step = 128; 28 | uchar trialValue = 0, optimumValue; 29 | int x, optimumDev, targetValue = (unsigned)(1499 * (double)F_CPU / 10.5e6 + 0.5); 30 | 31 | /* do a binary search: */ 32 | do{ 33 | OSCCAL = trialValue + step; 34 | x = usbMeasureFrameLength(); /* proportional to current real frequency */ 35 | if(x < targetValue) /* frequency still too low */ 36 | trialValue += step; 37 | step >>= 1; 38 | }while(step > 0); 39 | /* We have a precision of +/- 1 for optimum OSCCAL here */ 40 | /* now do a neighborhood search for optimum value */ 41 | optimumValue = trialValue; 42 | optimumDev = x; /* this is certainly far away from optimum */ 43 | for(OSCCAL = trialValue - 1; OSCCAL <= trialValue + 1; OSCCAL++){ 44 | x = usbMeasureFrameLength() - targetValue; 45 | if(x < 0) 46 | x = -x; 47 | if(x < optimumDev){ 48 | optimumDev = x; 49 | optimumValue = OSCCAL; 50 | } 51 | } 52 | OSCCAL = optimumValue; 53 | } 54 | /* 55 | Note: This calibration algorithm may try OSCCAL values of up to 192 even if 56 | the optimum value is far below 192. It may therefore exceed the allowed clock 57 | frequency of the CPU in low voltage designs! 58 | You may replace this search algorithm with any other algorithm you like if 59 | you have additional constraints such as a maximum CPU clock. 60 | For version 5.x RC oscillators (those with a split range of 2x128 steps, e.g. 61 | ATTiny25, ATTiny45, ATTiny85), it may be useful to search for the optimum in 62 | both regions. 63 | */ 64 | -------------------------------------------------------------------------------- /libraries/DigisparkUSB/osccal.o: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/DigisparkUSB/osccal.o -------------------------------------------------------------------------------- /libraries/DigisparkUSB/rx_buffer.h: -------------------------------------------------------------------------------- 1 | #ifndef __rx_buffer_h__ 2 | #define __rx_buffer_h__ 3 | 4 | #ifdef __cplusplus 5 | extern "C"{ 6 | #endif 7 | uchar rx_buffer[8]; // Buffer 8 bytes 8 | extern int rx_read_offset; // = -1; 9 | extern int rx_write_offset; // = 0; 10 | #ifdef __cplusplus 11 | } // extern "C" 12 | #endif 13 | 14 | #endif // __rx_buffer_h__ 15 | -------------------------------------------------------------------------------- /libraries/DigisparkUSB/usbdrvasm.asm: -------------------------------------------------------------------------------- 1 | /* Name: usbdrvasm.asm 2 | * Project: V-USB, virtual USB port for Atmel's(r) AVR(r) microcontrollers 3 | * Author: Christian Starkjohann 4 | * Creation Date: 2006-03-01 5 | * Tabsize: 4 6 | * Copyright: (c) 2006 by OBJECTIVE DEVELOPMENT Software GmbH 7 | * License: GNU GPL v2 (see License.txt), GNU GPL v3 or proprietary (CommercialLicense.txt) 8 | * This Revision: $Id$ 9 | */ 10 | 11 | /* 12 | General Description: 13 | The IAR compiler/assembler system prefers assembler files with file extension 14 | ".asm". We simply provide this file as an alias for usbdrvasm.S. 15 | 16 | Thanks to Oleg Semyonov for his help with the IAR tools port! 17 | */ 18 | 19 | #include "usbdrvasm.S" 20 | 21 | end 22 | -------------------------------------------------------------------------------- /libraries/DigisparkVirtualWire/CHANGES: -------------------------------------------------------------------------------- 1 | See VirtulWire.h for latest change log 2 | -------------------------------------------------------------------------------- /libraries/DigisparkVirtualWire/LICENSE: -------------------------------------------------------------------------------- 1 | This software is Copyright (C) 2008 Mike McCauley. Use is subject to license 2 | conditions. The main licensing options available are GPL V2 or Commercial: 3 | 4 | Open Source Licensing GPL V2 5 | 6 | This is the appropriate option if you want to share the source code of your 7 | application with everyone you distribute it to, and you also want to give them 8 | the right to share who uses it. If you wish to use this software under Open 9 | Source Licensing, you must contribute all your source code to the open source 10 | community in accordance with the GPL Version 2 when your application is 11 | distributed. See http://www.gnu.org/copyleft/gpl.html 12 | 13 | Commercial Licensing 14 | 15 | This is the appropriate option if you are creating proprietary applications 16 | and you are not prepared to distribute and share the source code of your 17 | application. Contact info@open.com.au for details. 18 | -------------------------------------------------------------------------------- /libraries/DigisparkVirtualWire/MANIFEST: -------------------------------------------------------------------------------- 1 | VirtualWire/doc 2 | VirtualWire/LICENSE 3 | VirtualWire/README 4 | VirtualWire/Makefile 5 | VirtualWire/VirtualWire.cpp 6 | VirtualWire/VirtualWire.h 7 | VirtualWire/CHANGES 8 | VirtualWire/MANIFEST 9 | VirtualWire/keywords.txt 10 | VirtualWire/util/crc16.h 11 | VirtualWire/examples/client/client.pde 12 | VirtualWire/examples/transmitter/transmitter.pde 13 | VirtualWire/examples/receiver/receiver.pde 14 | VirtualWire/examples/server/server.pde 15 | -------------------------------------------------------------------------------- /libraries/DigisparkVirtualWire/Makefile: -------------------------------------------------------------------------------- 1 | # Makefile 2 | # 3 | # Makefile for the Arduino VirtualWire project 4 | # 5 | # Author: Mike McCauley (mikem@airspayce.com) 6 | # Copyright (C) 2011 Mike McCauley 7 | # $Id: Makefile,v 1.1 2013/01/14 06:49:29 mikem Exp mikem $ 8 | 9 | PROJNAME = VirtualWire 10 | # Dont forget to also change the version at the top of RF22.h: 11 | DISTFILE = $(PROJNAME)-1.15.zip 12 | 13 | all: doxygen dist upload 14 | 15 | doxygen: 16 | doxygen project.cfg 17 | 18 | ci: 19 | (cd ..;ci -l `cat $(PROJNAME)/MANIFEST`) 20 | 21 | dist: 22 | (cd ..; zip $(PROJNAME)/$(DISTFILE) `cat $(PROJNAME)/MANIFEST`) 23 | 24 | upload: 25 | rsync -avz $(DISTFILE) doc/ www.airspayce.com:public_html/mikem/arduino/$(PROJNAME) 26 | rsync -avz ../../doc/VirtualWire.pdf doc/ www.airspayce.com:public_html/mikem/arduino/ 27 | -------------------------------------------------------------------------------- /libraries/DigisparkVirtualWire/README: -------------------------------------------------------------------------------- 1 | Virtual Wire 2 | 3 | This is the VirtualWire library for Arduino 4 | It provides a simple message passing protocol for a range of inexpensive 5 | transmitter and receiver modules. 6 | 7 | See http://www.open.com.au/mikem/arduino/VirtualWire.pdf for full documentation. 8 | 9 | -------------------------------------------------------------------------------- /libraries/DigisparkVirtualWire/examples/client/client.pde: -------------------------------------------------------------------------------- 1 | // client.pde 2 | // 3 | // Simple example of how to use VirtualWire to send and receive messages 4 | // with a DR3100 module. 5 | // Send a message to another arduino running the 'server' example, which 6 | // should send a reply, which we will check 7 | // 8 | // See VirtualWire.h for detailed API docs 9 | // Author: Mike McCauley (mikem@airspayce.com) 10 | // Copyright (C) 2008 Mike McCauley 11 | // $Id: client.pde,v 1.1 2008/04/20 09:24:17 mikem Exp $ 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Serial.begin(9600); // Debugging only 18 | Serial.println("setup"); 19 | 20 | // Initialise the IO and ISR 21 | vw_set_ptt_inverted(true); // Required for DR3100 22 | vw_setup(2000); // Bits per sec 23 | vw_rx_start(); // Start the receiver PLL running 24 | } 25 | 26 | void loop() 27 | { 28 | const char *msg = "hello"; 29 | uint8_t buf[VW_MAX_MESSAGE_LEN]; 30 | uint8_t buflen = VW_MAX_MESSAGE_LEN; 31 | 32 | digitalWrite(13, true); // Flash a light to show transmitting 33 | vw_send((uint8_t *)msg, strlen(msg)); 34 | vw_wait_tx(); // Wait until the whole message is gone 35 | Serial.println("Sent"); 36 | digitalWrite(13, false); 37 | 38 | // Wait at most 200ms for a reply 39 | if (vw_wait_rx_max(200)) 40 | { 41 | if (vw_get_message(buf, &buflen)) // Non-blocking 42 | { 43 | int i; 44 | 45 | // Message with a good checksum received, dump it. 46 | Serial.print("Got: "); 47 | 48 | for (i = 0; i < buflen; i++) 49 | { 50 | Serial.print(buf[i], HEX); 51 | Serial.print(" "); 52 | } 53 | Serial.println(""); 54 | } 55 | } 56 | else 57 | Serial.println("Timout"); 58 | 59 | } 60 | -------------------------------------------------------------------------------- /libraries/DigisparkVirtualWire/examples/receiver/receiver.pde: -------------------------------------------------------------------------------- 1 | // receiver.pde 2 | // 3 | // Simple example of how to use VirtualWire to receive messages 4 | // Implements a simplex (one-way) receiver with an Rx-B1 module 5 | // 6 | // See VirtualWire.h for detailed API docs 7 | // Author: Mike McCauley (mikem@airspayce.com) 8 | // Copyright (C) 2008 Mike McCauley 9 | // $Id: receiver.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $ 10 | 11 | #include 12 | 13 | void setup() 14 | { 15 | Serial.begin(9600); // Debugging only 16 | Serial.println("setup"); 17 | 18 | // Initialise the IO and ISR 19 | vw_set_ptt_inverted(true); // Required for DR3100 20 | vw_setup(2000); // Bits per sec 21 | 22 | vw_rx_start(); // Start the receiver PLL running 23 | } 24 | 25 | void loop() 26 | { 27 | uint8_t buf[VW_MAX_MESSAGE_LEN]; 28 | uint8_t buflen = VW_MAX_MESSAGE_LEN; 29 | 30 | if (vw_get_message(buf, &buflen)) // Non-blocking 31 | { 32 | int i; 33 | 34 | digitalWrite(13, true); // Flash a light to show received good message 35 | // Message with a good checksum received, dump it. 36 | Serial.print("Got: "); 37 | 38 | for (i = 0; i < buflen; i++) 39 | { 40 | Serial.print(buf[i], HEX); 41 | Serial.print(" "); 42 | } 43 | Serial.println(""); 44 | digitalWrite(13, false); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /libraries/DigisparkVirtualWire/examples/server/server.pde: -------------------------------------------------------------------------------- 1 | // server.pde 2 | // 3 | // Simple example of how to use VirtualWire to send and receive messages 4 | // with a DR3100 module. 5 | // Wait for a message from another arduino running the 'client' example, 6 | // and send a reply. 7 | // You can use this as the basis of a remote control/remote sensing system 8 | // 9 | // See VirtualWire.h for detailed API docs 10 | // Author: Mike McCauley (mikem@airspayce.com) 11 | // Copyright (C) 2008 Mike McCauley 12 | // $Id: server.pde,v 1.1 2008/04/20 09:24:17 mikem Exp $ 13 | 14 | #include 15 | 16 | void setup() 17 | { 18 | Serial.begin(9600); // Debugging only 19 | Serial.println("setup"); 20 | 21 | // Initialise the IO and ISR 22 | vw_set_ptt_inverted(true); // Required for DR3100 23 | vw_setup(2000); // Bits per sec 24 | vw_rx_start(); // Start the receiver PLL running 25 | } 26 | 27 | void loop() 28 | { 29 | const char *msg = "hello"; 30 | uint8_t buf[VW_MAX_MESSAGE_LEN]; 31 | uint8_t buflen = VW_MAX_MESSAGE_LEN; 32 | 33 | // Wait for a message 34 | vw_wait_rx(); 35 | if (vw_get_message(buf, &buflen)) // Non-blocking 36 | { 37 | int i; 38 | const char *msg = "goodbye"; 39 | 40 | digitalWrite(13, true); // Flash a light to show received good message 41 | // Message with a good checksum received, dump it. 42 | Serial.print("Got: "); 43 | 44 | for (i = 0; i < buflen; i++) 45 | { 46 | Serial.print(buf[i], HEX); 47 | Serial.print(" "); 48 | } 49 | Serial.println(""); 50 | 51 | // Send a reply 52 | vw_send((uint8_t *)msg, strlen(msg)); 53 | digitalWrite(13, false); 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /libraries/DigisparkVirtualWire/examples/transmitter/transmitter.pde: -------------------------------------------------------------------------------- 1 | // transmitter.pde 2 | // 3 | // Simple example of how to use VirtualWire to transmit messages 4 | // Implements a simplex (one-way) transmitter with an TX-C1 module 5 | // 6 | // See VirtualWire.h for detailed API docs 7 | // Author: Mike McCauley (mikem@airspayce.com) 8 | // Copyright (C) 2008 Mike McCauley 9 | // $Id: transmitter.pde,v 1.3 2009/03/30 00:07:24 mikem Exp $ 10 | 11 | #include 12 | 13 | void setup() 14 | { 15 | Serial.begin(9600); // Debugging only 16 | Serial.println("setup"); 17 | 18 | // Initialise the IO and ISR 19 | vw_set_ptt_inverted(true); // Required for DR3100 20 | vw_setup(2000); // Bits per sec 21 | } 22 | 23 | void loop() 24 | { 25 | const char *msg = "hello"; 26 | 27 | digitalWrite(13, true); // Flash a light to show transmitting 28 | vw_send((uint8_t *)msg, strlen(msg)); 29 | vw_wait_tx(); // Wait until the whole message is gone 30 | digitalWrite(13, false); 31 | delay(200); 32 | } 33 | -------------------------------------------------------------------------------- /libraries/DigisparkVirtualWire/keywords.txt: -------------------------------------------------------------------------------- 1 | VirtualWire KEYWORD1 2 | 3 | -------------------------------------------------------------------------------- /libraries/RcBusRx/images/RcBusRxDemo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/RcBusRx/images/RcBusRxDemo.png -------------------------------------------------------------------------------- /libraries/RcBusRx/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map RcBusRx 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | RcBusRx KEYWORD1 9 | 10 | ####################################### 11 | # Methods and Functions (KEYWORD2) 12 | ####################################### 13 | serialAttach KEYWORD2 14 | process KEYWORD2 15 | setProto KEYWORD2 16 | isSynchro KEYWORD2 17 | rawData KEYWORD2 18 | width_us KEYWORD2 19 | channelNb KEYWORD2 20 | 21 | ####################################### 22 | # Constants (LITERAL1) 23 | ####################################### 24 | SBUS_RX_SERIAL_CFG LITERAL1 25 | SRXL_RX_SERIAL_CFG LITERAL1 26 | SUMD_RX_SERIAL_CFG LITERAL1 27 | IBUS_RX_SERIAL_CFG LITERAL1 28 | JETI_RX_SERIAL_CFG LITERAL1 29 | RC_BUS_RX_SBUS LITERAL1 30 | RC_BUS_RX_SRXL LITERAL1 31 | RC_BUS_RX_SUMD LITERAL1 32 | RC_BUS_RX_IBUS LITERAL1 33 | RC_BUS_RX_JETI LITERAL1 34 | -------------------------------------------------------------------------------- /libraries/RcRxSerial/RcRxSerial.h: -------------------------------------------------------------------------------- 1 | #ifndef RcRxSerial_h 2 | #define RcRxSerial_h 3 | 4 | /* 5 | English: by RC Navy (2012) 6 | ======= 7 | : a library to build an unidirectionnal serial port through RC Transmitter/Receiver. 8 | http://p.loussouarn.free.fr 9 | 10 | Francais: par RC Navy (2012) 11 | ======== 12 | : une bibliotheque pour construire un port serie unidirectionnel a travers un Emetteur/Recepteur RC. 13 | http://p.loussouarn.free.fr 14 | */ 15 | 16 | #include "Arduino.h" 17 | #include 18 | 19 | enum {RC_RX_SERIAL_SYNCH = 0, RC_RX_SERIAL_ASYNCH_RX1 = 0, RC_RX_SERIAL_ASYNCH_RX2, RC_RX_SERIAL_ASYNCH_RX3}; 20 | 21 | #define RC_RX_SERIAL_PENDING_NIBBLE_INDICATOR (1 << 7) 22 | 23 | typedef struct { 24 | uint16_t 25 | Asynch: 2, /* If Synch (Asynch = 0) 1 occurence of nibble validates the nibble, otherwise (1 + Asynch) occurences are expected */ 26 | MsnPending: 1, 27 | Phase: 1, 28 | Available: 1, 29 | PrevValid: 5, 30 | Itself: 5; 31 | uint8_t 32 | PrevIdx: 5, /* Prev Nibble to compare to the following one */ 33 | SameCnt: 3; /* Current valid Nibble */ 34 | }RxNibbleSt_t; 35 | 36 | class RcRxSerial 37 | { 38 | private: 39 | Rcul *_Rcul; 40 | uint8_t _Ch; 41 | char _Char; 42 | uint8_t _MsgLen; 43 | uint16_t _LastWidth_us; 44 | uint8_t _available; 45 | RxNibbleSt_t _Nibble; 46 | uint8_t somethingAvailable(void); 47 | public: 48 | RcRxSerial(Rcul *Rcul, uint8_t Asynch, uint8_t Ch = 255); 49 | void reassignRculSrc(Rcul *Rcul, uint8_t Ch = 255); /* Marginal use (do not use it, if you do not know what is it for) */ 50 | uint8_t available(); 51 | uint8_t read(); 52 | uint8_t msgAvailable(char *RxBuf, uint8_t RxBufMaxLen); 53 | uint16_t lastWidth_us(); /* Only for calibration purpose */ 54 | uint8_t nibbleAvailable(); /* Only for calibration purpose */ 55 | }; 56 | 57 | #endif 58 | 59 | -------------------------------------------------------------------------------- /libraries/RcRxSerial/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map RcRxSerial 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | RcRxSerial KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | available KEYWORD2 15 | read KEYWORD2 16 | msgAvailable KEYWORD2 17 | lastWidth_us KEYWORD2 18 | nibbleAvailable KEYWORD2 19 | reassignRculSrc KEYWORD2 20 | 21 | ####################################### 22 | # Constants (LITERAL1) 23 | ####################################### 24 | -------------------------------------------------------------------------------- /libraries/RcTxSerial/RcTxSerial.h: -------------------------------------------------------------------------------- 1 | #ifndef RcTxSerial_h 2 | #define RcTxSerial_h 3 | 4 | /* 5 | English: by RC Navy (2012) 6 | ======= 7 | : a library to build an unidirectionnal serial port through RC Transmitter/Receiver. 8 | http://p.loussouarn.free.fr 9 | 10 | Francais: par RC Navy (2012) 11 | ======== 12 | : une librairie pour construire un port serie a travers un Emetteur/Recepteur RC. 13 | http://p.loussouarn.free.fr 14 | */ 15 | 16 | #include "Arduino.h" 17 | #include 18 | 19 | #include 20 | #include 21 | 22 | #define RC_TX_OPT_TIME_MS(PpmPeriodUs, SynchAsynch, ByteNb) ( ( ( ( (2 * (ByteNb)) + 1) * (SynchAsynch + 1) ) * ( ((PpmPeriodUs) + 500) / 1000 ) ) + 2) /* Majored */ 23 | 24 | /* MODULE CONFIGURATION */ 25 | #define PPM_TX_SERIAL_USES_POWER_OF_2_AUTO_MALLOC /* Comment this if you set fifo size to a power of 2: this allows saving some bytes of program memory */ 26 | 27 | enum {RC_TX_SERIAL_SYNCH = 0, RC_TX_SERIAL_ASYNCH_TX1 = 0, RC_TX_SERIAL_ASYNCH_TX2, RC_TX_SERIAL_ASYNCH_TX3, RC_TX_SERIAL_ASYNCH_TX4}; 28 | 29 | typedef struct { 30 | uint8_t 31 | TxInProgress: 1, /* */ 32 | TxCharInProgress: 1; 33 | uint16_t 34 | NbToSend: 3, 35 | SentCnt: 3, 36 | CurIdx: 5, /* Prev Nibble to compare to the following one */ 37 | PrevIdx: 5; /* Prev Nibble to compare to the following one */ 38 | }TxNibbleSt_t; 39 | 40 | class RcTxSerial : public Stream 41 | { 42 | private: 43 | // static data 44 | uint8_t _Ch; 45 | uint8_t _TxFifoSize; 46 | char *_TxFifo; 47 | char _TxChar; 48 | uint8_t _TxFifoTail; 49 | uint8_t _TxFifoHead; 50 | TxNibbleSt_t _Nibble; 51 | class RcTxSerial *next; 52 | static RcTxSerial *first; 53 | uint8_t TxFifoRead(char *TxChar); 54 | public: 55 | RcTxSerial(Rcul *Rcul, uint8_t Asynch, uint8_t TxFifoSize, uint8_t Ch = 255); 56 | int peek(); 57 | virtual size_t write(uint8_t byte); 58 | virtual int read(); 59 | virtual int available(); 60 | virtual void flush(); 61 | using Print::write; 62 | static uint8_t process(); /* Send half character synchronized with every PPM frame */ 63 | }; 64 | 65 | #endif 66 | -------------------------------------------------------------------------------- /libraries/RcTxSerial/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map RcTxSerial 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | RcTxSerial KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | write KEYWORD2 15 | process KEYWORD2 16 | 17 | ####################################### 18 | # Constants (LITERAL1) 19 | ####################################### 20 | -------------------------------------------------------------------------------- /libraries/Rcul/Rcul.h: -------------------------------------------------------------------------------- 1 | #ifndef RCUL_H 2 | #define RCUL_H 3 | 4 | #include 5 | 6 | #define RCUL_NO_CH ((1 << 5) - 1) //Ch on 5 bits 7 | #define RCUL_DEFAULT_CLIENT_IDX 6 8 | #define RCUL_CLIENT_MASK(ClientIdx) (1 << (ClientIdx)) 9 | 10 | class Rcul 11 | { 12 | public: 13 | virtual uint8_t RculIsSynchro(uint8_t ClientIdx = RCUL_DEFAULT_CLIENT_IDX) = 0; 14 | virtual uint16_t RculGetWidth_us(uint8_t Ch) = 0; 15 | virtual void RculSetWidth_us(uint16_t Width_us, uint8_t Ch = RCUL_NO_CH); 16 | }; 17 | 18 | #endif 19 | 20 | -------------------------------------------------------------------------------- /libraries/Rcul/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map Rcul 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | Rcul KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | RculIsSynchro KEYWORD2 15 | RculGetWidth_us KEYWORD2 16 | RculSetWidth_us KEYWORD2 17 | 18 | ####################################### 19 | # Constants (LITERAL1) 20 | ####################################### 21 | -------------------------------------------------------------------------------- /libraries/SBusRx/Readme.md: -------------------------------------------------------------------------------- 1 | SBusRx library 2 | ============== 3 | 4 | **SBusRx** is a library used to receive and extract the 16 proportionnal channels and the 4 flags transported by the SBUS protocol. 5 | SBUS protocol is mainly used with Futaba and FrSky receivers. 6 | 7 | 8 | Some examples of use cases: 9 | ------------------------- 10 | * **Any device connected to the SBUS connector of RC receiver** 11 | * **Custom controller for multi-rotor** 12 | * **Digital data reception over SBUS** 13 | 14 | Supported Arduinos: 15 | ------------------ 16 | All the arduino/micro-controllers equipped with a built-in UART: 17 | 18 | * **ATtiny167 (Standalone or Digispark pro)** 19 | * **ATmega368P (UNO)** 20 | * **ATmega32U4 (Arduino Leonardo, Micro and Pro Micro)** 21 | * **ATmega2560 (Arduino MEGA)** 22 | 23 | May work with a Software Serial (not tested). 24 | 25 | Tip and Tricks: 26 | -------------- 27 | Develop your project on an arduino MEGA, Leonardo and then shrink it by loading the sketch in an Micro or Pro Micro or ATtiny167. 28 | 29 | API/methods: 30 | ----------- 31 | * **SbusRx.serialAttach(Stream *RxStream)** 32 | With: 33 | * **_RxStream_**: pointer on a serial stream initialized at 100 000 bds, SERIAL_8E2 (eg: &Serial, &Serial1) 34 | 35 | * **SBusRx.process()** 36 | * This method shall be called in the main loop to process incoming data 37 | 38 | 39 | * **uint8_t SBusRx.isSynchro()**: 40 | * SBUS synchronization indicator: indicates that the SBUS frame has just been received. The channel raw data and/or the channel pulse widths and SBUS flags are available. This is a "clear on read" function (no need to clear explicitely the indicator). 41 | 42 | * **uint16_t rawData(uint8_t Ch)**: 43 | * This method returns the raw data value associated to the requested channel (Ch: 1 to 16). Return value: within [0, 2047]. 44 | 45 | * **uint16_t width_us(uint8_t Ch)**: 46 | * This method returns the pulse width (in µs) associated to the requested channel (Ch: 1 to 16). Return value: within [880, 2160]. 47 | 48 | * **uint8_t flags(uint8_t FlagId)** 49 | With: 50 | * **_FlagId_**: the flag identifier among the following choices 51 | * ** SBUS_RX_CH17**: the status (0/1) of the digital Channel#17 52 | * ** SBUS_RX_CH18**: the status (0/1) of the digital Channel#18 53 | * ** SBUS_RX_FRAME_LOST**: the status (0/1) of the frame lost indicator 54 | * ** SBUS_RX_FAILSAFE**: the status (0/1) of the FailSafe indicator 55 | 56 | Contact 57 | ------- 58 | 59 | If you have some ideas of enhancement, please contact me by clicking on: [RC Navy](http://p.loussouarn.free.fr/contact.html). 60 | 61 | -------------------------------------------------------------------------------- /libraries/SBusRx/SBusRx.h: -------------------------------------------------------------------------------- 1 | /* 2 | English: by RC Navy (2016-2020) 3 | ======= 4 | : an asynchronous SBUS library. SBusRx is an SBUS frame decoder. 5 | http://p.loussouarn.free.fr 6 | V1.0: initial release 7 | Francais: par RC Navy (2016-2020) 8 | ======== 9 | : une librairie SBUS asynchrone. SBusRx est un decodeur de trame SBUS. 10 | http://p.loussouarn.free.fr 11 | V1.0: release initiale 12 | */ 13 | #ifndef SBUSRX_H 14 | #define SBUSRX_H 15 | 16 | #include "Arduino.h" 17 | #include 18 | 19 | #define SBUS_RX_VERSION 1 20 | #define SBUS_RX_REVISION 0 21 | 22 | #define SBUS_RX_CH_NB 16 23 | #define SBUS_RX_DATA_NB ((((SBUS_RX_CH_NB * 11) + 7) / 8) + 1) /* +1 for flags -> 23 for 16 channels */ 24 | 25 | #define SBUS_RX_CH17 (1 << 0) 26 | #define SBUS_RX_CH18 (1 << 1) 27 | #define SBUS_RX_FRAME_LOST (1 << 2) 28 | #define SBUS_RX_FAILSAFE (1 << 3) 29 | 30 | class SBusRxClass : public Rcul 31 | { 32 | private: 33 | Stream *RxSerial; 34 | uint8_t StartMs; 35 | uint8_t RxState; 36 | uint8_t RxIdx; 37 | int8_t Data[SBUS_RX_DATA_NB]; /* +1 for flags */ 38 | uint16_t Channel[SBUS_RX_CH_NB]; 39 | uint8_t Synchro; 40 | void updateChannels(void); 41 | public: 42 | SBusRxClass(void); 43 | void serialAttach(Stream *RxStream); 44 | void process(void); 45 | uint8_t isSynchro(uint8_t SynchroClientIdx = 7); /* Default value: 8th Synchro client -> 0 to 6 free for other clients*/ 46 | uint16_t rawData(uint8_t Ch); 47 | uint16_t width_us(uint8_t Ch); 48 | uint8_t flags(uint8_t FlagId); 49 | /* Rcul support */ 50 | virtual uint8_t RculIsSynchro(uint8_t ClientIdx = RCUL_DEFAULT_CLIENT_IDX); 51 | virtual uint16_t RculGetWidth_us(uint8_t Ch); 52 | virtual void RculSetWidth_us(uint16_t Width_us, uint8_t Ch = 255); 53 | }; 54 | 55 | extern SBusRxClass SBusRx; /* Object externalisation */ 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /libraries/SBusRx/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SBusRx 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SBusRx KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | serialAttach KEYWORD2 15 | process KEYWORD2 16 | isSynchro KEYWORD2 17 | rawData KEYWORD2 18 | width_us KEYWORD2 19 | flags KEYWORD2 20 | 21 | ####################################### 22 | # Constants (LITERAL1) 23 | ####################################### 24 | -------------------------------------------------------------------------------- /libraries/SBusTx/SBusTx.h: -------------------------------------------------------------------------------- 1 | /* 2 | English: by RC Navy (2016-2020) 3 | ======= 4 | : an asynchronous SBUS library. SBusTx is an SBUS frame generator. 5 | http://p.loussouarn.free.fr 6 | V1.0: initial release 7 | Francais: par RC Navy (2016-2020) 8 | ======== 9 | : une librairie SBUS asynchrone. SBusTx est un generateur de trame SBUS. 10 | http://p.loussouarn.free.fr 11 | V1.0: release initiale 12 | */ 13 | #ifndef SBUSTX_H 14 | #define SBUSTX_H 15 | 16 | #include "Arduino.h" 17 | #include 18 | 19 | #define SBUS_TX_VERSION 1 20 | #define SBUS_TX_REVISION 0 21 | 22 | #define SBUS_TX_NORMAL_TRAME_RATE_MS 14 /* Normal: 14ms */ 23 | #define SBUS_TX_HIGH_SPEED_TRAME_RATE_MS 7 /* High Speed: 7ms */ 24 | 25 | #define SBUS_TX_CH_NB 16 26 | #define SBUS_TX_DATA_NB ((((SBUS_TX_CH_NB * 11) + 7) / 8) + 1) /* +1 for flags -> 23 for 16 channels */ 27 | 28 | #define SBUS_TX_CH17 (1 << 0) 29 | #define SBUS_TX_CH18 (1 << 1) 30 | #define SBUS_TX_FRAME_LOST (1 << 2) 31 | #define SBUS_TX_FAILSAFE (1 << 3) 32 | 33 | class SBusTxClass : public Rcul 34 | { 35 | private: 36 | Stream *TxSerial; 37 | uint8_t FrameRateMs; 38 | uint8_t StartMs; 39 | uint8_t Data[SBUS_TX_DATA_NB]; 40 | uint8_t Synchro; 41 | public: 42 | SBusTxClass(void); 43 | void serialAttach(Stream *TxStream, uint8_t FrameRateMs = SBUS_TX_NORMAL_TRAME_RATE_MS); 44 | uint8_t isSynchro(uint8_t SynchroClientIdx = 7); /* Default value: 8th Synchro client -> 0 to 6 free for other clients*/ 45 | void rawData(uint8_t Ch, uint16_t RawData); 46 | void width_us(uint8_t Ch, uint16_t Width_us); 47 | void flags(uint8_t FlagId, uint8_t FlagVal); 48 | void sendChannels(void); 49 | /* Rcul support */ 50 | virtual uint8_t RculIsSynchro(uint8_t ClientIdx = RCUL_DEFAULT_CLIENT_IDX); 51 | virtual uint16_t RculGetWidth_us(uint8_t Ch); 52 | virtual void RculSetWidth_us(uint16_t Width_us, uint8_t Ch = 255); 53 | }; 54 | 55 | extern SBusTxClass SBusTx; /* Object externalisation */ 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /libraries/SBusTx/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SBusRx 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SBusTx KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | serialAttach KEYWORD2 15 | sendChannels KEYWORD2 16 | isSynchro KEYWORD2 17 | rawData KEYWORD2 18 | width_us KEYWORD2 19 | flags KEYWORD2 20 | 21 | ####################################### 22 | # Constants (LITERAL1) 23 | ####################################### 24 | -------------------------------------------------------------------------------- /libraries/SBusTx/screenshot.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/SBusTx/screenshot.png -------------------------------------------------------------------------------- /libraries/SrxlRx/SrxlRx.h: -------------------------------------------------------------------------------- 1 | #ifndef SRXLRX_H 2 | #define SRXLRX_H 3 | 4 | #include "Arduino.h" 5 | #include 6 | 7 | #define SRXL_RX_A1_CH_NB 12 8 | #define SRXL_RX_A2_CH_NB 16 9 | 10 | #define SRXL_MAX_RX_CH_NB SRXL_RX_A2_CH_NB 11 | 12 | class SrxlRxClass : public Rcul 13 | { 14 | private: 15 | Stream *RxSerial; 16 | uint8_t StartMs; 17 | uint8_t RxState; 18 | int8_t RxIdx; 19 | uint8_t ChNb; 20 | uint16_t RawData[SRXL_MAX_RX_CH_NB]; 21 | uint16_t Channel[SRXL_MAX_RX_CH_NB]; 22 | uint16_t ComputedCrc; 23 | uint8_t Synchro; 24 | public: 25 | SrxlRxClass(void); 26 | void serialAttach(Stream *RxStream); 27 | void process(void); 28 | uint8_t isSynchro(uint8_t SynchroClientIdx = 7); /* Default value: 8th Synchro client -> 0 to 6 free for other clients*/ 29 | uint16_t rawData(uint8_t Ch); 30 | uint16_t width_us(uint8_t Ch); 31 | uint8_t channelNb(void); 32 | /* Rcul support */ 33 | virtual uint8_t RculIsSynchro(uint8_t ClientIdx = RCUL_DEFAULT_CLIENT_IDX); 34 | virtual uint16_t RculGetWidth_us(uint8_t Ch); 35 | virtual void RculSetWidth_us(uint16_t Width_us, uint8_t Ch = 255); 36 | }; 37 | 38 | extern SrxlRxClass SrxlRx; /* Object externalisation */ 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /libraries/SrxlRx/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SrxlRx 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SrxlRx KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | serialAttach KEYWORD2 15 | process KEYWORD2 16 | isSynchro KEYWORD2 17 | rawData KEYWORD2 18 | width_us KEYWORD2 19 | channelNb KEYWORD2 20 | 21 | ####################################### 22 | # Constants (LITERAL1) 23 | ####################################### 24 | -------------------------------------------------------------------------------- /libraries/TinyDbg/examples/TinyDbgTest/TinyDbgTest.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | char MyGlobalString[] = "Global String"; 4 | 5 | void setup() 6 | { 7 | Serial.begin(115200); 8 | TinyDbg_init(&Serial); /* Attach TinyDbg to the wanted debugging Serial port */ 9 | pinMode(13, OUTPUT); 10 | } 11 | 12 | void loop() 13 | { 14 | static uint16_t Count = 0; 15 | char *myString = (char*)"A standard 'C' string"; 16 | String myString2 = "A String string"; 17 | static uint32_t StartMs = millis(), StartUs = micros(), DurationUs; 18 | float Float = -PI; 19 | char Char = ' '; 20 | TinyDbg_event(); /* May be anywhere in the loop() */ 21 | /* Declare the variables to watch */ 22 | strWATCH(myString); 23 | u16WATCH(Count); 24 | rawWATCH(myString2); 25 | i32WATCH(DurationUs); 26 | f32WATCH(Float); 27 | chrWATCH(Char); 28 | 29 | Count++; 30 | StartUs = micros(); 31 | BREAK(1); /* First breakpoint */ 32 | 33 | Function1(); 34 | Float *= PI; // -PI * -PI: around 10 35 | DurationUs = micros() - StartUs; 36 | BREAK(2); /* Second breakpoint */ 37 | if(millis() - StartMs >= 300) /* Heart beat */ 38 | { 39 | BREAK(3); /* Third breakpoint */ 40 | StartMs = millis(); 41 | digitalWrite(13, !digitalRead(13)); 42 | } 43 | } 44 | 45 | void Function1(void) 46 | { 47 | int16_t LocalVar = 0x1040; 48 | /* Declare the variables to watch */ 49 | i16WATCH(LocalVar); 50 | strWATCH(MyGlobalString); 51 | BREAK(4); /* Fourth breakpoint */ 52 | } 53 | 54 | -------------------------------------------------------------------------------- /libraries/TinyDbg/images/TinyDbgSketch.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/TinyDbg/images/TinyDbgSketch.png -------------------------------------------------------------------------------- /libraries/TinyDbg/images/TinyDbgTermSession.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/RC-Navy/DigisparkArduinoIntegration/11becc17aebb3770239a74240af6b0be843f0288/libraries/TinyDbg/images/TinyDbgTermSession.png -------------------------------------------------------------------------------- /libraries/TinyDbg/library.properties: -------------------------------------------------------------------------------- 1 | name=TinyDbg 2 | version=0.1 3 | author=RC-Navy 4 | maintainer=RC-Navy 5 | sentence=A serial terminal tiny debugger with break point and data watche support. 6 | paragraph=This Debugger is for use with the Serial Monitor provided with the Arduion IDE. You can display data watches and activate breakpoints at will from the Serial Monitor. Breakpoints and data watches have to be compiled in. Data watches can be displayed at will. No timer needed, only a serial port. This Tiny Debugger is an enhanced version of the Debugger of Stephen Payne 7 | category=Uncategorized 8 | url=http:\\p.loussouarn.free.fr\contact.html 9 | architectures=avr 10 | includes=TinyDbg.h 11 | -------------------------------------------------------------------------------- /libraries/TinyOscCal/Readme.md: -------------------------------------------------------------------------------- 1 | TinyOscCal library 2 | ================== 3 | 4 | **TinyOscCal** allows to easily calibrate the internal RC oscillator of ATtint85 and ATtiny84 by using a **SoftSerial** serial port connected to a PC. 5 | 6 | How does it work? 7 | ---------------- 8 | **TinyOscCal** sends messages on a **SoftSerial** serial port by trying incremental values of **OSCCAL** register. The messages will be correct in the Serial Terminal on the PC for contiguous **OSCCAL** values and then will be incorrect for the last values. 9 | Then, restart the ATtiny, and hit "Enter" in the PC when you reached the middle of the correct **OSCCAL** values area: the current **OSCCAL** value will be automatically memorized in the EEPROM at the location defined in the init() method. 10 | 11 | For additional information, please, look at the example folder provided with the **TinyOscCal** library. 12 | 13 | Supported Arduinos: 14 | ------------------ 15 | * **ATtiny85 (Standalone or Digispark)** 16 | * **ATtiny84 (Standalone)** 17 | 18 | 19 | API/methods: 20 | ----------- 21 | * init() 22 | * getEepromStorageSize() 23 | 24 | 25 | Design considerations: 26 | --------------------- 27 | The **TinyOscCal** library only works with the **SoftSerial** library. This one shall be included in the sketch as well. 28 | 29 | 30 | Contact 31 | ------- 32 | 33 | If you have some ideas of enhancement, please contact me by clicking on: [RC Navy](http://p.loussouarn.free.fr/contact.html). 34 | 35 | -------------------------------------------------------------------------------- /libraries/TinyOscCal/TinyOscCal.h: -------------------------------------------------------------------------------- 1 | #ifndef TinyOscCal_h 2 | #define TinyOscCal_h 3 | 4 | /* 5 | English: by RC Navy (2012) 6 | ======= 7 | <_TinyOscCal>: a library to easily calibrate the internal Oscillator of the ATtiny for a reliable usage of . 8 | http://p.loussouarn.free.fr 9 | 10 | Francais: par RC Navy (2012) 11 | ======== 12 | <_TinyOscCal>: une librairie pour calibrer facilement l'oscillateur interne des ATtiny pour un usage fiable des . 13 | http://p.loussouarn.free.fr 14 | */ 15 | 16 | #include "Arduino.h" 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | 23 | enum {TINY_OSC_CAL_INIT_CALIBRATION_NOT_DONE=0, TINY_OSC_CAL_INIT_CALIBRATION_DONE, TINY_OSC_CAL_INIT_CURRENT_FROM_EEPROM}; 24 | 25 | class TinyOscCalClass 26 | { 27 | public: 28 | TinyOscCalClass(); 29 | static uint8_t init(SoftSerial *MySerial, uint8_t EepromStartIdx, int8_t ForceClear = 0); 30 | static uint8_t getEepromStorageSize(); 31 | }; 32 | 33 | extern TinyOscCalClass TinyOscCal; //Object externalisation 34 | 35 | #endif 36 | -------------------------------------------------------------------------------- /libraries/TinyWireM_Digispark/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For TinyWireM 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | ####################################### 10 | # Methods and Functions (KEYWORD2) 11 | ####################################### 12 | 13 | begin KEYWORD2 14 | beginTransmission KEYWORD2 15 | endTransmission KEYWORD2 16 | requestFrom KEYWORD2 17 | send KEYWORD2 18 | receive KEYWORD2 19 | 20 | ####################################### 21 | # Instances (KEYWORD2) 22 | ####################################### 23 | 24 | TinyWireM KEYWORD2 25 | 26 | ####################################### 27 | # Constants (LITERAL1) 28 | ####################################### 29 | 30 | --------------------------------------------------------------------------------