├── .github └── workflows │ └── auto_deploy_docs.yaml ├── .gitignore ├── LICENSE.md ├── README.md ├── arduino ├── hardware │ └── hello-robot │ │ └── samd │ │ ├── README.md │ │ ├── boards.txt │ │ ├── bootloaders │ │ └── zero │ │ │ ├── Makefile │ │ │ ├── README.md │ │ │ ├── board_definitions.h │ │ │ ├── board_definitions_arduino_mkr1000.h │ │ │ ├── board_definitions_arduino_mkrfox1200.h │ │ │ ├── board_definitions_arduino_mkrgsm1400.h │ │ │ ├── board_definitions_arduino_mkrwan1300.h │ │ │ ├── board_definitions_arduino_mkrzero.h │ │ │ ├── board_definitions_arduino_zero.h │ │ │ ├── board_definitions_genuino_mkr1000.h │ │ │ ├── board_definitions_genuino_zero.h │ │ │ ├── board_driver_i2c.c │ │ │ ├── board_driver_i2c.h │ │ │ ├── board_driver_led.c │ │ │ ├── board_driver_led.h │ │ │ ├── board_driver_pmic.c │ │ │ ├── board_driver_pmic.h │ │ │ ├── board_driver_serial.c │ │ │ ├── board_driver_serial.h │ │ │ ├── board_driver_usb.c │ │ │ ├── board_driver_usb.h │ │ │ ├── board_init.c │ │ │ ├── board_startup.c │ │ │ ├── bootloader_samd21x18.ld │ │ │ ├── build_all_bootloaders.sh │ │ │ ├── main.c │ │ │ ├── sam_ba_cdc.c │ │ │ ├── sam_ba_cdc.h │ │ │ ├── sam_ba_monitor.c │ │ │ ├── sam_ba_monitor.h │ │ │ ├── sam_ba_serial.c │ │ │ ├── sam_ba_serial.h │ │ │ ├── sam_ba_usb.c │ │ │ ├── sam_ba_usb.h │ │ │ ├── samd21_sam_ba.atsln │ │ │ ├── samd21_sam_ba.bin │ │ │ ├── samd21_sam_ba.cproj │ │ │ ├── samd21_sam_ba.hex │ │ │ ├── samd21_sam_ba_genuino.bin │ │ │ └── samd21_sam_ba_genuino.hex │ │ ├── cores │ │ └── arduino │ │ │ ├── Arduino.h │ │ │ ├── Client.h │ │ │ ├── HardwareSerial.h │ │ │ ├── IPAddress.cpp │ │ │ ├── IPAddress.h │ │ │ ├── Print.cpp │ │ │ ├── Print.h │ │ │ ├── Printable.h │ │ │ ├── Reset.cpp │ │ │ ├── Reset.h │ │ │ ├── RingBuffer.cpp │ │ │ ├── RingBuffer.h │ │ │ ├── SERCOM.cpp │ │ │ ├── SERCOM.h │ │ │ ├── Server.h │ │ │ ├── Stream.cpp │ │ │ ├── Stream.h │ │ │ ├── Tone.cpp │ │ │ ├── Tone.h │ │ │ ├── USB │ │ │ ├── CDC.cpp │ │ │ ├── PluggableUSB.cpp │ │ │ ├── PluggableUSB.h │ │ │ ├── SAMD21_USBDevice.h │ │ │ ├── USBAPI.h │ │ │ ├── USBCore.cpp │ │ │ ├── USBCore.h │ │ │ ├── USBDesc.h │ │ │ ├── USB_host.h │ │ │ ├── samd21_host.c │ │ │ └── samd21_host.h │ │ │ ├── Uart.cpp │ │ │ ├── Uart.h │ │ │ ├── Udp.h │ │ │ ├── WCharacter.h │ │ │ ├── WInterrupts.c │ │ │ ├── WInterrupts.h │ │ │ ├── WMath.cpp │ │ │ ├── WMath.h │ │ │ ├── WString.cpp │ │ │ ├── WString.h │ │ │ ├── WVariant.h │ │ │ ├── abi.cpp │ │ │ ├── avr │ │ │ ├── dtostrf.c │ │ │ ├── dtostrf.h │ │ │ ├── interrupt.h │ │ │ ├── io.h │ │ │ └── pgmspace.h │ │ │ ├── binary.h │ │ │ ├── cortex_handlers.c │ │ │ ├── delay.c │ │ │ ├── delay.h │ │ │ ├── hooks.c │ │ │ ├── itoa.c │ │ │ ├── itoa.h │ │ │ ├── main.cpp │ │ │ ├── new.cpp │ │ │ ├── pulse.c │ │ │ ├── pulse.h │ │ │ ├── pulse_asm.S │ │ │ ├── startup.c │ │ │ ├── wiring.c │ │ │ ├── wiring.h │ │ │ ├── wiring_analog.c │ │ │ ├── wiring_analog.h │ │ │ ├── wiring_constants.h │ │ │ ├── wiring_digital.c │ │ │ ├── wiring_digital.h │ │ │ ├── wiring_private.c │ │ │ ├── wiring_private.h │ │ │ ├── wiring_shift.c │ │ │ └── wiring_shift.h │ │ ├── drivers │ │ ├── Adafruit_Circuit_Playground_Express.inf │ │ ├── arduino-samd.cat │ │ ├── arduino-samd.inf │ │ ├── cdc_vista.cat │ │ ├── dpinst-amd64.exe │ │ ├── dpinst-x86.exe │ │ ├── genuino-samd.cat │ │ └── genuino-samd.inf │ │ ├── keywords.txt │ │ ├── libraries │ │ ├── HID │ │ │ ├── HID.cpp │ │ │ ├── HID.h │ │ │ ├── keywords.txt │ │ │ └── library.properties │ │ ├── I2S │ │ │ ├── examples │ │ │ │ ├── InputSerialPlotter │ │ │ │ │ └── InputSerialPlotter.ino │ │ │ │ └── SimpleTone │ │ │ │ │ └── SimpleTone.ino │ │ │ ├── keywords.txt │ │ │ ├── library.properties │ │ │ └── src │ │ │ │ ├── I2S.cpp │ │ │ │ ├── I2S.h │ │ │ │ └── utility │ │ │ │ ├── DMA.cpp │ │ │ │ ├── DMA.h │ │ │ │ ├── I2SDoubleBuffer.cpp │ │ │ │ ├── I2SDoubleBuffer.h │ │ │ │ └── SAMD21_I2SDevice.h │ │ ├── SAMD_AnalogCorrection │ │ │ ├── examples │ │ │ │ └── CorrectADCResponse │ │ │ │ │ └── CorrectADCResponse.ino │ │ │ ├── library.properties │ │ │ └── src │ │ │ │ ├── SAMD_AnalogCorrection.cpp │ │ │ │ └── SAMD_AnalogCorrection.h │ │ ├── SDU │ │ │ ├── examples │ │ │ │ └── Usage │ │ │ │ │ └── Usage.ino │ │ │ ├── keywords.txt │ │ │ ├── library.properties │ │ │ └── src │ │ │ │ ├── SDU.cpp │ │ │ │ ├── SDU.h │ │ │ │ └── boot │ │ │ │ ├── mkr1000.h │ │ │ │ ├── mkrfox1200.h │ │ │ │ ├── mkrgsm1400.h │ │ │ │ ├── mkrwan1300.h │ │ │ │ ├── mkrzero.h │ │ │ │ └── zero.h │ │ ├── SPI │ │ │ ├── SPI.cpp │ │ │ ├── SPI.h │ │ │ ├── examples │ │ │ │ ├── BarometricPressureSensor │ │ │ │ │ └── BarometricPressureSensor.ino │ │ │ │ └── DigitalPotControl │ │ │ │ │ └── DigitalPotControl.ino │ │ │ ├── keywords.txt │ │ │ └── library.properties │ │ ├── USBHost │ │ │ ├── examples │ │ │ │ ├── ADKTerminalTest │ │ │ │ │ └── ADKTerminalTest.ino │ │ │ │ ├── KeyboardController │ │ │ │ │ └── KeyboardController.ino │ │ │ │ ├── MouseController │ │ │ │ │ └── MouseController.ino │ │ │ │ └── USB_desc │ │ │ │ │ ├── USB_desc.ino │ │ │ │ │ └── pgmstrings.h │ │ │ ├── keywords.txt │ │ │ ├── library.properties │ │ │ └── src │ │ │ │ ├── KeyboardController.cpp │ │ │ │ ├── KeyboardController.h │ │ │ │ ├── MouseController.cpp │ │ │ │ ├── MouseController.h │ │ │ │ ├── Usb.cpp │ │ │ │ ├── Usb.h │ │ │ │ ├── UsbCore.h │ │ │ │ ├── address.h │ │ │ │ ├── adk.cpp │ │ │ │ ├── adk.h │ │ │ │ ├── confdescparser.h │ │ │ │ ├── hexdump.h │ │ │ │ ├── hid.cpp │ │ │ │ ├── hid.h │ │ │ │ ├── hidboot.cpp │ │ │ │ ├── hidboot.h │ │ │ │ ├── hidescriptorparser.cpp │ │ │ │ ├── hidescriptorparser.h │ │ │ │ ├── hiduniversal.cpp │ │ │ │ ├── hiduniversal.h │ │ │ │ ├── hidusagestr.h │ │ │ │ ├── macros.h │ │ │ │ ├── message.cpp │ │ │ │ ├── message.h │ │ │ │ ├── parsetools.cpp │ │ │ │ ├── parsetools.h │ │ │ │ ├── printhex.h │ │ │ │ ├── sink_parser.h │ │ │ │ ├── usb_ch9.h │ │ │ │ ├── usbhub.cpp │ │ │ │ └── usbhub.h │ │ └── Wire │ │ │ ├── Wire.cpp │ │ │ ├── Wire.h │ │ │ ├── examples │ │ │ ├── SFRRanger_reader │ │ │ │ └── SFRRanger_reader.ino │ │ │ ├── digital_potentiometer │ │ │ │ └── digital_potentiometer.ino │ │ │ ├── master_reader │ │ │ │ └── master_reader.ino │ │ │ ├── master_writer │ │ │ │ └── master_writer.ino │ │ │ ├── slave_receiver │ │ │ │ └── slave_receiver.ino │ │ │ └── slave_sender │ │ │ │ └── slave_sender.ino │ │ │ ├── keywords.txt │ │ │ └── library.properties │ │ ├── platform.txt │ │ ├── post_install.bat │ │ ├── programmers.txt │ │ └── variants │ │ ├── hello_pimu │ │ ├── debug_scripts │ │ │ └── variant.gdb │ │ ├── linker_scripts │ │ │ └── gcc │ │ │ │ ├── flash_with_bootloader.ld │ │ │ │ └── flash_without_bootloader.ld │ │ ├── openocd_scripts │ │ │ └── arduino_zero.cfg │ │ ├── pins_arduino.h │ │ ├── variant.cpp │ │ ├── variant.h │ │ └── variant.hx │ │ ├── hello_stepper │ │ ├── debug_scripts │ │ │ └── variant.gdb │ │ ├── linker_scripts │ │ │ └── gcc │ │ │ │ ├── flash_with_bootloader.ld │ │ │ │ └── flash_without_bootloader.ld │ │ ├── openocd_scripts │ │ │ └── arduino_zero.cfg │ │ ├── pins_arduino.h │ │ ├── variant.cpp │ │ └── variant.h │ │ └── hello_wacc │ │ ├── debug_scripts │ │ └── variant.gdb │ │ ├── linker_scripts │ │ └── gcc │ │ │ ├── flash_with_bootloader.ld │ │ │ └── flash_without_bootloader.ld │ │ ├── openocd_scripts │ │ └── arduino_zero.cfg │ │ ├── pins_arduino.h │ │ ├── variant.cpp │ │ ├── variant.h │ │ └── variant.hx ├── hello_pimu │ ├── AnalogManager.cpp │ ├── AnalogManager.h │ ├── BeepManager.cpp │ ├── BeepManager.h │ ├── ChargerManager.cpp │ ├── ChargerManager.h │ ├── Common.h │ ├── IMU.cpp │ ├── IMU.h │ ├── IMU_BNO085.cpp │ ├── IMU_BNO085.h │ ├── IMU_FXOS8700_FXAS21002.cpp │ ├── IMU_FXOS8700_FXAS21002.h │ ├── LightBarManager.cpp │ ├── LightBarManager.h │ ├── Pimu.cpp │ ├── Pimu.h │ ├── README.md │ ├── RunstopManager.cpp │ ├── RunstopManager.h │ ├── SyncManager.cpp │ ├── SyncManager.h │ ├── TimeManager.cpp │ ├── TimeManager.h │ ├── TraceManager.cpp │ ├── TraceManager.h │ └── hello_pimu.ino ├── hello_stepper │ ├── AnalogManager.cpp │ ├── AnalogManager.h │ ├── Common.h │ ├── Controller.cpp │ ├── Controller.h │ ├── HelloController.cpp │ ├── HelloController.h │ ├── MotionGenerator.cpp │ ├── MotionGenerator.h │ ├── Parameters.cpp │ ├── Parameters.h │ ├── README.md │ ├── State.cpp │ ├── State.h │ ├── SyncManager.cpp │ ├── SyncManager.h │ ├── TimeManager.cpp │ ├── TimeManager.h │ ├── TraceManager.cpp │ ├── TraceManager.h │ ├── TrajectoryManager.cpp │ ├── TrajectoryManager.h │ ├── Utils.cpp │ ├── Utils.h │ ├── VelocityGenerator.cpp │ ├── VelocityGenerator.h │ ├── analogFastWrite.c │ ├── analogFastWrite.h │ ├── hello_stepper.ino │ └── sketch.json ├── hello_wacc │ ├── Accel.cpp │ ├── Accel.h │ ├── Common.h │ ├── README.md │ ├── TimeManager.cpp │ ├── TimeManager.h │ ├── TraceManager.cpp │ ├── TraceManager.h │ ├── Wacc.cpp │ ├── Wacc.h │ └── hello_wacc.ino └── libraries │ ├── Adafruit_ADXL343 │ ├── Adafruit_ADXL343.cpp │ ├── Adafruit_ADXL343.h │ ├── README.md │ ├── examples │ │ ├── interrupts │ │ │ └── interrupts.ino │ │ ├── sensortest │ │ │ └── sensortest.ino │ │ └── singletap │ │ │ └── singletap.ino │ ├── library.properties │ └── license.txt │ ├── Adafruit_AHRS │ ├── Adafruit_Sensor_Set.h │ ├── Adafruit_Simple_AHRS.cpp │ ├── Adafruit_Simple_AHRS.h │ ├── Madgwick.cpp │ ├── Madgwick.h │ ├── Mahony.cpp │ ├── Mahony.h │ ├── examples │ │ ├── ahrs_10dof │ │ │ └── ahrs_10dof.ino │ │ ├── ahrs_9dof │ │ │ └── ahrs_9dof.ino │ │ ├── ahrs_calibration │ │ │ └── ahrs_calibration.ino │ │ ├── ahrs_calibration_ble │ │ │ ├── ArdPrintf.h │ │ │ ├── BluefruitConfig.h │ │ │ └── ahrs_calibration_ble.ino │ │ ├── ahrs_calibration_usb │ │ │ └── ahrs_calibration_usb.ino │ │ ├── ahrs_fusion_ble │ │ │ ├── BluefruitConfig.h │ │ │ └── ahrs_fusion_ble.ino │ │ ├── ahrs_fusion_usb │ │ │ ├── ahrs_fusion_usb.ino │ │ │ └── sample_config_data.png │ │ ├── ahrs_lsm9ds0 │ │ │ └── ahrs_lsm9ds0.ino │ │ └── ahrs_mahony │ │ │ ├── ahrs_mahony.ino │ │ │ └── sample_config_data.png │ ├── library.properties │ └── processing │ │ ├── bunnyrotate │ │ ├── bunnyrotate.pde │ │ └── data │ │ │ ├── bunny.mtl │ │ │ └── bunny.obj │ │ └── bunnyrotate_ahrs_fusion_usb │ │ ├── bunnyrotate_ahrs_fusion_usb.pde │ │ └── data │ │ ├── bunny.mtl │ │ └── bunny.obj │ ├── Adafruit_FXAS21002C │ ├── Adafruit_FXAS21002C.cpp │ ├── Adafruit_FXAS21002C.h │ ├── LICENSE │ ├── README.md │ ├── examples │ │ └── sensorapi │ │ │ └── sensorapi.pde │ └── library.properties │ ├── Adafruit_FXOS8700 │ ├── Adafruit_FXOS8700.cpp │ ├── Adafruit_FXOS8700.h │ ├── LICENSE │ ├── README.md │ ├── examples │ │ └── sensorapi │ │ │ └── sensorapi.pde │ └── library.properties │ ├── Adafruit_NeoPixel │ ├── Adafruit_NeoPixel.cpp │ ├── Adafruit_NeoPixel.h │ ├── CONTRIBUTING.md │ ├── COPYING │ ├── README.md │ ├── esp.c │ ├── esp8266.c │ ├── examples │ │ ├── RGBWstrandtest │ │ │ ├── .esp8266.test.skip │ │ │ ├── .trinket.test.skip │ │ │ └── RGBWstrandtest.ino │ │ ├── StrandtestArduinoBLE │ │ │ ├── .none.test.only │ │ │ └── StrandtestArduinoBLE.ino │ │ ├── StrandtestArduinoBLECallback │ │ │ ├── .none.test.only │ │ │ └── StrandtestArduinoBLECallback.ino │ │ ├── StrandtestBLE │ │ │ ├── .none.test.only │ │ │ ├── BLESerial.cpp │ │ │ ├── BLESerial.h │ │ │ └── StrandtestBLE.ino │ │ ├── StrandtestBLE_nodelay │ │ │ ├── .none.test.only │ │ │ ├── BLESerial.cpp │ │ │ ├── BLESerial.h │ │ │ └── StrandtestBLE_nodelay.ino │ │ ├── buttoncycler │ │ │ ├── .esp8266.test.skip │ │ │ └── buttoncycler.ino │ │ ├── simple │ │ │ ├── .esp8266.test.skip │ │ │ └── simple.ino │ │ ├── simple_new_operator │ │ │ ├── .esp8266.test.skip │ │ │ └── simple_new_operator.ino │ │ ├── strandtest │ │ │ ├── .esp8266.test.skip │ │ │ └── strandtest.ino │ │ ├── strandtest_nodelay │ │ │ ├── .esp8266.test.skip │ │ │ └── strandtest_nodelay.ino │ │ └── strandtest_wheel │ │ │ ├── .esp8266.test.skip │ │ │ └── strandtest_wheel.ino │ ├── kendyte_k210.c │ ├── keywords.txt │ ├── library.properties │ └── rp2040_pio.h │ ├── Adafruit_NeoPixel_ZeroDMA │ ├── Adafruit_NeoPixel_ZeroDMA.cpp │ ├── Adafruit_NeoPixel_ZeroDMA.h │ ├── LICENSE │ ├── README.md │ ├── bittable.h │ ├── examples │ │ └── strandtest │ │ │ └── strandtest.ino │ ├── extras │ │ └── pinfinder.py │ ├── keywords.txt │ ├── library.properties │ └── pins.h │ ├── Adafruit_Unified_Sensor │ ├── Adafruit_Sensor.h │ ├── README.md │ └── library.properties │ ├── Adafruit_ZeroDMA │ ├── Adafruit_ZeroDMA.cpp │ ├── Adafruit_ZeroDMA.h │ ├── LICENSE │ ├── README.md │ ├── examples │ │ ├── zerodma_adc │ │ │ ├── .zero.test.only │ │ │ └── zerodma_adc.ino │ │ ├── zerodma_memcpy │ │ │ └── zerodma_memcpy.ino │ │ ├── zerodma_spi1 │ │ │ └── zerodma_spi1.ino │ │ └── zerodma_spi2 │ │ │ └── zerodma_spi2.ino │ ├── library.properties │ └── utility │ │ └── dma.h │ ├── FlashStorage │ ├── examples │ │ ├── EmulateEEPROM │ │ │ └── EmulateEEPROM.ino │ │ ├── FlashStoreAndRetrieve │ │ │ └── FlashStoreAndRetrieve.ino │ │ └── StoreNameAndSurname │ │ │ └── StoreNameAndSurname.ino │ ├── library.json │ ├── library.properties │ ├── readme.md │ └── src │ │ ├── FlashAsEEPROM.cpp │ │ ├── FlashAsEEPROM.h │ │ ├── FlashStorage.cpp │ │ └── FlashStorage.h │ ├── Hello_Serial_Transport │ ├── COBS.h │ ├── Crc16.h │ ├── Transport.cpp │ ├── Transport.h │ └── library.properties │ ├── SparkFun_BNO080_Cortex_Based_IMU │ ├── CONTRIBUTING.md │ ├── ISSUE_TEMPLATE.md │ ├── LICENSE.md │ ├── README.md │ ├── examples │ │ ├── Example1-RotationVector │ │ │ └── Example1-RotationVector.ino │ │ ├── Example10-PrintPacket │ │ │ └── Example10-PrintPacket.ino │ │ ├── Example11-AdvancedConfig │ │ │ └── Example11-AdvancedConfig.ino │ │ ├── Example12-LinearAccelerometer │ │ │ └── Example12-LinearAccelerometer.ino │ │ ├── Example13-TimeStamp │ │ │ └── Example13-TimeStamp.ino │ │ ├── Example14-TwoSensors │ │ │ └── Example14-TwoSensors.ino │ │ ├── Example15-RawReadings │ │ │ └── Example15-RawReadings.ino │ │ ├── Example16-GyroIntegratedRotationVector │ │ │ └── Example16-GyroIntegratedRotationVector.ino │ │ ├── Example17-EulerAngles │ │ │ └── Example17-EulerAngles.ino │ │ ├── Example18-AccessMultiple │ │ │ └── Example18-AccessMultiple.ino │ │ ├── Example19-Interrupt │ │ │ └── Example19-Interrupt.ino │ │ ├── Example2-Accelerometer │ │ │ └── Example2-Accelerometer.ino │ │ ├── Example20-Sleep │ │ │ └── Example20-Sleep.ino │ │ ├── Example21-ResetCheck │ │ │ └── Example21-ResetCheck.ino │ │ ├── Example22-Tare │ │ │ └── Example22-Tare.ino │ │ ├── Example23-Gravity │ │ │ └── Example23-Gravity.ino │ │ ├── Example24-UncalibratedGyro │ │ │ └── Example24-UncalibratedGyro.ino │ │ ├── Example3-Gyro │ │ │ └── Example3-Gyro.ino │ │ ├── Example4-Magnetometer │ │ │ └── Example4-Magnetometer.ino │ │ ├── Example5-StepCounter │ │ │ └── Example5-StepCounter.ino │ │ ├── Example6-MetaData │ │ │ └── Example6-MetaData.ino │ │ ├── Example7-StabilityClassifier │ │ │ └── Example7-StabilityClassifier.ino │ │ ├── Example8-ActivityClassifier │ │ │ └── Example8-ActivityClassifier.ino │ │ ├── Example9-Calibrate │ │ │ └── Example9-Calibrate.ino │ │ └── SPI │ │ │ ├── Example1-RotationVector │ │ │ └── Example1-RotationVector.ino │ │ │ ├── Example12-LinearAccelerometer │ │ │ └── Example12-LinearAccelerometer.ino │ │ │ ├── Example17-EulerAngles │ │ │ └── Example17-EulerAngles.ino │ │ │ ├── Example18-AccessMultiple │ │ │ └── Example18-AccessMultiple.ino │ │ │ └── Example3-AccelAndRotationVector │ │ │ └── Example3-AccelAndRotationVector.ino │ ├── keywords.txt │ ├── library.properties │ └── src │ │ ├── SparkFun_BNO080_Arduino_Library.cpp │ │ └── SparkFun_BNO080_Arduino_Library.h │ ├── library.properties │ └── readme.txt ├── docs ├── extra.css ├── images │ ├── HelloRobotLogoBar.png │ ├── arduino-1.png │ ├── arduino-2.png │ ├── arduino-3.png │ ├── arduino-4.png │ ├── banner.png │ ├── data_pipeline.png │ ├── hello_robot_favicon.png │ ├── hello_robot_logo_light.png │ ├── wacc_i2c.png │ ├── wacc_metro.png │ ├── wacc_serial_loopback.png │ ├── wacc_spi.png │ ├── wrist_expansion_header.png │ └── wrist_expansion_schematic_rs.png ├── tutorial_data_transfer.md ├── tutorial_i2c_sensor.md ├── tutorial_serial_sensor.md ├── tutorial_spi_sensor.md ├── tutorial_updating_firmware.md ├── tutorial_wacc_emulation.md ├── tutorials │ ├── arduino │ │ ├── hello_wacc_calc │ │ │ ├── Accel.cpp │ │ │ ├── Accel.h │ │ │ ├── Common.h │ │ │ ├── Wacc.cpp │ │ │ ├── Wacc.h │ │ │ └── hello_wacc_calc.ino │ │ ├── hello_wacc_i2c │ │ │ ├── Accel.cpp │ │ │ ├── Accel.h │ │ │ ├── Common.h │ │ │ ├── Wacc.cpp │ │ │ ├── Wacc.h │ │ │ └── hello_wacc_i2c.ino │ │ ├── hello_wacc_serial │ │ │ ├── Accel.cpp │ │ │ ├── Accel.h │ │ │ ├── Common.h │ │ │ ├── Wacc.cpp │ │ │ ├── Wacc.h │ │ │ └── hello_wacc_serial.ino │ │ ├── hello_wacc_spi │ │ │ ├── Accel.cpp │ │ │ ├── Accel.h │ │ │ ├── Common.h │ │ │ ├── Wacc.cpp │ │ │ ├── Wacc.h │ │ │ └── hello_wacc_spi.ino │ │ ├── zero_wacc_i2c │ │ │ └── zero_wacc_i2c.ino │ │ └── zero_wacc_spi │ │ │ └── zero_wacc_spi.ino │ └── python │ │ ├── stretch_wacc_calc_jog.py │ │ ├── stretch_wacc_serial_jog.py │ │ ├── wacc_calc.py │ │ └── wacc_serial_ext.py └── tutorials_overview.md ├── hardware └── hello_stepper │ └── guthrie │ ├── Stretch_RE1_Stepper_BOM_V1.pdf │ ├── Stretch_RE1_Stepper_V1.pdf │ └── gerber │ ├── Stretch_RE1_Stepper_PCB_V1.GBL │ ├── Stretch_RE1_Stepper_PCB_V1.GBO │ ├── Stretch_RE1_Stepper_PCB_V1.GBP │ ├── Stretch_RE1_Stepper_PCB_V1.GTL │ ├── Stretch_RE1_Stepper_PCB_V1.GTO │ └── Stretch_RE1_Stepper_PCB_V1.GTP └── mkdocs.yml /.github/workflows/auto_deploy_docs.yaml: -------------------------------------------------------------------------------- 1 | name: Auto Deploy Docs 2 | run-name: Edit by ${{ github.actor }} triggered docs deployment 3 | on: 4 | push: 5 | branches: 6 | - 'master' 7 | paths: 8 | - '**.md' 9 | jobs: 10 | Dispatch-Deploy-Workflow: 11 | runs-on: ubuntu-latest 12 | steps: 13 | 14 | - name: Print out debug info 15 | run: echo "Repo ${{ github.repository }} | Branch ${{ github.ref }} | Runner ${{ runner.os }} | Event ${{ github.event_name }}" 16 | 17 | - name: Dispatch deploy workflow 18 | uses: actions/github-script@v6 19 | with: 20 | github-token: ${{ secrets.GHA_CROSSREPO_WORKFLOW_TOKEN }} 21 | script: | 22 | await github.rest.actions.createWorkflowDispatch({ 23 | owner: 'hello-robot', 24 | repo: 'hello-robot.github.io', 25 | workflow_id: 'auto_deploy.yaml', 26 | ref: '0.3', 27 | }) 28 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # Byte-compiled / optimized / DLL files 2 | __pycache__/ 3 | *.py[cod] 4 | *$py.class 5 | 6 | # C extensions 7 | *.so 8 | 9 | # Distribution / packaging 10 | .Python 11 | env/ 12 | build/ 13 | develop-eggs/ 14 | dist/ 15 | downloads/ 16 | eggs/ 17 | .eggs/ 18 | lib/ 19 | lib64/ 20 | parts/ 21 | sdist/ 22 | var/ 23 | wheels/ 24 | *.egg-info/ 25 | .installed.cfg 26 | *.egg 27 | 28 | #Hello Body 29 | *.pyc 30 | 31 | # PyInstaller 32 | # Usually these files are written by a python script from a template 33 | # before PyInstaller builds the exe, so as to inject date/other infos into it. 34 | *.manifest 35 | *.spec 36 | 37 | # Installer logs 38 | pip-log.txt 39 | pip-delete-this-directory.txt 40 | 41 | # Unit test / coverage reports 42 | htmlcov/ 43 | .tox/ 44 | .coverage 45 | .coverage.* 46 | .cache 47 | nosetests.xml 48 | coverage.xml 49 | *.cover 50 | .hypothesis/ 51 | 52 | # Translations 53 | *.mo 54 | *.pot 55 | 56 | # Django stuff: 57 | *.log 58 | local_settings.py 59 | 60 | # Flask stuff: 61 | instance/ 62 | .webassets-cache 63 | 64 | # Scrapy stuff: 65 | .scrapy 66 | 67 | # Sphinx documentation 68 | docs/_build/ 69 | 70 | # PyBuilder 71 | target/ 72 | 73 | # Jupyter Notebook 74 | .ipynb_checkpoints 75 | 76 | # pyenv 77 | .python-version 78 | 79 | # celery beat schedule file 80 | celerybeat-schedule 81 | 82 | # SageMath parsed files 83 | *.sage.py 84 | 85 | # dotenv 86 | .env 87 | 88 | # virtualenv 89 | .venv 90 | venv/ 91 | ENV/ 92 | 93 | # Spyder project settings 94 | .spyderproject 95 | .spyproject 96 | 97 | # Rope project settings 98 | .ropeproject 99 | 100 | # mkdocs documentation 101 | /site 102 | 103 | # mypy 104 | .mypy_cache/ 105 | 106 | # vscode 107 | .vscode/ 108 | 109 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/bootloaders/zero/board_definitions.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. 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. 13 | See the GNU 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 | #if defined(BOARD_ID_arduino_zero) 21 | #include "board_definitions_arduino_zero.h" 22 | #elif defined(BOARD_ID_genuino_zero) 23 | #include "board_definitions_genuino_zero.h" 24 | #elif defined(BOARD_ID_arduino_mkr1000) 25 | #include "board_definitions_arduino_mkr1000.h" 26 | #elif defined(BOARD_ID_genuino_mkr1000) 27 | #include "board_definitions_genuino_mkr1000.h" 28 | #elif defined(BOARD_ID_arduino_mkrzero) 29 | #include "board_definitions_arduino_mkrzero.h" 30 | #elif defined(BOARD_ID_arduino_mkrfox1200) 31 | #include "board_definitions_arduino_mkrfox1200.h" 32 | #elif defined(BOARD_ID_arduino_mkrgsm1400) 33 | #include "board_definitions_arduino_mkrgsm1400.h" 34 | #elif defined(BOARD_ID_arduino_mkrwan1300) 35 | #include "board_definitions_arduino_mkrwan1300.h" 36 | #else 37 | #error You must define a BOARD_ID and add the corresponding definitions in board_definitions.h 38 | #endif 39 | 40 | // Common definitions 41 | // ------------------ 42 | 43 | #define BOOT_PIN_MASK (1U << (BOOT_LOAD_PIN & 0x1f)) 44 | 45 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/bootloaders/zero/board_driver_i2c.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. 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. 13 | See the GNU 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 _BOARD_DRIVER_I2C_ 21 | #define _BOARD_DRIVER_I2C_ 22 | 23 | #include 24 | #include 25 | #include "board_definitions.h" 26 | 27 | void i2c_init(uint32_t baud); 28 | void i2c_end(); 29 | uint8_t i2c_requestFrom(uint8_t address, uint8_t quantity, bool stopBit); 30 | void i2c_beginTransmission(uint8_t address); 31 | uint8_t i2c_endTransmission(bool stopBit); 32 | uint8_t i2c_write(uint8_t ucData); 33 | 34 | 35 | #endif // _BOARD_DRIVER_I2C_ 36 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/bootloaders/zero/board_driver_led.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. 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. 13 | See the GNU 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 | #include "board_driver_led.h" 21 | 22 | volatile uint8_t ledKeepValue = 0; 23 | volatile uint8_t ledTargetValue = 20; 24 | volatile int8_t ledDirection = 1; 25 | 26 | inline void LED_pulse() 27 | { 28 | if (ledKeepValue == 0) { 29 | ledTargetValue += ledDirection; 30 | LED_toggle(); 31 | } 32 | ledKeepValue ++; 33 | 34 | if (ledTargetValue > 240 || ledTargetValue < 10) { 35 | ledDirection = -ledDirection; 36 | ledTargetValue += ledDirection; 37 | } 38 | 39 | if (ledKeepValue == ledTargetValue) { 40 | LED_toggle(); 41 | } 42 | } 43 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/bootloaders/zero/board_driver_pmic.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. 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. 13 | See the GNU 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 _BOARD_DRIVER_PMIC_ 21 | #define _BOARD_DRIVER_PMIC_ 22 | 23 | #include 24 | #include 25 | #include "board_definitions.h" 26 | 27 | //Default PMIC (BQ24195) I2C address 28 | #define PMIC_ADDRESS 0x6B 29 | 30 | // Register address definitions 31 | #define INPUT_SOURCE_REGISTER 0x00 32 | #define POWERON_CONFIG_REGISTER 0x01 33 | #define CHARGE_CURRENT_CONTROL_REGISTER 0x02 34 | #define PRECHARGE_CURRENT_CONTROL_REGISTER 0x03 35 | #define CHARGE_VOLTAGE_CONTROL_REGISTER 0x04 36 | #define CHARGE_TIMER_CONTROL_REGISTER 0x05 37 | #define THERMAL_REG_CONTROL_REGISTER 0x06 38 | #define MISC_CONTROL_REGISTER 0x07 39 | #define SYSTEM_STATUS_REGISTER 0x08 40 | #define FAULT_REGISTER 0x09 41 | #define PMIC_VERSION_REGISTER 0x0A 42 | 43 | void configure_pmic(); 44 | 45 | #endif // _BOARD_DRIVER_PMIC_ 46 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/bootloaders/zero/board_driver_usb.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | Copyright (c) 2015 Atmel Corporation/Thibaut VIARD. 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. 13 | See the GNU 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 _BOARD_DRIVER_USB_H_ 21 | #define _BOARD_DRIVER_USB_H_ 22 | 23 | #include "sam_ba_cdc.h" 24 | 25 | extern UsbDeviceDescriptor usb_endpoint_table[MAX_EP]; 26 | extern uint8_t udd_ep_out_cache_buffer[2][64]; //1 for CTRL, 1 for BULK 27 | extern uint8_t udd_ep_in_cache_buffer[2][64]; //1 for CTRL, 1 for BULK 28 | 29 | P_USB_CDC USB_Open(P_USB_CDC pCdc, Usb *pUsb); 30 | 31 | void USB_Init(void); 32 | 33 | uint32_t USB_Write(Usb *pUsb, const char *pData, uint32_t length, uint8_t ep_num); 34 | uint32_t USB_Read(Usb *pUsb, char *pData, uint32_t length); 35 | uint32_t USB_Read_blocking(Usb *pUsb, char *pData, uint32_t length); 36 | 37 | uint8_t USB_IsConfigured(P_USB_CDC pCdc); 38 | 39 | void USB_SendStall(Usb *pUsb, bool direction_in); 40 | void USB_SendZlp(Usb *pUsb); 41 | 42 | void USB_SetAddress(Usb *pUsb, uint16_t wValue); 43 | void USB_Configure(Usb *pUsb); 44 | 45 | #endif // _BOARD_DRIVER_USB_H_ 46 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/bootloaders/zero/build_all_bootloaders.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash -ex 2 | 3 | BOARD_ID=arduino_zero NAME=samd21_sam_ba make clean all 4 | 5 | BOARD_ID=genuino_zero NAME=samd21_sam_ba_genuino make clean all 6 | 7 | BOARD_ID=arduino_mkr1000 NAME=samd21_sam_ba_arduino_mkr1000 make clean all 8 | mv -v samd21_sam_ba_arduino_mkr1000.* ../mkr1000/ 9 | 10 | BOARD_ID=genuino_mkr1000 NAME=samd21_sam_ba_genuino_mkr1000 make clean all 11 | mv -v samd21_sam_ba_genuino_mkr1000.* ../mkr1000/ 12 | 13 | BOARD_ID=arduino_mkrzero NAME=samd21_sam_ba_arduino_mkrzero make clean all 14 | mv -v samd21_sam_ba_arduino_mkrzero.* ../mkrzero/ 15 | 16 | BOARD_ID=arduino_mkrfox1200 NAME=samd21_sam_ba_arduino_mkrfox1200 make clean all 17 | mv -v samd21_sam_ba_arduino_mkrfox1200.* ../mkrfox1200/ 18 | 19 | BOARD_ID=arduino_mkrgsm1400 NAME=samd21_sam_ba_arduino_mkrgsm1400 make clean all 20 | mv -v samd21_sam_ba_arduino_mkrgsm1400.* ../mkrgsm1400/ 21 | 22 | BOARD_ID=arduino_mkrwan1300 NAME=samd21_sam_ba_arduino_mkrwan1300 make clean all 23 | mv -v samd21_sam_ba_arduino_mkrwan1300.* ../mkrwan1300/ 24 | 25 | echo Done building bootloaders! 26 | 27 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/bootloaders/zero/samd21_sam_ba.atsln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Atmel Studio Solution File, Format Version 11.00 4 | VisualStudioVersion = 14.0.23107.0 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{54F91283-7BC4-4236-8FF9-10F437C3AD48}") = "samd21_sam_ba", "samd21_sam_ba.cproj", "{DCE6C7E3-EE26-4D79-826B-08594B9AD897}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|ARM = Debug|ARM 11 | Release|ARM = Release|ARM 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.ActiveCfg = Debug|ARM 15 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Debug|ARM.Build.0 = Debug|ARM 16 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.ActiveCfg = Release|ARM 17 | {DCE6C7E3-EE26-4D79-826B-08594B9AD897}.Release|ARM.Build.0 = Release|ARM 18 | EndGlobalSection 19 | GlobalSection(SolutionProperties) = preSolution 20 | HideSolutionNode = FALSE 21 | EndGlobalSection 22 | EndGlobal 23 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/bootloaders/zero/samd21_sam_ba.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/hardware/hello-robot/samd/bootloaders/zero/samd21_sam_ba.bin -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/bootloaders/zero/samd21_sam_ba_genuino.bin: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/hardware/hello-robot/samd/bootloaders/zero/samd21_sam_ba_genuino.bin -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/Client.h: -------------------------------------------------------------------------------- 1 | /* 2 | Client.h - Base class that provides Client 3 | Copyright (c) 2011 Adrian McEwen. 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 client_h 21 | #define client_h 22 | #include "Print.h" 23 | #include "Stream.h" 24 | #include "IPAddress.h" 25 | 26 | class Client : public Stream { 27 | 28 | public: 29 | virtual int connect(IPAddress ip, uint16_t port) =0; 30 | virtual int connect(const char *host, uint16_t port) =0; 31 | virtual size_t write(uint8_t) =0; 32 | virtual size_t write(const uint8_t *buf, size_t size) =0; 33 | virtual int available() = 0; 34 | virtual int read() = 0; 35 | virtual int read(uint8_t *buf, size_t size) = 0; 36 | virtual int peek() = 0; 37 | virtual void flush() = 0; 38 | virtual void stop() = 0; 39 | virtual uint8_t connected() = 0; 40 | virtual operator bool() = 0; 41 | protected: 42 | uint8_t* rawIPAddress(IPAddress& addr) { return addr.raw_address(); }; 43 | }; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/Printable.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef Printable_h 20 | #define Printable_h 21 | 22 | #include 23 | 24 | class Print; 25 | 26 | /** The Printable class provides a way for new classes to allow themselves to be printed. 27 | By deriving from Printable and implementing the printTo method, it will then be possible 28 | for users to print out instances of this class by passing them into the usual 29 | Print::print and Print::println methods. 30 | */ 31 | 32 | class Printable 33 | { 34 | public: 35 | virtual size_t printTo(Print& p) const = 0; 36 | }; 37 | 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/Reset.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | void initiateReset(int ms); 26 | void tickReset(); 27 | void cancelReset(); 28 | 29 | #ifdef __cplusplus 30 | } 31 | #endif 32 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/RingBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef _RING_BUFFER_ 20 | #define _RING_BUFFER_ 21 | 22 | #include 23 | 24 | // Define constants and variables for buffering incoming serial data. We're 25 | // using a ring buffer (I think), in which head is the index of the location 26 | // to which to write the next incoming character and tail is the index of the 27 | // location from which to read. 28 | #define SERIAL_BUFFER_SIZE 64 29 | 30 | class RingBuffer 31 | { 32 | public: 33 | uint8_t _aucBuffer[SERIAL_BUFFER_SIZE] ; 34 | int _iHead ; 35 | int _iTail ; 36 | 37 | public: 38 | RingBuffer( void ) ; 39 | void store_char( uint8_t c ) ; 40 | void clear(); 41 | int read_char(); 42 | int available(); 43 | int availableForStore(); 44 | int peek(); 45 | bool isFull(); 46 | 47 | private: 48 | int nextIndex(int index); 49 | } ; 50 | 51 | #endif /* _RING_BUFFER_ */ 52 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/SERCOM.cpp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/hardware/hello-robot/samd/cores/arduino/SERCOM.cpp -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/Server.h: -------------------------------------------------------------------------------- 1 | /* 2 | Server.h - Base class that provides Server 3 | Copyright (c) 2011 Adrian McEwen. 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 server_h 21 | #define server_h 22 | 23 | #include "Print.h" 24 | 25 | class Server : public Print { 26 | public: 27 | virtual void begin() =0; 28 | }; 29 | 30 | #endif 31 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/Tone.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #ifdef __cplusplus 22 | 23 | #include "Arduino.h" 24 | 25 | void tone(uint32_t _pin, uint32_t frequency, uint32_t duration = 0); 26 | void noTone(uint32_t _pin); 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/USB/USBDesc.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef __USBDESC_H__ 20 | #define __USBDESC_H__ 21 | 22 | // CDC or HID can be enabled together. 23 | #define CDC_ENABLED 24 | #define PLUGGABLE_USB_ENABLED 25 | 26 | #ifdef CDC_ENABLED 27 | #define CDC_INTERFACE_COUNT 2 28 | #define CDC_ENPOINT_COUNT 3 29 | #endif 30 | 31 | // CDC 32 | #define CDC_ACM_INTERFACE 0 // CDC ACM 33 | #define CDC_DATA_INTERFACE 1 // CDC Data 34 | #define CDC_FIRST_ENDPOINT 1 35 | #define CDC_ENDPOINT_ACM 1 36 | #define CDC_ENDPOINT_OUT 2 37 | #define CDC_ENDPOINT_IN 3 38 | 39 | #ifdef CDC_ENABLED 40 | #define CDC_RX CDC_ENDPOINT_OUT 41 | #define CDC_TX CDC_ENDPOINT_IN 42 | #endif 43 | 44 | #define ISERIAL_MAX_LEN 65 45 | 46 | // Defined string description 47 | #define IMANUFACTURER 1 48 | #define IPRODUCT 2 49 | #define ISERIAL 3 50 | 51 | #endif /* __USBDESC_H__ */ 52 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/WInterrupts.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef _WIRING_INTERRUPTS_ 20 | #define _WIRING_INTERRUPTS_ 21 | 22 | #include 23 | 24 | #ifdef __cplusplus 25 | extern "C" { 26 | #endif 27 | 28 | // LOW 0 29 | // HIGH 1 30 | #define CHANGE 2 31 | #define FALLING 3 32 | #define RISING 4 33 | 34 | #define DEFAULT 1 35 | #define EXTERNAL 0 36 | 37 | typedef void (*voidFuncPtr)(void); 38 | 39 | /* 40 | * \brief Specifies a named Interrupt Service Routine (ISR) to call when an interrupt occurs. 41 | * Replaces any previous function that was attached to the interrupt. 42 | */ 43 | void attachInterrupt(uint32_t pin, voidFuncPtr callback, uint32_t mode); 44 | 45 | /* 46 | * \brief Turns off the given interrupt. 47 | */ 48 | void detachInterrupt(uint32_t pin); 49 | 50 | #ifdef __cplusplus 51 | } 52 | #endif 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/WMath.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | extern "C" { 20 | #include "stdlib.h" 21 | #include "stdint.h" 22 | } 23 | #include "WMath.h" 24 | 25 | extern void randomSeed( uint32_t dwSeed ) 26 | { 27 | if ( dwSeed != 0 ) 28 | { 29 | srand( dwSeed ) ; 30 | } 31 | } 32 | 33 | extern long random( long howbig ) 34 | { 35 | if ( howbig == 0 ) 36 | { 37 | return 0 ; 38 | } 39 | 40 | return rand() % howbig; 41 | } 42 | 43 | extern long random( long howsmall, long howbig ) 44 | { 45 | if (howsmall >= howbig) 46 | { 47 | return howsmall; 48 | } 49 | 50 | long diff = howbig - howsmall; 51 | 52 | return random(diff) + howsmall; 53 | } 54 | 55 | extern long map(long x, long in_min, long in_max, long out_min, long out_max) 56 | { 57 | return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min; 58 | } 59 | 60 | extern uint16_t makeWord( uint16_t w ) 61 | { 62 | return w ; 63 | } 64 | 65 | extern uint16_t makeWord( uint8_t h, uint8_t l ) 66 | { 67 | return (h << 8) | l ; 68 | } 69 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/WMath.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef _WIRING_MATH_ 20 | #define _WIRING_MATH_ 21 | 22 | extern long random( long ) ; 23 | extern long random( long, long ) ; 24 | extern void randomSeed( uint32_t dwSeed ) ; 25 | extern long map( long, long, long, long, long ) ; 26 | 27 | extern uint16_t makeWord( uint16_t w ) ; 28 | extern uint16_t makeWord( uint8_t h, uint8_t l ) ; 29 | 30 | #define word(...) makeWord(__VA_ARGS__) 31 | 32 | 33 | #endif /* _WIRING_MATH_ */ 34 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/abi.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | 21 | extern "C" void __cxa_pure_virtual(void) __attribute__ ((__noreturn__)); 22 | extern "C" void __cxa_deleted_virtual(void) __attribute__ ((__noreturn__)); 23 | 24 | void __cxa_pure_virtual(void) { 25 | // We might want to write some diagnostics to uart in this case 26 | //std::terminate(); 27 | while (1) 28 | ; 29 | } 30 | 31 | void __cxa_deleted_virtual(void) { 32 | // We might want to write some diagnostics to uart in this case 33 | //std::terminate(); 34 | while (1) 35 | ; 36 | } 37 | 38 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/avr/dtostrf.c: -------------------------------------------------------------------------------- 1 | /* 2 | dtostrf - Emulation for dtostrf function from avr-libc 3 | Copyright (c) 2015 Arduino LLC. All rights 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 | #include 21 | 22 | char *dtostrf (double val, signed char width, unsigned char prec, char *sout) { 23 | asm(".global _printf_float"); 24 | 25 | char fmt[20]; 26 | sprintf(fmt, "%%%d.%df", width, prec); 27 | sprintf(sout, fmt, val); 28 | return sout; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/avr/dtostrf.h: -------------------------------------------------------------------------------- 1 | /* 2 | dtostrf - Emulation for dtostrf function from avr-libc 3 | Copyright (c) 2015 Arduino LLC. All rights 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 | #pragma once 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | char *dtostrf(double val, signed char width, unsigned char prec, char *sout); 27 | 28 | #ifdef __cplusplus 29 | } 30 | #endif 31 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/avr/interrupt.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LCC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /* 20 | Empty file. 21 | This file is here to allow compatibility with sketches (made for AVR) 22 | that includes 23 | */ 24 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/avr/io.h: -------------------------------------------------------------------------------- 1 | /* 2 | io.h - Definitions for compatibility with AVR io macros 3 | 4 | Copyright (c) 2016 Arduino LLC 5 | 6 | Permission is hereby granted, free of charge, to any person obtaining a copy 7 | of this software and associated documentation files (the "Software"), to deal 8 | in the Software without restriction, including without limitation the rights 9 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 10 | copies of the Software, and to permit persons to whom the Software is 11 | furnished to do so, subject to the following conditions: 12 | 13 | The above copyright notice and this permission notice shall be included in 14 | all copies or substantial portions of the Software. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 19 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 20 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 21 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 22 | THE SOFTWARE 23 | */ 24 | 25 | #ifndef _IO_H_ 26 | #define _IO_H_ 27 | 28 | #define RAMSTART (HMCRAMC0_ADDR) 29 | #define RAMSIZE (HMCRAMC0_SIZE) 30 | #define RAMEND (RAMSTART + RAMSIZE - 1) 31 | 32 | #endif 33 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/hooks.c: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | /** 20 | * Empty yield() hook. 21 | * 22 | * This function is intended to be used by library writers to build 23 | * libraries or sketches that supports cooperative threads. 24 | * 25 | * Its defined as a weak symbol and it can be redefined to implement a 26 | * real cooperative scheduler. 27 | */ 28 | static void __empty() { 29 | // Empty 30 | } 31 | void yield(void) __attribute__ ((weak, alias("__empty"))); 32 | 33 | /** 34 | * SysTick hook 35 | * 36 | * This function is called from SysTick handler, before the default 37 | * handler provided by Arduino. 38 | */ 39 | static int __false() { 40 | // Return false 41 | return 0; 42 | } 43 | int sysTickHook(void) __attribute__ ((weak, alias("__false"))); 44 | 45 | /** 46 | * SVC hook 47 | * PendSV hook 48 | * 49 | * These functions are called from SVC handler, and PensSV handler. 50 | * Default action is halting. 51 | */ 52 | static void __halt() { 53 | // Halts 54 | while (1) 55 | ; 56 | } 57 | void svcHook(void) __attribute__ ((weak, alias("__halt"))); 58 | void pendSVHook(void) __attribute__ ((weak, alias("__halt"))); 59 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/itoa.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #ifdef __cplusplus 22 | extern "C"{ 23 | #endif 24 | 25 | //extern void itoa( int n, char s[] ) ; 26 | 27 | extern char* itoa( int value, char *string, int radix ) ; 28 | extern char* ltoa( long value, char *string, int radix ) ; 29 | extern char* utoa( unsigned int value, char *string, int radix ) ; 30 | extern char* ultoa( unsigned long value, char *string, int radix ) ; 31 | 32 | #ifdef __cplusplus 33 | } // extern "C" 34 | #endif 35 | 36 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/main.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #define ARDUINO_MAIN 20 | #include "Arduino.h" 21 | 22 | // Weak empty variant initialization function. 23 | // May be redefined by variant files. 24 | void initVariant() __attribute__((weak)); 25 | void initVariant() { } 26 | 27 | // Initialize C library 28 | extern "C" void __libc_init_array(void); 29 | 30 | /* 31 | * \brief Main entry point of Arduino application 32 | */ 33 | int main( void ) 34 | { 35 | init(); 36 | 37 | __libc_init_array(); 38 | 39 | initVariant(); 40 | 41 | delay(1); 42 | #if defined(USBCON) 43 | USBDevice.init(); 44 | USBDevice.attach(); 45 | #endif 46 | 47 | setup(); 48 | 49 | for (;;) 50 | { 51 | loop(); 52 | if (serialEventRun) serialEventRun(); 53 | } 54 | 55 | return 0; 56 | } 57 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/new.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | 21 | void *operator new(size_t size) { 22 | return malloc(size); 23 | } 24 | 25 | void *operator new[](size_t size) { 26 | return malloc(size); 27 | } 28 | 29 | void operator delete(void * ptr) { 30 | free(ptr); 31 | } 32 | 33 | void operator delete[](void * ptr) { 34 | free(ptr); 35 | } 36 | 37 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/pulse.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* 26 | * \brief Measures the length (in microseconds) of a pulse on the pin; state is HIGH 27 | * or LOW, the type of pulse to measure. Works on pulses from 2-3 microseconds 28 | * to 3 minutes in length, but must be called at least a few dozen microseconds 29 | * before the start of the pulse. 30 | */ 31 | uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout); 32 | 33 | #ifdef __cplusplus 34 | // Provides a version of pulseIn with a default argument (C++ only) 35 | uint32_t pulseIn(uint32_t pin, uint32_t state, uint32_t timeout = 1000000L); 36 | 37 | } // extern "C" 38 | #endif 39 | 40 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/wiring.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | extern void init(void); 26 | 27 | #ifdef __cplusplus 28 | } 29 | #endif 30 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/wiring_constants.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef _WIRING_CONSTANTS_ 20 | #define _WIRING_CONSTANTS_ 21 | 22 | #ifdef __cplusplus 23 | extern "C"{ 24 | #endif // __cplusplus 25 | 26 | #define LOW (0x0) 27 | #define HIGH (0x1) 28 | 29 | #define INPUT (0x0) 30 | #define OUTPUT (0x1) 31 | #define INPUT_PULLUP (0x2) 32 | #define INPUT_PULLDOWN (0x3) 33 | 34 | #define PI 3.1415926535897932384626433832795 35 | #define HALF_PI 1.5707963267948966192313216916398 36 | #define TWO_PI 6.283185307179586476925286766559 37 | #define DEG_TO_RAD 0.017453292519943295769236907684886 38 | #define RAD_TO_DEG 57.295779513082320876798154814105 39 | #define EULER 2.718281828459045235360287471352 40 | 41 | #define SERIAL 0x0 42 | #define DISPLAY 0x1 43 | 44 | enum BitOrder { 45 | LSBFIRST = 0, 46 | MSBFIRST = 1 47 | }; 48 | 49 | // moved to WInterrupts.h 50 | //// LOW 0 51 | //// HIGH 1 52 | //#define CHANGE 2 53 | //#define FALLING 3 54 | //#define RISING 4 55 | // 56 | //#define DEFAULT 1 57 | //#define EXTERNAL 0 58 | 59 | #ifdef __cplusplus 60 | } // extern "C" 61 | #endif // __cplusplus 62 | 63 | #endif /* _WIRING_CONSTANTS_ */ 64 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/wiring_private.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #ifdef __cplusplus 26 | extern "C" { 27 | #endif 28 | 29 | // Includes Atmel CMSIS 30 | #include "sam.h" 31 | 32 | #include "wiring_constants.h" 33 | 34 | int pinPeripheral( uint32_t ulPin, EPioType ulPeripheral ); 35 | 36 | #ifdef __cplusplus 37 | } // extern "C" 38 | 39 | #include "HardwareSerial.h" 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/cores/arduino/wiring_shift.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef _WIRING_SHIFT_ 20 | #define _WIRING_SHIFT_ 21 | 22 | #ifdef __cplusplus 23 | extern "C" { 24 | #endif 25 | 26 | /* 27 | * \brief 28 | */ 29 | extern uint32_t shiftIn( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder ) ; 30 | 31 | 32 | /* 33 | * \brief 34 | */ 35 | extern void shiftOut( uint32_t ulDataPin, uint32_t ulClockPin, uint32_t ulBitOrder, uint32_t ulVal ) ; 36 | 37 | 38 | #ifdef __cplusplus 39 | } 40 | #endif 41 | 42 | #endif /* _WIRING_SHIFT_ */ 43 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/drivers/arduino-samd.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/hardware/hello-robot/samd/drivers/arduino-samd.cat -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/drivers/cdc_vista.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/hardware/hello-robot/samd/drivers/cdc_vista.cat -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/drivers/dpinst-amd64.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/hardware/hello-robot/samd/drivers/dpinst-amd64.exe -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/drivers/dpinst-x86.exe: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/hardware/hello-robot/samd/drivers/dpinst-x86.exe -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/drivers/genuino-samd.cat: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/hardware/hello-robot/samd/drivers/genuino-samd.cat -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/keywords.txt: -------------------------------------------------------------------------------- 1 | INPUT_PULLDOWN LITERAL1 Constants RESERVED_WORD_2 2 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/HID/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map HID 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | HID KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | SendReport KEYWORD2 16 | AppendDescriptor KEYWORD2 17 | 18 | ####################################### 19 | # Constants (LITERAL1) 20 | ####################################### 21 | HID_TX LITERAL1 -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/HID/library.properties: -------------------------------------------------------------------------------- 1 | name=HID 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Module for PluggableUSB infrastructure. Exposes an API for devices like Keyboards, Mice and Gamepads 6 | paragraph= 7 | category=Other 8 | url=http://www.arduino.cc/en/Reference/HID 9 | architectures=samd 10 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/I2S/examples/InputSerialPlotter/InputSerialPlotter.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This example reads audio data from an Invensense's ICS43432 I2S microphone 3 | breakout board, and prints out the samples to the Serial console. The 4 | Serial Plotter built into the Arduino IDE can be used to plot the audio 5 | data (Tools -> Serial Plotter) 6 | 7 | Circuit: 8 | * Arduino/Genuino Zero, MKRZero or MKR1000 board 9 | * ICS43432: 10 | * GND connected GND 11 | * 3.3V connected 3.3V (Zero) or VCC (MKR1000, MKRZero) 12 | * WS connected to pin 0 (Zero) or pin 3 (MKR1000, MKRZero) 13 | * CLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKRZero) 14 | * SD connected to pin 9 (Zero) or pin A6 (MKR1000, MKRZero) 15 | 16 | created 17 November 2016 17 | by Sandeep Mistry 18 | */ 19 | 20 | #include 21 | 22 | void setup() { 23 | // Open serial communications and wait for port to open: 24 | // A baud rate of 115200 is used instead of 9600 for a faster data rate 25 | // on non-native USB ports 26 | Serial.begin(115200); 27 | while (!Serial) { 28 | ; // wait for serial port to connect. Needed for native USB port only 29 | } 30 | 31 | // start I2S at 8 kHz with 32-bits per sample 32 | if (!I2S.begin(I2S_PHILIPS_MODE, 8000, 32)) { 33 | Serial.println("Failed to initialize I2S!"); 34 | while (1); // do nothing 35 | } 36 | } 37 | 38 | void loop() { 39 | // read a sample 40 | int sample = I2S.read(); 41 | 42 | if (sample) { 43 | // if it's non-zero print value to serial 44 | Serial.println(sample); 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/I2S/examples/SimpleTone/SimpleTone.ino: -------------------------------------------------------------------------------- 1 | /* 2 | This example generates a square wave based tone at a specified frequency 3 | and sample rate. Then outputs the data using the I2S interface to a 4 | MAX08357 I2S Amp Breakout board. 5 | 6 | Circuit: 7 | * Arduino/Genuino Zero, MKRZero or MKR1000 board 8 | * MAX08357: 9 | * GND connected GND 10 | * VIN connected 5V 11 | * LRC connected to pin 0 (Zero) or pin 3 (MKR1000, MKRZero) 12 | * BCLK connected to pin 1 (Zero) or pin 2 (MKR1000, MKRZero) 13 | * DIN connected to pin 9 (Zero) or pin A6 (MKR1000, MKRZero) 14 | 15 | created 17 November 2016 16 | by Sandeep Mistry 17 | */ 18 | 19 | #include 20 | 21 | const int frequency = 440; // frequency of square wave in Hz 22 | const int amplitude = 500; // amplitude of square wave 23 | const int sampleRate = 8000; // sample rate in Hz 24 | 25 | const int halfWavelength = (sampleRate / frequency); // half wavelength of square wave 26 | 27 | short sample = amplitude; // current sample value 28 | int count = 0; 29 | 30 | void setup() { 31 | Serial.begin(9600); 32 | Serial.println("I2S simple tone"); 33 | 34 | // start I2S at the sample rate with 16-bits per sample 35 | if (!I2S.begin(I2S_PHILIPS_MODE, sampleRate, 16)) { 36 | Serial.println("Failed to initialize I2S!"); 37 | while (1); // do nothing 38 | } 39 | } 40 | 41 | void loop() { 42 | if (count % halfWavelength == 0) { 43 | // invert the sample every half wavelength count multiple to generate square wave 44 | sample = -1 * sample; 45 | } 46 | 47 | // write the same sample twice, once for left and once for the right channel 48 | I2S.write(sample); 49 | I2S.write(sample); 50 | 51 | // increment the counter for the next sample 52 | count++; 53 | } 54 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/I2S/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map I2S 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | I2S KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | end KEYWORD2 16 | 17 | onReceive KEYWORD2 18 | onTransmit KEYWORD2 19 | 20 | ####################################### 21 | # Constants (LITERAL1) 22 | ####################################### 23 | I2S_PHILIPS_MODE LITERAL1 24 | I2S_RIGHT_JUSTIFIED_MODE LITERAL1 25 | I2S_LEFT_JUSTIFIED_MODE LITERAL1 26 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/I2S/library.properties: -------------------------------------------------------------------------------- 1 | name=I2S 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Enables the communication with devices that use the Inter-IC Sound (I2S) Bus. Specific implementation for Arduino Zero. 6 | paragraph= 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/I2S 9 | architectures=samd 10 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/I2S/src/utility/I2SDoubleBuffer.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2016 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef _I2S_DOUBLE_BUFFER_H_INCLUDED 20 | #define _I2S_DOUBLE_BUFFER_H_INCLUDED 21 | 22 | #include 23 | #include 24 | 25 | #define I2S_BUFFER_SIZE 512 26 | 27 | class I2SDoubleBuffer 28 | { 29 | public: 30 | I2SDoubleBuffer(); 31 | virtual ~I2SDoubleBuffer(); 32 | 33 | void reset(); 34 | 35 | size_t availableForWrite(); 36 | size_t write(const void *buffer, size_t size); 37 | size_t read(void *buffer, size_t size); 38 | size_t peek(void *buffer, size_t size); 39 | void* data(); 40 | size_t available(); 41 | void swap(int length = 0); 42 | 43 | private: 44 | uint8_t _buffer[2][I2S_BUFFER_SIZE]; 45 | volatile int _length[2]; 46 | volatile int _readOffset[2]; 47 | volatile int _index; 48 | }; 49 | 50 | #endif 51 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/SAMD_AnalogCorrection/library.properties: -------------------------------------------------------------------------------- 1 | name=SAMD_AnalogCorrection 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Sets and enables the digital correction logic of the SAMD ADC. 6 | paragraph=Useful to correct the values returned by the ADC. 7 | category=Other 8 | url= 9 | architectures=samd 10 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/SAMD_AnalogCorrection/src/SAMD_AnalogCorrection.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include "SAMD_AnalogCorrection.h" 20 | 21 | void analogReadCorrection (int offset, uint16_t gain) 22 | { 23 | // Set correction values 24 | ADC->OFFSETCORR.reg = ADC_OFFSETCORR_OFFSETCORR(offset); 25 | ADC->GAINCORR.reg = ADC_GAINCORR_GAINCORR(gain); 26 | 27 | // Enable digital correction logic 28 | ADC->CTRLB.bit.CORREN = 1; 29 | while(ADC->STATUS.bit.SYNCBUSY); 30 | } 31 | 32 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/SAMD_AnalogCorrection/src/SAMD_AnalogCorrection.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #pragma once 20 | 21 | #include 22 | 23 | void analogReadCorrection (int offset, uint16_t gain); 24 | 25 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/SDU/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For SDU 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SDU KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | ####################################### 16 | # Constants (LITERAL1) 17 | ####################################### 18 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/SDU/library.properties: -------------------------------------------------------------------------------- 1 | name=SDU 2 | version=1.0.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Update the sketch on your board from an SD card 6 | paragraph=Requires an SD card 7 | category=Other 8 | url=http://www.arduino.cc/en/Reference/SDU 9 | architectures=samd 10 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/SDU/src/SDU.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | 21 | #include "SDU.h" 22 | 23 | __attribute__ ((section(".sketch_boot"))) 24 | unsigned char sduBoot[0x4000] = { 25 | #if defined(ARDUINO_SAMD_ZERO) 26 | #include "boot/zero.h" 27 | #elif defined(ARDUINO_SAMD_MKR1000) 28 | #include "boot/mkr1000.h" 29 | #elif defined(ARDUINO_SAMD_MKRZERO) 30 | #include "boot/mkrzero.h" 31 | #elif defined(ARDUINO_SAMD_MKRFox1200) 32 | #include "boot/mkrfox1200.h" 33 | #elif defined(ARDUINO_SAMD_MKRGSM1400) 34 | #include "boot/mkrgsm1400.h" 35 | #elif defined(ARDUINO_SAMD_MKRWAN1300) 36 | #include "boot/mkrwan1300.h" 37 | #else 38 | #error "Unsupported board!" 39 | #endif 40 | }; 41 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/SDU/src/SDU.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2017 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef _SDU_H_INCLUDED 20 | #define _SDU_H_INCLUDED 21 | 22 | // nothing for now 23 | 24 | #endif 25 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/SPI/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map SPI 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | SPI KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | begin KEYWORD2 15 | end KEYWORD2 16 | transfer KEYWORD2 17 | #setBitOrder KEYWORD2 18 | setDataMode KEYWORD2 19 | setClockDivider KEYWORD2 20 | 21 | 22 | ####################################### 23 | # Constants (LITERAL1) 24 | ####################################### 25 | SPI_MODE0 LITERAL1 26 | SPI_MODE1 LITERAL1 27 | SPI_MODE2 LITERAL1 28 | SPI_MODE3 LITERAL1 29 | 30 | SPI_CONTINUE LITERAL1 31 | SPI_LAST LITERAL1 32 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/SPI/library.properties: -------------------------------------------------------------------------------- 1 | name=SPI 2 | version=1.0 3 | author=Jonathan BAUDIN, Thibaut VIARD, Arduino 4 | maintainer=Arduino 5 | sentence=Enables the communication with devices that use the Serial Peripheral Interface (SPI) Bus. Specific implementation for Arduino Zero. 6 | paragraph= 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/SPI 9 | architectures=samd 10 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/USBHost/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For USBHost 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | MouseController KEYWORD1 10 | USBHost KEYWORD1 11 | KeyboardController KEYWORD1 12 | 13 | ####################################### 14 | # Methods and Functions (KEYWORD2) 15 | ####################################### 16 | 17 | Task KEYWORD2 18 | mouseMoved KEYWORD2 19 | mouseDragged KEYWORD2 20 | mousePressed KEYWORD2 21 | mouseReleased KEYWORD2 22 | getXChange KEYWORD2 23 | getYChange KEYWORD2 24 | getButton KEYWORD2 25 | keyPressed KEYWORD2 26 | keyReleased KEYWORD2 27 | getModifiers KEYWORD2 28 | getKey KEYWORD2 29 | getOemKey KEYWORD2 30 | 31 | 32 | ####################################### 33 | # Constants (LITERAL1) 34 | ####################################### 35 | 36 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/USBHost/library.properties: -------------------------------------------------------------------------------- 1 | name=USBHost 2 | version=1.0 3 | author=Arduino 4 | maintainer=Arduino 5 | sentence=Allows the communication with USB peripherals like mice, keyboards, and thumbdrives. For Arduino MKR1000 and Zero. 6 | paragraph=The USBHost library allows the board to appear as a USB host, enabling it to communicate with peripherals like USB mice and keyboards. USBHost does not support devices that are connected through USB hubs. This includes some keyboards that have an internal hub. 7 | category=Other 8 | url=http://arduino.cc/en/Reference/USBHost 9 | architectures=samd 10 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/USBHost/src/KeyboardController.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2012 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #include 20 | 21 | extern "C" { 22 | void __keyboardControllerEmptyCallback() { } 23 | } 24 | 25 | void keyPressed() __attribute__ ((weak, alias("__keyboardControllerEmptyCallback"))); 26 | void keyReleased() __attribute__ ((weak, alias("__keyboardControllerEmptyCallback"))); 27 | 28 | void KeyboardController::OnKeyDown(uint8_t _mod, uint8_t _oemKey) { 29 | modifiers = _mod; 30 | keyOem = _oemKey; 31 | key = OemToAscii(_mod, _oemKey); 32 | keyPressed(); 33 | } 34 | 35 | void KeyboardController::OnKeyUp(uint8_t _mod, uint8_t _oemKey) { 36 | modifiers = _mod; 37 | keyOem = _oemKey; 38 | key = OemToAscii(_mod, _oemKey); 39 | keyReleased(); 40 | } 41 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/USBHost/src/KeyboardController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2012 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef KEYBOARD_CONTROLLER_H 20 | #define KEYBOARD_CONTROLLER_H 21 | 22 | #include 23 | 24 | enum KeyboardModifiers { 25 | LeftCtrl = 1, 26 | LeftShift = 2, 27 | Alt = 4, 28 | LeftCmd = 8, 29 | RightCtrl = 16, 30 | RightShift = 32, 31 | AltGr = 64, 32 | RightCmd = 128 33 | }; 34 | 35 | class KeyboardController : public KeyboardReportParser { 36 | public: 37 | KeyboardController(USBHost &usb) : hostKeyboard(&usb), key(0), keyOem(0), modifiers(0) { 38 | hostKeyboard.SetReportParser(0, this); 39 | }; 40 | 41 | uint8_t getKey() { return key; }; 42 | uint8_t getModifiers() { return modifiers; }; 43 | uint8_t getOemKey() { return keyOem; }; 44 | 45 | protected: 46 | virtual void OnKeyDown(uint8_t mod, uint8_t key); 47 | virtual void OnKeyUp(uint8_t mod, uint8_t key); 48 | 49 | private: 50 | HIDBoot hostKeyboard; 51 | uint8_t key, keyOem, modifiers; 52 | }; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/USBHost/src/MouseController.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2012 Arduino. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | #ifndef MOUSE_CONTROLLER_H 20 | #define MOUSE_CONTROLLER_H 21 | 22 | #include 23 | 24 | enum MouseButton { 25 | LEFT_BUTTON = 0x01, 26 | MIDDLE_BUTTON = 0x02, 27 | RIGHT_BUTTON = 0x04 28 | }; 29 | 30 | class MouseController : public MouseReportParser 31 | { 32 | public: 33 | MouseController(USBHost &usb) : hostMouse(&usb), dx(0), dy(0), buttons(0) { 34 | hostMouse.SetReportParser(0, this); 35 | }; 36 | 37 | bool getButton(MouseButton button) { return (buttons & button) == button; }; 38 | int getXChange(); 39 | int getYChange(); 40 | // int getWheelChange(); // Not implemented 41 | 42 | protected: 43 | virtual void OnMouseMove(MOUSEINFO *mi); 44 | virtual void OnLeftButtonUp(MOUSEINFO *mi); 45 | virtual void OnLeftButtonDown(MOUSEINFO *mi); 46 | virtual void OnMiddleButtonUp(MOUSEINFO *mi); 47 | virtual void OnMiddleButtonDown(MOUSEINFO *mi); 48 | virtual void OnRightButtonUp(MOUSEINFO *mi); 49 | virtual void OnRightButtonDown(MOUSEINFO *mi); 50 | 51 | private: 52 | HIDBoot hostMouse; 53 | int dx, dy; 54 | int buttons; 55 | }; 56 | 57 | #endif 58 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/USBHost/src/Usb.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. 2 | 3 | This software may be distributed and modified under the terms of the GNU 4 | General Public License version 2 (GPL2) as published by the Free Software 5 | Foundation and appearing in the file GPL2.TXT included in the packaging of 6 | this file. Please note that GPL2 Section 2[b] requires that all works based 7 | on this software must also be made publicly available under the terms of 8 | the GPL2 ("Copyleft"). 9 | 10 | Contact information 11 | ------------------- 12 | 13 | Circuits At Home, LTD 14 | Web : http://www.circuitsathome.com 15 | e-mail : support@circuitsathome.com 16 | */ 17 | /* USB functions */ 18 | 19 | #ifndef USB_H_INCLUDED 20 | #define USB_H_INCLUDED 21 | #define _usb_h_ 22 | 23 | #include 24 | 25 | //#include "Arduino.h" 26 | #include "macros.h" 27 | // None of these should ever be included by a driver, or a user's sketch. 28 | 29 | #include "variant.h" 30 | #define USB_HOST_SERIAL SERIAL_PORT_MONITOR 31 | #include "Print.h" 32 | #include "printhex.h" 33 | #include "message.h" 34 | #include "hexdump.h" 35 | #include "sink_parser.h" 36 | 37 | #include "address.h" 38 | 39 | #include "usb_ch9.h" 40 | //#include "usbhost.h" 41 | #include "UsbCore.h" 42 | #include "parsetools.h" 43 | 44 | #include "confdescparser.h" 45 | 46 | #endif /* USB_H_INCLUDED */ 47 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/USBHost/src/parsetools.cpp: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. 2 | 3 | This software may be distributed and modified under the terms of the GNU 4 | General Public License version 2 (GPL2) as published by the Free Software 5 | Foundation and appearing in the file GPL2.TXT included in the packaging of 6 | this file. Please note that GPL2 Section 2[b] requires that all works based 7 | on this software must also be made publicly available under the terms of 8 | the GPL2 ("Copyleft"). 9 | 10 | Contact information 11 | ------------------- 12 | 13 | Circuits At Home, LTD 14 | Web : http://www.circuitsathome.com 15 | e-mail : support@circuitsathome.com 16 | */ 17 | #include "Usb.h" 18 | 19 | bool MultiByteValueParser::Parse(uint8_t **pp, uint32_t *pcntdn) { 20 | if(!pBuf) { 21 | Notify(PSTR("Buffer pointer is NULL!\r\n"), 0x80); 22 | return false; 23 | } 24 | for (; countDown && (*pcntdn); countDown--, (*pcntdn)--, (*pp)++) 25 | pBuf[valueSize - countDown] = (**pp); 26 | 27 | if(countDown) 28 | return false; 29 | 30 | countDown = valueSize; 31 | return true; 32 | } 33 | 34 | bool PTPListParser::Parse(uint8_t **pp, uint32_t *pcntdn, PTP_ARRAY_EL_FUNC pf, const void *me) { 35 | switch(nStage) { 36 | case 0: 37 | pBuf->valueSize = lenSize; 38 | theParser.Initialize(pBuf); 39 | nStage = 1; 40 | 41 | case 1: 42 | if(!theParser.Parse(pp, pcntdn)) 43 | return false; 44 | 45 | arLen = 0; 46 | arLen = (pBuf->valueSize >= 4) ? *((uint32_t*)pBuf->pValue) : (uint32_t)(*((uint16_t*)pBuf->pValue)); 47 | arLenCntdn = arLen; 48 | nStage = 2; 49 | 50 | case 2: 51 | pBuf->valueSize = valSize; 52 | theParser.Initialize(pBuf); 53 | nStage = 3; 54 | 55 | case 3: 56 | for(; arLenCntdn; arLenCntdn--) { 57 | if(!theParser.Parse(pp, pcntdn)) 58 | return false; 59 | 60 | if(pf) 61 | pf(pBuf, (arLen - arLenCntdn), me); 62 | } 63 | 64 | nStage = 0; 65 | } 66 | return true; 67 | } 68 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/USBHost/src/sink_parser.h: -------------------------------------------------------------------------------- 1 | /* Copyright (C) 2011 Circuits At Home, LTD. All rights reserved. 2 | 3 | This software may be distributed and modified under the terms of the GNU 4 | General Public License version 2 (GPL2) as published by the Free Software 5 | Foundation and appearing in the file GPL2.TXT included in the packaging of 6 | this file. Please note that GPL2 Section 2[b] requires that all works based 7 | on this software must also be made publicly available under the terms of 8 | the GPL2 ("Copyleft"). 9 | 10 | Contact information 11 | ------------------- 12 | 13 | Circuits At Home, LTD 14 | Web : http://www.circuitsathome.com 15 | e-mail : support@circuitsathome.com 16 | */ 17 | #if !defined(_usb_h_) || defined(__SINK_PARSER_H__) 18 | #error "Never include hexdump.h directly; include Usb.h instead" 19 | #else 20 | #define __SINK_PARSER_H__ 21 | 22 | extern int UsbDEBUGlvl; 23 | 24 | // This parser does absolutely nothing with the data, just swallows it. 25 | 26 | template 27 | class SinkParser : public BASE_CLASS { 28 | public: 29 | 30 | SinkParser() { 31 | }; 32 | 33 | void Initialize() { 34 | }; 35 | 36 | void Parse(const LEN_TYPE /* len */, const uint8_t * /* pbuf */, const OFFSET_TYPE & /* offset */) { 37 | }; 38 | }; 39 | 40 | 41 | #endif // __HEXDUMP_H__ 42 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/Wire/examples/digital_potentiometer/digital_potentiometer.ino: -------------------------------------------------------------------------------- 1 | // I2C Digital Potentiometer 2 | // by Nicholas Zambetti 3 | // and Shawn Bonkowski 4 | 5 | // Demonstrates use of the Wire library 6 | // Controls AD5171 digital potentiometer via I2C/TWI 7 | 8 | // Created 31 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | // This example code is in the public domain. 13 | 14 | 15 | #include 16 | 17 | void setup() 18 | { 19 | Wire.begin(); // join i2c bus (address optional for master) 20 | } 21 | 22 | byte val = 0; 23 | 24 | void loop() 25 | { 26 | Wire.beginTransmission(44); // transmit to device #44 (0x2c) 27 | // device address is specified in datasheet 28 | Wire.write(byte(0x00)); // sends instruction byte 29 | Wire.write(val); // sends potentiometer value byte 30 | Wire.endTransmission(); // stop transmitting 31 | 32 | val++; // increment value 33 | if(val == 64) // if reached 64th position (max) 34 | { 35 | val = 0; // start over from lowest value 36 | } 37 | delay(500); 38 | } 39 | 40 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/Wire/examples/master_reader/master_reader.ino: -------------------------------------------------------------------------------- 1 | // Wire Master Reader 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Reads data from an I2C/TWI slave device 6 | // Refer to the "Wire Slave Sender" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(); // join i2c bus (address optional for master) 18 | Serial.begin(9600); // start serial for output 19 | } 20 | 21 | void loop() 22 | { 23 | Wire.requestFrom(2, 6); // request 6 bytes from slave device #2 24 | 25 | while(Wire.available()) // slave may send less than requested 26 | { 27 | char c = Wire.read(); // receive a byte as character 28 | Serial.print(c); // print the character 29 | } 30 | 31 | delay(500); 32 | } 33 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/Wire/examples/master_writer/master_writer.ino: -------------------------------------------------------------------------------- 1 | // Wire Master Writer 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Writes data to an I2C/TWI slave device 6 | // Refer to the "Wire Slave Receiver" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(); // join i2c bus (address optional for master) 18 | } 19 | 20 | byte x = 0; 21 | 22 | void loop() 23 | { 24 | Wire.beginTransmission(4); // transmit to device #4 25 | Wire.write("x is "); // sends five bytes 26 | Wire.write(x); // sends one byte 27 | Wire.endTransmission(); // stop transmitting 28 | 29 | x++; 30 | delay(500); 31 | } 32 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/Wire/examples/slave_receiver/slave_receiver.ino: -------------------------------------------------------------------------------- 1 | // Wire Slave Receiver 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Receives data as an I2C/TWI slave device 6 | // Refer to the "Wire Master Writer" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(4); // join i2c bus with address #4 18 | Wire.onReceive(receiveEvent); // register event 19 | Serial.begin(9600); // start serial for output 20 | } 21 | 22 | void loop() 23 | { 24 | delay(100); 25 | } 26 | 27 | // function that executes whenever data is received from master 28 | // this function is registered as an event, see setup() 29 | void receiveEvent(int howMany) 30 | { 31 | while(1 < Wire.available()) // loop through all but the last 32 | { 33 | char c = Wire.read(); // receive byte as a character 34 | Serial.print(c); // print the character 35 | } 36 | int x = Wire.read(); // receive byte as an integer 37 | Serial.println(x); // print the integer 38 | } 39 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/Wire/examples/slave_sender/slave_sender.ino: -------------------------------------------------------------------------------- 1 | // Wire Slave Sender 2 | // by Nicholas Zambetti 3 | 4 | // Demonstrates use of the Wire library 5 | // Sends data as an I2C/TWI slave device 6 | // Refer to the "Wire Master Reader" example for use with this 7 | 8 | // Created 29 March 2006 9 | 10 | // This example code is in the public domain. 11 | 12 | 13 | #include 14 | 15 | void setup() 16 | { 17 | Wire.begin(2); // join i2c bus with address #2 18 | Wire.onRequest(requestEvent); // register event 19 | } 20 | 21 | void loop() 22 | { 23 | delay(100); 24 | } 25 | 26 | // function that executes whenever data is requested by master 27 | // this function is registered as an event, see setup() 28 | void requestEvent() 29 | { 30 | Wire.write("hello "); // respond with message of 6 bytes 31 | // as expected by master 32 | } 33 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/Wire/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Wire 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 | onReceive KEYWORD2 18 | onRequest KEYWORD2 19 | 20 | ####################################### 21 | # Instances (KEYWORD2) 22 | ####################################### 23 | 24 | Wire KEYWORD2 25 | Wire1 KEYWORD2 26 | 27 | ####################################### 28 | # Constants (LITERAL1) 29 | ####################################### 30 | 31 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/libraries/Wire/library.properties: -------------------------------------------------------------------------------- 1 | name=Wire 2 | version=1.0 3 | author=Jonathan BAUDIN, Thibaut VIARD, Arduino 4 | maintainer=Arduino 5 | sentence=Allows the communication between devices or sensors connected via Two Wire Interface Bus. Specific implementation for Arduino Zero. 6 | paragraph= 7 | category=Communication 8 | url=http://www.arduino.cc/en/Reference/Wire 9 | architectures=samd 10 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/post_install.bat: -------------------------------------------------------------------------------- 1 | @echo off 2 | set ARGS=/SE /SW /SA 3 | if "%PROCESSOR_ARCHITECTURE%" == "AMD64" ( 4 | drivers\dpinst-amd64.exe %ARGS% 5 | ) ELSE IF "%PROCESSOR_ARCHITEW6432%" == "AMD64" ( 6 | drivers\dpinst-amd64.exe %ARGS% 7 | ) ELSE ( 8 | drivers\dpinst-x86.exe %ARGS% 9 | ) 10 | exit /b 0 11 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/programmers.txt: -------------------------------------------------------------------------------- 1 | # Copyright (c) 2014-2015 Arduino LLC. All right reserved. 2 | # 3 | # This library is free software; you can redistribute it and/or 4 | # modify it under the terms of the GNU Lesser General Public 5 | # License as published by the Free Software Foundation; either 6 | # version 2.1 of the License, or (at your option) any later version. 7 | # 8 | # This library is distributed in the hope that it will be useful, 9 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 11 | # See the GNU Lesser General Public License for more details. 12 | # 13 | # You should have received a copy of the GNU Lesser General Public 14 | # License along with this library; if not, write to the Free Software 15 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 16 | 17 | edbg.name=Atmel EDBG 18 | edbg.communication=USB 19 | edbg.protocol= 20 | edbg.program.protocol= 21 | edbg.program.tool=openocd 22 | edbg.program.extra_params= 23 | 24 | atmel_ice.name=Atmel-ICE 25 | atmel_ice.communication=USB 26 | atmel_ice.protocol= 27 | atmel_ice.program.protocol= 28 | atmel_ice.program.tool=openocd 29 | atmel_ice.program.extra_params= 30 | 31 | sam_ice.name=Atmel SAM-ICE 32 | sam_ice.communication=USB 33 | sam_ice.protocol= 34 | sam_ice.program.protocol= 35 | sam_ice.program.tool=openocd 36 | sam_ice.program.extra_params= 37 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/variants/hello_pimu/debug_scripts/variant.gdb: -------------------------------------------------------------------------------- 1 | # 2 | # Arduino Zero OpenOCD script. 3 | # 4 | # Copyright (c) 2014-2015 Arduino LLC. All right reserved. 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | # See the GNU Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | # Define 'reset' command 22 | define reset 23 | 24 | info reg 25 | 26 | break main 27 | 28 | # End of 'reset' command 29 | end 30 | 31 | target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log" 32 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/variants/hello_pimu/openocd_scripts/arduino_zero.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # Arduino Zero OpenOCD script. 3 | # 4 | # Copyright (c) 2014-2015 Arduino LLC. All right reserved. 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | # See the GNU Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | source [find interface/cmsis-dap.cfg] 22 | 23 | # chip name 24 | set CHIPNAME at91samd21g18 25 | set ENDIAN little 26 | 27 | # choose a port here 28 | set telnet_port 0 29 | 30 | source [find target/at91samdXX.cfg] 31 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/variants/hello_pimu/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/variants/hello_stepper/debug_scripts/variant.gdb: -------------------------------------------------------------------------------- 1 | # 2 | # Arduino Zero OpenOCD script. 3 | # 4 | # Copyright (c) 2014-2015 Arduino LLC. All right reserved. 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | # See the GNU Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | # Define 'reset' command 22 | define reset 23 | 24 | info reg 25 | 26 | break main 27 | 28 | # End of 'reset' command 29 | end 30 | 31 | target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log" 32 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/variants/hello_stepper/openocd_scripts/arduino_zero.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # Arduino Zero OpenOCD script. 3 | # 4 | # Copyright (c) 2014-2015 Arduino LLC. All right reserved. 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | # See the GNU Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | source [find interface/cmsis-dap.cfg] 22 | 23 | # chip name 24 | set CHIPNAME at91samd21g18 25 | set ENDIAN little 26 | 27 | # choose a port here 28 | set telnet_port 0 29 | 30 | source [find target/at91samdXX.cfg] 31 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/variants/hello_stepper/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/variants/hello_wacc/debug_scripts/variant.gdb: -------------------------------------------------------------------------------- 1 | # 2 | # Arduino Zero OpenOCD script. 3 | # 4 | # Copyright (c) 2014-2015 Arduino LLC. All right reserved. 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | # See the GNU Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | # Define 'reset' command 22 | define reset 23 | 24 | info reg 25 | 26 | break main 27 | 28 | # End of 'reset' command 29 | end 30 | 31 | target remote | openocd -c "interface cmsis-dap" -c "set CHIPNAME at91samd21g18" -f target/at91samdXX.cfg -c "gdb_port pipe; log_output openocd.log" 32 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/variants/hello_wacc/openocd_scripts/arduino_zero.cfg: -------------------------------------------------------------------------------- 1 | # 2 | # Arduino Zero OpenOCD script. 3 | # 4 | # Copyright (c) 2014-2015 Arduino LLC. All right reserved. 5 | # 6 | # This library is free software; you can redistribute it and/or 7 | # modify it under the terms of the GNU Lesser General Public 8 | # License as published by the Free Software Foundation; either 9 | # version 2.1 of the License, or (at your option) any later version. 10 | # 11 | # This library is distributed in the hope that it will be useful, 12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 14 | # See the GNU Lesser General Public License for more details. 15 | # 16 | # You should have received a copy of the GNU Lesser General Public 17 | # License along with this library; if not, write to the Free Software 18 | # Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 19 | # 20 | 21 | source [find interface/cmsis-dap.cfg] 22 | 23 | # chip name 24 | set CHIPNAME at91samd21g18 25 | set ENDIAN little 26 | 27 | # choose a port here 28 | set telnet_port 0 29 | 30 | source [find target/at91samdXX.cfg] 31 | -------------------------------------------------------------------------------- /arduino/hardware/hello-robot/samd/variants/hello_wacc/pins_arduino.h: -------------------------------------------------------------------------------- 1 | /* 2 | Copyright (c) 2014-2015 Arduino LLC. All right reserved. 3 | 4 | This library is free software; you can redistribute it and/or 5 | modify it under the terms of the GNU Lesser General Public 6 | License as published by the Free Software Foundation; either 7 | version 2.1 of the License, or (at your option) any later version. 8 | 9 | This library is distributed in the hope that it will be useful, 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 12 | See the GNU Lesser General Public License for more details. 13 | 14 | You should have received a copy of the GNU Lesser General Public 15 | License along with this library; if not, write to the Free Software 16 | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 17 | */ 18 | 19 | // API compatibility 20 | #include "variant.h" 21 | 22 | -------------------------------------------------------------------------------- /arduino/hello_pimu/AnalogManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #ifndef __ANALOG_MANAGER_H__ 14 | #define __ANALOG_MANAGER_H__ 15 | 16 | #include "Common.h" 17 | 18 | #define NUM_ADC_INPUTS 9 19 | 20 | class AnalogManager { 21 | public: 22 | AnalogManager(); 23 | void update_config(Pimu_Config * cfg_new, Pimu_Config * cfg_old); 24 | void step(Pimu_Status * stat, Pimu_Config * cfg); 25 | void setupADC(); 26 | void factory_config(); 27 | 28 | float cliff_LPFa; 29 | float cliff_LPFb; 30 | float voltage_LPFa; 31 | float voltage_LPFb; 32 | float current_LPFa; 33 | float current_LPFb; 34 | float temp_LPFa; 35 | float temp_LPFb ; 36 | float cliff[4]; 37 | bool at_cliff[4]; 38 | float voltage; 39 | float current; 40 | float current_charge; 41 | float current_efuse; 42 | float temp; 43 | volatile uint16_t adcResult[NUM_ADC_INPUTS] = {}; // ADC results buffer 44 | uint8_t mux_map[NUM_ADC_INPUTS]; 45 | uint8_t adc_input_id; 46 | bool first_read_done; 47 | private: 48 | bool first_filter; 49 | bool first_config; 50 | }; 51 | 52 | extern AnalogManager analog_manager; 53 | 54 | #endif 55 | -------------------------------------------------------------------------------- /arduino/hello_pimu/BeepManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #ifndef __BEEP_MANAGER_H__ 14 | #define __BEEP_MANAGER_H__ 15 | 16 | #define BEEP_ID_OFF 0 17 | #define BEEP_ID_SINGLE_SHORT 1 18 | #define BEEP_ID_SINGLE_LONG 2 19 | #define BEEP_ID_DOUBLE_SHORT 3 20 | #define BEEP_ID_DOUBLE_LONG 4 21 | 22 | class BeepManager { 23 | public: 24 | BeepManager(); 25 | void do_beep(int bid); 26 | void step(); 27 | private: 28 | int beep1_on_cnt; 29 | int beep1_off_cnt; 30 | int beep2_on_cnt; 31 | }; 32 | 33 | extern BeepManager beep_manager; 34 | 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /arduino/hello_pimu/ChargerManager.h: -------------------------------------------------------------------------------- 1 | #ifndef __CHARGER_MANAGER_H__ 2 | #define __CHARGER_MANAGER_H__ 3 | #include "Common.h" 4 | 5 | #define CHARGER_SAMPLE_RATE 500 6 | 7 | 8 | class ChargerManager{ 9 | public: 10 | bool step(float vbat, float sys_current, float charge_current, int board_variant); 11 | void hotplug_check(float vd); 12 | void unplug_check(float v, float c, float cc); 13 | bool charging_sts_flag = true; 14 | bool hotplug_sts_flag = false; 15 | bool unplug_sts_flag = false; 16 | bool charger_plugged_in_flag = true; 17 | }; 18 | 19 | #endif -------------------------------------------------------------------------------- /arduino/hello_pimu/IMU.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #include "IMU.h" 14 | #include "Pimu.h" 15 | #include "IMU_FXOS8700_FXAS21002.h" 16 | #include "IMU_BNO085.h" 17 | 18 | void setupIMU() 19 | { 20 | if (BOARD_VARIANT>=3) 21 | imu_b.setupIMU(); 22 | else 23 | imu_f.setupIMU(); 24 | } 25 | 26 | 27 | void stepIMU(IMU_Status * imu_status) 28 | { 29 | if (BOARD_VARIANT>=3) 30 | imu_b.stepIMU(imu_status); 31 | else 32 | imu_f.stepIMU(imu_status); 33 | } 34 | 35 | 36 | void setIMUConfig(Pimu_Config * cfg_in, Pimu_Config * cfg) 37 | { 38 | if (BOARD_VARIANT<3) 39 | imu_f.setIMUConfig(cfg_in,cfg); 40 | } 41 | 42 | bool isIMUOrientationValid() 43 | { 44 | if (BOARD_VARIANT>=3) 45 | return imu_b.isIMUOrientationValid(); 46 | else 47 | return imu_f.isIMUOrientationValid(); 48 | return 0; 49 | } 50 | -------------------------------------------------------------------------------- /arduino/hello_pimu/IMU.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | /* 5 | ------------------------------------------------------------- 6 | Hello Robot - Hello Pimu 7 | 8 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 9 | 10 | https://www.gnu.org/licenses/gpl-3.0.html 11 | 12 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 13 | -------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef __IMU_H__ 17 | #define __IMU_H__ 18 | #include "Common.h" 19 | 20 | 21 | void setupIMU(); 22 | void stepIMU(IMU_Status * imu_status); 23 | void setIMUConfig(Pimu_Config * cfg_in, Pimu_Config * cfg); 24 | bool isIMUOrientationValid(); 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /arduino/hello_pimu/IMU_BNO085.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | /* 5 | ------------------------------------------------------------- 6 | Hello Robot - Hello Pimu 7 | 8 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 9 | 10 | https://www.gnu.org/licenses/gpl-3.0.html 11 | 12 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 13 | -------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef __IMU_BNO085_H__ 17 | #define __IMU_BNO085_H__ 18 | #include "Common.h" 19 | #include "SparkFun_BNO080_Arduino_Library.h" 20 | 21 | #define IMU_BNO085_RESET (27u) //PA21 27 22 | #define IMU_BNO085_INT (17u) //PA13 17 23 | 24 | #define FRS_WRITE_DATA_REQUEST 0xF6 25 | #define FRS_WRITE_REQUEST 0xF7 26 | #define FRS_SYSTEM_ORIENTATION_ID 0x2D3E 27 | #define FRS_WRITE_RESPONSE 0xF5 28 | #define SYSTEM_QX_ORIENTATION 0x00000000 29 | #define SYSTEM_QY_ORIENTATION 0x00000000 30 | #define SYSTEM_QZ_ORIENTATION 0x2D413CCD //Represents 90 degree rotation on Z axis 31 | #define SYSTEM_QW_ORIENTATION 0x2D413CCD //Represents 90 degree rotation on Z axis 32 | 33 | 34 | class IMU_BNO085{ 35 | public: 36 | bool imu_valid; 37 | bool imu_orientation; 38 | int irq_cnt; 39 | IMU_BNO085(){} 40 | void setupIMU(); 41 | void stepIMU(IMU_Status * imu_status); 42 | void setIMUCalibration(); 43 | void writeSystemOrientation(bool resetOrientation); 44 | bool isIMUOrientationValid(); 45 | volatile bool dirtyLinearAcc; 46 | volatile bool dirtyQuat; 47 | volatile bool dirtyRotationVector; 48 | volatile bool dirtyAccelerometer; 49 | volatile bool dirtyMagnetometer; 50 | volatile bool dirtyGyro; 51 | BNO080 device; 52 | float accel_max_log[3][8]; 53 | int accel_max_idx=0; 54 | }; 55 | 56 | extern IMU_BNO085 imu_b; 57 | 58 | #endif -------------------------------------------------------------------------------- /arduino/hello_pimu/IMU_FXOS8700_FXAS21002.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | /* 5 | ------------------------------------------------------------- 6 | Hello Robot - Hello Pimu 7 | 8 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 9 | 10 | https://www.gnu.org/licenses/gpl-3.0.html 11 | 12 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 13 | -------------------------------------------------------------- 14 | */ 15 | 16 | #ifndef __IMU_FXOS8700_FXAS21002_H__ 17 | #define __IMU_FXOS8700_FXAS21002_H__ 18 | #include "Common.h" 19 | #include 20 | #include 21 | #include 22 | 23 | class IMU_FXOS8700_FXAS21002{ 24 | public: 25 | IMU_FXOS8700_FXAS21002(); 26 | void setupIMU(); 27 | void stepIMU(IMU_Status * imu_status); 28 | void setIMUConfig(Pimu_Config * cfg_in, Pimu_Config * cfg); 29 | bool isIMUOrientationValid(); 30 | Adafruit_FXAS21002C gyro = Adafruit_FXAS21002C(0x0021002C); 31 | Adafruit_FXOS8700 accelmag = Adafruit_FXOS8700(0x8700A, 0x8700B); 32 | Madgwick filter; 33 | float accel_max_log[3][8]; 34 | int accel_max_idx=0; 35 | bool first_acc_filter=true; 36 | float accel_LPFa; 37 | float accel_LPFb; 38 | bool imu_valid; 39 | bool imu_calibration_rcvd; 40 | int imu_calibration_startup_cnt; 41 | float mag_offsets[3] = { 0.0F, 0.0F, 0.02F }; 42 | float mag_softiron_matrix[3][3]; 43 | float mag_field_strength; 44 | float gyro_zero_offsets[3]; 45 | float gravity_vector_scale; 46 | float rate_gyro_vector_scale; 47 | }; 48 | 49 | extern IMU_FXOS8700_FXAS21002 imu_f; 50 | 51 | 52 | #endif 53 | -------------------------------------------------------------------------------- /arduino/hello_pimu/LightBarManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #ifndef __LIGHT_BAR_MANAGER_H__ 14 | #define __LIGHT_BAR_MANAGER_H__ 15 | 16 | #include "Common.h" 17 | #include "ChargerManager.h" 18 | #include 19 | 20 | enum lightbar_mode {OFF,BOOTING, CHARGING_REQUIRED, CHARGING_RUNSTOP_ON, CHARGING_RUNSTOP_OFF, NORMAL_RUNSTOP_OFF, NORMAL_RUNSTOP_ON }; 21 | class LightBarPatterns; 22 | class LightBarManager { 23 | public: 24 | LightBarManager(); 25 | void step(bool boot_detected, bool runstop_on, bool charger_on, bool charging_required, bool runstop_led_on, float v_bat, bool charger_plugged_in); 26 | void setupLightBarManager(); 27 | uint8_t get_mode(){return (uint8_t) mode;} 28 | void start_test(); 29 | private: 30 | LightBarPatterns * pixels; 31 | lightbar_mode mode; 32 | }; 33 | 34 | 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /arduino/hello_pimu/Pimu.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #ifndef __PIMU_H__ 14 | #define __PIMU_H__ 15 | 16 | #include "Common.h" 17 | 18 | extern uint8_t BOARD_VARIANT; 19 | extern uint8_t BOARD_VARIANT_DEDICATED_SYNC; 20 | 21 | extern void setupPimu(); 22 | extern void setupADC(); 23 | extern void stepPimuRPC(); 24 | extern void setupBoardVariants(); 25 | 26 | extern void toggle_led(int rate_ms); 27 | 28 | 29 | extern void on_runstop(); 30 | extern void do_beep(int bid); 31 | 32 | 33 | #endif 34 | -------------------------------------------------------------------------------- /arduino/hello_pimu/README.md: -------------------------------------------------------------------------------- 1 | # Stretch RE1/RE2 - Pimu Firmware 2 | 3 | The Stretch Pimu Firmware runs on the Pimu PCBA. Pimu stands for Power+IMU. The firmware is responsible for 4 | 5 | * Monitoring / filtering / calibration of 9DOF IMU 6 | 7 | * Battery voltage and current monitoring 8 | 9 | * Buzzer 10 | 11 | * Base case fan control 12 | 13 | * Runstop monitoring 14 | 15 | * Monitoring cliff sensors 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | -------------------------------------------------------------------------------- /arduino/hello_pimu/RunstopManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #ifndef __RUNSTOP_MANAGER_H__ 14 | #define __RUNSTOP_MANAGER_H__ 15 | 16 | #include "Common.h" 17 | 18 | class RunstopManager { 19 | public: 20 | RunstopManager(); 21 | void activate_runstop(); 22 | void deactivate_runstop(); 23 | void step(Pimu_Config * cfg); 24 | void toggle_led(int rate_ms); 25 | bool state_runstop_event; 26 | bool runstop_led_on; 27 | private: 28 | bool trigger_runstop_event; 29 | volatile uint8_t runstop_mode; 30 | unsigned long runstop_t_toggle_last; 31 | int depressed_last; 32 | unsigned long t_low; 33 | 34 | }; 35 | 36 | 37 | #endif 38 | -------------------------------------------------------------------------------- /arduino/hello_pimu/SyncManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #ifndef __SYNC_MANAGER_H__ 14 | #define __SYNC_MANAGER_H__ 15 | 16 | #include "Common.h" 17 | #include "RunstopManager.h" 18 | 19 | class SyncManager { 20 | public: 21 | SyncManager(RunstopManager * r); 22 | void trigger_motor_sync(); 23 | void step(); 24 | volatile uint8_t pulse_wait_ms; 25 | volatile uint8_t pulse_len_ms; 26 | int duration_last_pulse; 27 | uint16_t motor_sync_cnt; 28 | uint16_t syncs_queued; 29 | private: 30 | void step_shared_sync(); 31 | void step_dedicated_sync(); 32 | volatile bool motor_stop_enabled; 33 | volatile bool dirty_motor_sync; 34 | 35 | RunstopManager * rm; 36 | }; 37 | 38 | 39 | 40 | #endif 41 | -------------------------------------------------------------------------------- /arduino/hello_pimu/TimeManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #include "TimeManager.h" 14 | #include "Common.h" 15 | 16 | TimeManager time_manager; 17 | 18 | ///////////////////// TIMING and TIMESTAMP ///////////////////////////////////////// 19 | /* 20 | * TC4 is used to track time as micros() doesn't work in ISRs 21 | * TimeManage tracks TC4 overflows, computes timestamps as uS since last zero_clock() 22 | * zero_clock() is called by RPC from client 23 | * Duration measurement provided for testing of MotorSyncManager pulse generation 24 | * 25 | */ 26 | 27 | unsigned long TimeManager::get_elapsed_time_ms() 28 | { 29 | return (unsigned long)((float)(MS_PER_TC4_CYCLE*(float)ts_base)); 30 | } 31 | 32 | TimeManager::TimeManager() 33 | { 34 | ts_base=0; 35 | duration_base=0; 36 | } 37 | 38 | uint64_t TimeManager::current_time_us() 39 | { 40 | uint64_t base; 41 | int cntr = TC4->COUNT16.COUNT.reg; 42 | if (TC4->COUNT16.INTFLAG.bit.OVF == 1) //Catch the case that there's an IRQ waiting to be handled 43 | base = (ts_base+1)*US_PER_TC4_CYCLE; 44 | else 45 | base = ts_base*US_PER_TC4_CYCLE; 46 | 47 | return base+(int)(round(cntr*US_PER_TC4_TICK)); 48 | } 49 | 50 | void TimeManager::start_duration_measure() 51 | { 52 | duration_base=ts_base; 53 | duration_cntr = TC4->COUNT16.COUNT.reg; 54 | } 55 | 56 | int TimeManager::end_duration_measure() 57 | { 58 | int cntr = TC4->COUNT16.COUNT.reg; 59 | int us_base = (ts_base-duration_base)*US_PER_TC4_CYCLE; 60 | int us_cntr = (int)((cntr-duration_cntr)*US_PER_TC4_TICK);; 61 | return us_base+us_cntr; 62 | } 63 | 64 | void TimeManager::clock_zero() 65 | { 66 | ts_base=0; 67 | TC4->COUNT16.COUNT.reg=0; 68 | } 69 | -------------------------------------------------------------------------------- /arduino/hello_pimu/TimeManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #ifndef __TIME_MANAGER_H__ 14 | #define __TIME_MANAGER_H__ 15 | 16 | #include "Common.h" 17 | 18 | #define FS_TC4 1000 19 | #define US_PER_TC4_CYCLE 1000000/FS_TC4 //1000 at 1000Hz 20 | #define MS_PER_TC4_CYCLE US_PER_TC4_CYCLE/1000 21 | #define TC4_TICKS_PER_CYCLE (int)( round(48000000 / 2 / FS_TC4)) //24,000 at 1000hz, 2:1 prescalar TC4 is 32bit timer 22 | #define US_PER_TC4_TICK 1000000.0*2/48000000 23 | 24 | 25 | class TimeManager { 26 | public: 27 | TimeManager(); 28 | uint64_t current_time_us(); 29 | void start_duration_measure(); 30 | int end_duration_measure(); 31 | void clock_zero(); 32 | unsigned long get_elapsed_time_ms(); 33 | volatile int ts_base; //Incremented at rate FS_TC4 (Hz) 34 | private: 35 | volatile int duration_base; 36 | volatile int duration_cntr; 37 | }; 38 | 39 | extern TimeManager time_manager; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /arduino/hello_pimu/hello_pimu.ino: -------------------------------------------------------------------------------- 1 | 2 | /* 3 | ------------------------------------------------------------- 4 | Hello Robot - Hello Pimu 5 | 6 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 7 | 8 | https://www.gnu.org/licenses/gpl-3.0.html 9 | 10 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 11 | -------------------------------------------------------------- 12 | */ 13 | 14 | 15 | #include 16 | #include "Common.h" 17 | #include "Transport.h" 18 | #include "Pimu.h" 19 | #include "IMU.h" 20 | 21 | 22 | void setup() // This code runs once at startup 23 | { 24 | setupBoardVariants(); 25 | setupIMU(); 26 | SerialUSB.begin(2000000); 27 | setupPimu(); 28 | setupTransport(); 29 | } 30 | 31 | void loop() 32 | { 33 | stepPimuRPC(); 34 | } 35 | -------------------------------------------------------------------------------- /arduino/hello_stepper/AnalogManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #ifndef __ANALOG_MANAGER_H__ 14 | #define __ANALOG_MANAGER_H__ 15 | 16 | #include "Common.h" 17 | 18 | #define NUM_ADC_INPUTS 1 19 | 20 | class AnalogManager { 21 | public: 22 | AnalogManager(); 23 | void update_config(Gains * cfg_new, Gains * cfg_old); 24 | void step(); 25 | void setupADC(); 26 | 27 | float voltage_LPFa; 28 | float voltage_LPFb; 29 | uint16_t voltage; 30 | volatile uint16_t adcResult[NUM_ADC_INPUTS] = {}; // ADC results buffer 31 | uint8_t mux_map[NUM_ADC_INPUTS]; 32 | uint8_t adc_input_id; 33 | volatile bool adc_results_ready; 34 | private: 35 | bool first_filter; 36 | bool first_config; 37 | }; 38 | 39 | extern AnalogManager analog_manager; 40 | 41 | #endif 42 | -------------------------------------------------------------------------------- /arduino/hello_stepper/Controller.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Stepper 4 | 5 | This code is derived from the Mechaduino project. 6 | https://github.com/jcchurch13/Mechaduino-Firmware 7 | 8 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 9 | https://www.gnu.org/licenses/gpl-3.0.html 10 | 11 | Copyright (c) 2020 by Hello Robot Inc. 12 | -------------------------------------------------------------- 13 | */ 14 | 15 | //Contains the TC5 Handler declaration 16 | 17 | 18 | #ifndef __CONTROLLER_H__ 19 | #define __CONTROLLER_H__ 20 | 21 | #define WAIT_TC16_REGS_SYNC(x) while(x->COUNT16.STATUS.bit.SYNCBUSY); 22 | 23 | 24 | void TC5_Handler(); 25 | 26 | 27 | #endif 28 | -------------------------------------------------------------------------------- /arduino/hello_stepper/README.md: -------------------------------------------------------------------------------- 1 | # Stretch RE1/RE2 - Stepper Firmware 2 | 3 | The Stretch Stepper Firmware runs on the Stepper PCBA found on the back of the Stretch stepper motors. It is a modified version of the open source [Mechaduino project](https://github.com/jcchurch13/Mechaduino-Firmware), which provides closed loop current control of a stepper motor. 4 | 5 | The firmware is organized so as to allow switching, via serial command, between 'stock Mechaduino mode' with its menu interface and the Hello Robot firmware with its RPC interface. 6 | 7 | The primary hardware modifications are: 8 | 9 | * Higher current capacity by use of parallel motor drivers 10 | * Locking JST connectors 11 | * Addition of a 'sync' line for multi-dof synchronization 12 | 13 | The primary software modifications are: 14 | 15 | * RPC and serialization layer to manage controller parameters, controller commands, etc 16 | 17 | * Trapezoidal trajectory generators based on the library [MotionGenerator](https://github.com/EmanuelFeru/MotionGenerator) 18 | 19 | * Handling of runstop and motor synchronization 20 | 21 | * Implementation of a guarded move behavior 22 | 23 | * Various controller variants, controller and parameter management functions 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /arduino/hello_stepper/State.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Stepper 4 | 5 | This code is derived from the Mechaduino project. 6 | https://github.com/jcchurch13/Mechaduino-Firmware 7 | 8 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 9 | https://www.gnu.org/licenses/gpl-3.0.html 10 | 11 | Copyright (c) 2020 by Hello Robot Inc. 12 | -------------------------------------------------------------- 13 | */ 14 | 15 | //Contains the declaration of the state variables for the control loop 16 | 17 | #ifndef __STATE_H__ 18 | #define __STATE_H__ 19 | 20 | 21 | //interrupt vars 22 | 23 | 24 | extern volatile float z_pos; 25 | extern volatile float z_vel; 26 | extern volatile float z_accel; 27 | 28 | 29 | extern volatile int U; //control effort (abs) 30 | extern volatile float r; //setpoint 31 | extern volatile float y; // measured angle 32 | extern volatile float v; // estimated velocity (velocity loop) 33 | extern volatile float yw; 34 | extern volatile float yw_1; 35 | extern volatile float e; // e = r-y (error) 36 | extern volatile float p; // proportional effort 37 | extern volatile float i; // integral effort 38 | 39 | extern volatile float u; //real control effort (not abs) 40 | extern volatile float u_1; 41 | extern volatile float e_1; 42 | extern volatile float u_2; 43 | extern volatile float e_2; 44 | extern volatile float u_3; 45 | extern volatile float e_3; 46 | extern volatile long counter; 47 | 48 | extern volatile long wrap_count; 49 | extern volatile float y_1; 50 | 51 | extern volatile long step_count; //For step/dir interrupt 52 | extern int stepNumber; // step index for cal routine 53 | 54 | 55 | extern volatile float ITerm; 56 | extern volatile float DTerm; 57 | extern char mode; 58 | extern int dir; 59 | 60 | extern bool print_yw; //for step response, under development... 61 | #endif 62 | -------------------------------------------------------------------------------- /arduino/hello_stepper/SyncManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Stepper 4 | 5 | This code is derived from the Mechaduino project. 6 | https://github.com/jcchurch13/Mechaduino-Firmware 7 | 8 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 9 | https://www.gnu.org/licenses/gpl-3.0.html 10 | 11 | Copyright (c) 2020 by Hello Robot Inc. 12 | -------------------------------------------------------------- 13 | */ 14 | 15 | #ifndef __HELLO_SYNC_MANAGER_H__ 16 | #define __HELLO_SYNC_MANAGER_H__ 17 | 18 | #include "Common.h" 19 | 20 | /* For RE1 (BOARD_VARIANT==0) the sync line and runstop line are shared 21 | * For RE2 (BOARD_VARIANT==1) the lines are seperated 22 | * We handle each case seperately 23 | */ 24 | class SyncManager{ 25 | public: 26 | SyncManager(); 27 | volatile bool runstop_active; 28 | void setupSyncManager(); 29 | void step(); 30 | bool sync_mode_enabled; 31 | int runstop_trigger_cnt; 32 | void on_runstop_change(); 33 | void on_sync_change(); 34 | volatile uint16_t sync_irq_cnt; 35 | volatile uint16_t sync_irq_overflow; 36 | private: 37 | uint8_t rs_last; 38 | int last_pulse_duration; 39 | int pulse_count; 40 | bool sync_last; 41 | }; 42 | 43 | extern SyncManager sync_manager; 44 | 45 | #endif 46 | -------------------------------------------------------------------------------- /arduino/hello_stepper/TimeManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Stepper 4 | 5 | This code is derived from the Mechaduino project. 6 | https://github.com/jcchurch13/Mechaduino-Firmware 7 | 8 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 9 | https://www.gnu.org/licenses/gpl-3.0.html 10 | 11 | Copyright (c) 2020 by Hello Robot Inc. 12 | -------------------------------------------------------------- 13 | */ 14 | 15 | #include "TimeManager.h" 16 | #include "HelloController.h" 17 | #include "Controller.h" 18 | 19 | 20 | /* 21 | * As micros() doesn't work in ISR we track timing using TC4 22 | * TC4 drives the main control loop at 1Khz 23 | * We count TC4 overflows and compute a uint64_t timestamp that is rollover proof 24 | * The current timestamp is in uS since the last zero_clock() call 25 | * , which is called aperiodically at approximately 100hz from the TC4 loop. 26 | * The encoder is read in the TC5 loop and timestamped upon the SPI read to the sensor. 27 | * Upon a zero_clock() all timestamps are adjusted relative to the new zero. 28 | * , therefore a timestamp can be negative relative to the zero_clock 29 | * */ 30 | 31 | //Todo: Move to TCCO pulse measurement 32 | //See https://forum.arduino.cc/index.php?topic=396804.30 33 | 34 | TimeManager time_manager; 35 | 36 | TimeManager::TimeManager() 37 | { 38 | ts_base=0; 39 | dt_ms= 1000.0/TC4_LOOP_RATE; 40 | } 41 | 42 | void TimeManager::setupTimeManager() 43 | { 44 | 45 | } 46 | 47 | uint32_t TimeManager::get_elapsed_time_ms() //Avoid using millis() in ISR 48 | { 49 | return (uint32_t)((float)(dt_ms*(float)ts_base)); 50 | } 51 | 52 | uint64_t TimeManager::current_time_us() 53 | { 54 | uint64_t base; 55 | int cntr = TC4->COUNT16.COUNT.reg; 56 | if (TC4->COUNT16.INTFLAG.bit.OVF == 1) //Catch the case that there's an IRQ waiting to be handled 57 | base = (ts_base+1)*US_PER_TC4_CYCLE; 58 | else 59 | base = ts_base*US_PER_TC4_CYCLE; 60 | return base+(int)(round(cntr*US_PER_TC4_TICK)); 61 | } 62 | -------------------------------------------------------------------------------- /arduino/hello_stepper/TimeManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Stepper 4 | 5 | This code is derived from the Mechaduino project. 6 | https://github.com/jcchurch13/Mechaduino-Firmware 7 | 8 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 9 | https://www.gnu.org/licenses/gpl-3.0.html 10 | 11 | Copyright (c) 2020 by Hello Robot Inc. 12 | -------------------------------------------------------------- 13 | */ 14 | 15 | #ifndef __TIME_MANAGER_H__ 16 | #define __TIME_MANAGER_H__ 17 | 18 | #include "Common.h" 19 | 20 | 21 | class TimeManager { 22 | public: 23 | TimeManager(); 24 | uint32_t get_elapsed_time_ms(); 25 | uint64_t current_time_us(); 26 | void setupTimeManager(); 27 | volatile uint64_t ts_base; //Incremented once every TC4 loop (1Khz) 28 | 29 | private: 30 | float dt_ms; 31 | 32 | }; 33 | 34 | extern TimeManager time_manager; 35 | #endif 36 | -------------------------------------------------------------------------------- /arduino/hello_stepper/TrajectoryManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Stepper 4 | 5 | This code is derived from the Mechaduino project. 6 | https://github.com/jcchurch13/Mechaduino-Firmware 7 | 8 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 9 | https://www.gnu.org/licenses/gpl-3.0.html 10 | 11 | Copyright (c) 2020 by Hello Robot Inc. 12 | -------------------------------------------------------------- 13 | */ 14 | 15 | #ifndef __TRAJECTORY_MANAGER_H__ 16 | #define __TRAJECTORY_MANAGER_H__ 17 | 18 | #include "Common.h" 19 | 20 | 21 | 22 | class TrajectoryManager{ 23 | public: 24 | TrajectoryManager(); 25 | void step(); //Called at 1Khz by TC4 loop 26 | bool set_next_trajectory_segment(TrajectorySegment * s, bool motion_limits_set, bool diag_pos_calibrated, MotionLimits * m, Command * c); 27 | bool start_new_trajectory(TrajectorySegment * s, bool wait_on_sync, bool motion_limits_set, bool diag_pos_calibrated, MotionLimits * m, Command * c); 28 | void reset(); 29 | bool is_trajectory_active(); 30 | bool is_trajectory_waiting_on_sync(); 31 | bool is_trajectory_idle(); 32 | bool is_segment_valid(TrajectorySegment * s, bool motion_limits_set, bool diag_pos_calibrated, MotionLimits * m, Command * c); 33 | uint16_t get_id_current_segment(){return id_curr_seg;} 34 | float q; //current position target 35 | bool waiting_on_sync; 36 | char seg_load_error_message[100]; 37 | private: 38 | 39 | uint16_t id_curr_seg; 40 | float t; 41 | 42 | uint8_t state; 43 | 44 | TrajectorySegment seg_active; 45 | TrajectorySegment seg_next; 46 | bool seg_active_valid; 47 | bool seg_next_valid; 48 | 49 | TrajectorySegment seg_in; 50 | bool dirty_seg_in; 51 | bool start_new; 52 | 53 | 54 | }; 55 | 56 | extern TrajectoryManager trajectory_manager; 57 | #endif 58 | -------------------------------------------------------------------------------- /arduino/hello_stepper/analogFastWrite.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Stepper 4 | 5 | This code is derived from the Mechaduino project. 6 | https://github.com/jcchurch13/Mechaduino-Firmware 7 | 8 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 9 | https://www.gnu.org/licenses/gpl-3.0.html 10 | 11 | Copyright (c) 2020 by Hello Robot Inc. 12 | -------------------------------------------------------------- 13 | */ 14 | 15 | //187kHz PWM implementation. Stock analogWrite is much slower and is very audible! 16 | 17 | #pragma once 18 | 19 | #include 20 | 21 | #ifdef __cplusplus 22 | extern "C" { 23 | #endif 24 | 25 | /* 26 | * \brief SAMD products have only one reference for ADC 27 | */ 28 | 29 | 30 | extern void analogFastWrite( uint32_t ulPin, uint32_t ulValue ) ; 31 | 32 | 33 | #ifdef __cplusplus 34 | } 35 | #endif 36 | -------------------------------------------------------------------------------- /arduino/hello_stepper/sketch.json: -------------------------------------------------------------------------------- 1 | { 2 | "cpu": { 3 | "fqbn": "arduino:samd:arduino_zero_native", 4 | "name": "Arduino/Genuino Zero (Native USB Port)" 5 | } 6 | } -------------------------------------------------------------------------------- /arduino/hello_wacc/Accel.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef __ACCEL_H__ 13 | #define __ACCEL_H__ 14 | #include "Common.h" 15 | 16 | extern float ax,ay,az; 17 | extern uint32_t single_tap_count; 18 | extern uint32_t double_tap_count; 19 | 20 | void setupAccel(); 21 | void stepAccel(); 22 | void onAccelInt1(); 23 | void onAccelInt2(); 24 | void setAccelRange(uint8_t r); 25 | void setSingleTapSensitivity(uint8_t dur, uint8_t thresh); 26 | extern uint32_t accel_debug; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /arduino/hello_wacc/README.md: -------------------------------------------------------------------------------- 1 | # Stretch RE1/RE2 - Wacc Firmware 2 | 3 | The Stretch Wacc Firmware runs on the Wacc PCBA found inside the robot arm. Wacc stands for the 'Wrist + Accelerometer' board. The Wacc firmware provides 4 | 5 | * Monitoring of the wrist accelerometer 6 | * Monitoring the Arduino expansion header in the wrist 7 | 8 | The Wacc expansion header is electrically routed to potentially provide 9 | 10 | * Analog in (x1) 11 | * Digital in (x1) 12 | * Digital out (x2) 13 | * Serial SPI 14 | * Serial I2C 15 | * Serial UART 16 | 17 | See the [Stretch RE1 Hardware User Guide](https://docs.hello-robot.com) for pin-out, electrical, and connector information. 18 | 19 | ## Using the Expansion DIO Header 20 | 21 | ### Factory Interface 22 | 23 | By default the Expansion DIO header is configured in firmware to provide two digital inputs, two digital outputs, and an analog input. This can be seen in the [Wacc_status](https://github.com/hello-robot/stretch_firmware/blob/master/arduino/hello_wacc/Common.h) structure. 24 | 25 | ```c 26 | struct __attribute__ ((packed)) Wacc_Status{ 27 | float ax; //Accelerometer AX 28 | float ay; //Accelerometer AY 29 | float az; //Accelerometer AZ 30 | int16_t a0; //expansion header analog in 31 | uint8_t d0; //expansion header digital in 32 | uint8_t d1; //expansion header digital in 33 | uint8_t d2; //expansion header digital out 34 | uint8_t d3; //expansion header digital out 35 | uint32_t single_tap_count; //Accelerometer tap count 36 | uint32_t state; 37 | uint32_t timestamp; //ms, overflows every 50 days 38 | uint32_t debug; 39 | }; 40 | ``` 41 | 42 | The user can interact with these pins through the [Stretch Body python interface](https://hello-robot.github.io/stretch_body_guide/). 43 | 44 | ### Custom Interface 45 | 46 | Advanced users may want to create a custom interface to the Expansion DIO header that utilizes SPI, I2C, or UART. For this, see the provided Stretch Firmware tutorials. 47 | -------------------------------------------------------------------------------- /arduino/hello_wacc/TimeManager.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Pimu 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #include "TimeManager.h" 14 | #include "Common.h" 15 | 16 | TimeManager time_manager; 17 | 18 | ///////////////////// TIMING and TIMESTAMP ///////////////////////////////////////// 19 | /* 20 | * TC4 is used to track time as micros() doesn't work in ISRs 21 | * TimeManage tracks TC4 overflows, computes timestamps as uS since last zero_clock() 22 | * zero_clock() is called by RPC from client 23 | * Duration measurement provided for testing of MotorSyncManager pulse generation 24 | * 25 | */ 26 | 27 | unsigned long TimeManager::get_elapsed_time_ms() 28 | { 29 | return (unsigned long)((float)(MS_PER_TC4_CYCLE*(float)ts_base)); 30 | } 31 | 32 | TimeManager::TimeManager() 33 | { 34 | ts_base=0; 35 | } 36 | 37 | uint64_t TimeManager::current_time_us() 38 | { 39 | uint64_t base; 40 | int cntr = TC4->COUNT16.COUNT.reg; 41 | base = ts_base*US_PER_TC4_CYCLE; 42 | return base+(int)(round(cntr*US_PER_TC4_TICK)); 43 | } 44 | 45 | void TimeManager::clock_zero() 46 | { 47 | ts_base=0; 48 | TC4->COUNT16.COUNT.reg=0; 49 | } 50 | -------------------------------------------------------------------------------- /arduino/hello_wacc/TimeManager.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | 7 | https://www.gnu.org/licenses/gpl-3.0.html 8 | 9 | Copyright (c) 2020 by Hello Robot Inc. All rights reserved. 10 | -------------------------------------------------------------- 11 | */ 12 | 13 | #ifndef __TIME_MANAGER_H__ 14 | #define __TIME_MANAGER_H__ 15 | 16 | #include "Common.h" 17 | 18 | #define FS_TC4 1000 19 | #define US_PER_TC4_CYCLE 1000000/FS_TC4 //1000 at 1000Hz 20 | #define MS_PER_TC4_CYCLE US_PER_TC4_CYCLE/1000 21 | #define TC4_TICKS_PER_CYCLE (int)( round(48000000 / 2 / FS_TC4)) //24,000 at 1000hz, 2:1 prescalar TC4 is 32bit timer 22 | #define US_PER_TC4_TICK 1000000.0*2/48000000 23 | 24 | 25 | class TimeManager { 26 | public: 27 | TimeManager(); 28 | uint64_t current_time_us(); 29 | void clock_zero(); 30 | unsigned long get_elapsed_time_ms(); 31 | volatile int ts_base; //Incremented at rate FS_TC4 (Hz) 32 | }; 33 | 34 | extern TimeManager time_manager; 35 | 36 | #endif 37 | -------------------------------------------------------------------------------- /arduino/hello_wacc/Wacc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef __WACC_H__ 13 | #define __WACC_H__ 14 | 15 | #include "Common.h" 16 | extern uint8_t BOARD_VARIANT; 17 | extern void setupWacc(); 18 | extern void stepWaccRPC(); 19 | extern void setupBoardVariants(); 20 | void TC5_Handler(); 21 | #endif 22 | -------------------------------------------------------------------------------- /arduino/hello_wacc/hello_wacc.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #include 13 | #include "Common.h" 14 | #include "Transport.h" 15 | #include "Wacc.h" 16 | #include "Accel.h" 17 | 18 | 19 | void setup() // This code runs once at startup 20 | { 21 | setupBoardVariants(); 22 | setupAccel(); 23 | SerialUSB.begin(2000000); 24 | setupWacc(); 25 | setupTransport(); 26 | } 27 | 28 | void loop() 29 | { 30 | stepWaccRPC(); 31 | } 32 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_ADXL343/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit ADXL343 2 | version=1.2.0 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Unified driver for the ADXL343 Accelerometer 6 | paragraph=Unified driver for the ADXL343 Accelerometer 7 | category=Sensors 8 | url=https://github.com/adafruit/Adafruit_ADXL343 9 | architectures=* 10 | depends=Adafruit Unified Sensor 11 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_ADXL343/license.txt: -------------------------------------------------------------------------------- 1 | Software License Agreement (BSD License) 2 | 3 | Copyright (c) 2019, Adafruit Industries 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 1. Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | 2. Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | 3. Neither the name of the copyright holders nor the 14 | names of its contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS ''AS IS'' AND ANY 18 | EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 19 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 20 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE FOR ANY 21 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 22 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 23 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 24 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 26 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_AHRS/Adafruit_Sensor_Set.h: -------------------------------------------------------------------------------- 1 | #ifndef __ADAFRUIT_SENSOR_SET_H__ 2 | #define __ADAFRUIT_SENSOR_SET_H__ 3 | 4 | #include 5 | 6 | // Interface for a device that has multiple sensors that can be queried by type. 7 | class Adafruit_Sensor_Set 8 | { 9 | public: 10 | virtual ~Adafruit_Sensor_Set() {} 11 | virtual Adafruit_Sensor* getSensor(sensors_type_t type) { return NULL; } 12 | }; 13 | 14 | #endif 15 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_AHRS/Adafruit_Simple_AHRS.h: -------------------------------------------------------------------------------- 1 | #ifndef __ADAFRUIT_SIMPLE_AHRS_H__ 2 | #define __ADAFRUIT_SIMPLE_AHRS_H__ 3 | 4 | #include 5 | #include "Adafruit_Sensor_Set.h" 6 | 7 | // Simple sensor fusion AHRS using an accelerometer and magnetometer. 8 | class Adafruit_Simple_AHRS 9 | { 10 | public: 11 | Adafruit_Simple_AHRS(Adafruit_Sensor* accelerometer, Adafruit_Sensor* magnetometer); 12 | Adafruit_Simple_AHRS(Adafruit_Sensor_Set& sensors); 13 | bool getOrientation(sensors_vec_t* orientation); 14 | 15 | private: 16 | Adafruit_Sensor* _accel; 17 | Adafruit_Sensor* _mag; 18 | 19 | }; 20 | 21 | #endif 22 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_AHRS/examples/ahrs_9dof/ahrs_9dof.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | // Create sensor instances. 7 | Adafruit_LSM303_Accel_Unified accel(30301); 8 | Adafruit_LSM303_Mag_Unified mag(30302); 9 | 10 | // Create simple AHRS algorithm using the above sensors. 11 | Adafruit_Simple_AHRS ahrs(&accel, &mag); 12 | 13 | void setup() 14 | { 15 | Serial.begin(115200); 16 | Serial.println(F("Adafruit 9 DOF Board AHRS Example")); Serial.println(""); 17 | 18 | // Initialize the sensors. 19 | accel.begin(); 20 | mag.begin(); 21 | } 22 | 23 | void loop(void) 24 | { 25 | sensors_vec_t orientation; 26 | 27 | // Use the simple AHRS function to get the current orientation. 28 | if (ahrs.getOrientation(&orientation)) 29 | { 30 | /* 'orientation' should have valid .roll and .pitch fields */ 31 | Serial.print(F("Orientation: ")); 32 | Serial.print(orientation.roll); 33 | Serial.print(F(" ")); 34 | Serial.print(orientation.pitch); 35 | Serial.print(F(" ")); 36 | Serial.print(orientation.heading); 37 | Serial.println(F("")); 38 | } 39 | 40 | delay(100); 41 | } 42 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_AHRS/examples/ahrs_calibration_ble/ArdPrintf.h: -------------------------------------------------------------------------------- 1 | #ifndef ARDPRINTF 2 | #define ARDPRINTF 3 | #define ARDBUFFER 20 4 | #include 5 | #include 6 | 7 | int ardprintf(char *str, ...) 8 | { 9 | int i, count=0, j=0, flag=0; 10 | char temp[ARDBUFFER+1]; 11 | for(i=0; str[i]!='\0';i++) if(str[i]=='%') count++; 12 | 13 | va_list argv; 14 | va_start(argv, count); 15 | for(i=0,j=0; str[i]!='\0';i++) 16 | { 17 | if(str[i]=='%') 18 | { 19 | temp[j] = '\0'; 20 | Serial.print(temp); 21 | j=0; 22 | temp[0] = '\0'; 23 | 24 | switch(str[++i]) 25 | { 26 | case 'd': Serial.print(va_arg(argv, int)); 27 | break; 28 | case 'l': Serial.print(va_arg(argv, long)); 29 | break; 30 | case 'f': Serial.print(va_arg(argv, double)); 31 | break; 32 | case 'c': Serial.print((char)va_arg(argv, int)); 33 | break; 34 | case 's': Serial.print(va_arg(argv, char *)); 35 | break; 36 | default: ; 37 | }; 38 | } 39 | else 40 | { 41 | temp[j] = str[i]; 42 | j = (j+1)%ARDBUFFER; 43 | if(j==0) 44 | { 45 | temp[ARDBUFFER] = '\0'; 46 | Serial.print(temp); 47 | temp[0]='\0'; 48 | } 49 | } 50 | }; 51 | Serial.println(); 52 | return count + 1; 53 | } 54 | #undef ARDBUFFER 55 | #endif 56 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_AHRS/examples/ahrs_fusion_usb/sample_config_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_AHRS/examples/ahrs_fusion_usb/sample_config_data.png -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_AHRS/examples/ahrs_mahony/sample_config_data.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_AHRS/examples/ahrs_mahony/sample_config_data.png -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_AHRS/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit AHRS 2 | version=1.1.3 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=AHRS (Altitude and Heading Reference System) for Adafruit's 9DOF and 10DOF breakouts 6 | paragraph=AHRS (Altitude and Heading Reference System) for Adafruit's 9DOF and 10DOF breakouts 7 | category=Sensors 8 | url=https://github.com/adafruit/Adafruit_AHRS 9 | architectures=* 10 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_AHRS/processing/bunnyrotate/data/bunny.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.94b - (c)2007 guruware 2 | # File Created: 04.07.2010 10:41:39 3 | 4 | newmtl Body 5 | Ns 32 6 | d 1 7 | Tr 1 8 | Tf 1 1 1 9 | illum 2 10 | Ka 0.0000 0.0000 0.0000 11 | Kd 0.7412 0.4784 0.4765 12 | Ks 0.3500 0.3500 0.6500 13 | 14 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_AHRS/processing/bunnyrotate_ahrs_fusion_usb/data/bunny.mtl: -------------------------------------------------------------------------------- 1 | # 3ds Max Wavefront OBJ Exporter v0.94b - (c)2007 guruware 2 | # File Created: 04.07.2010 10:41:39 3 | 4 | newmtl Body 5 | Ns 32 6 | d 1 7 | Tr 1 8 | Tf 1 1 1 9 | illum 2 10 | Ka 0.0000 0.0000 0.0000 11 | Kd 0.7412 0.4784 0.4765 12 | Ks 0.3500 0.3500 0.6500 13 | 14 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_FXAS21002C/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Adafruit Industries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_FXAS21002C/README.md: -------------------------------------------------------------------------------- 1 | # Adafruit_FXAS21002C 2 | Driver for the Adafruit FXAS21002C 3-Axis gyroscope breakout 3 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_FXAS21002C/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit FXAS21002C 2 | version=1.1.2 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Unified sensor driver for the FXAS210002C Gyroscope 6 | paragraph=Unified sensor driver for the FXAS21002C Gyroscope 7 | category=Sensors 8 | url=https://github.com/adafruit/Adafruit_FXAS21002C 9 | architectures=* 10 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_FXOS8700/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2016 Adafruit Industries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_FXOS8700/README.md: -------------------------------------------------------------------------------- 1 | # Adafruit_FXOS8700 2 | 3 | Driver for the Adafruit FXOS8700 Accelerometer/Magnetometer Breakout 4 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_FXOS8700/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit FXOS8700 2 | version=1.1.3 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Unified sensor driver for the FXOS8700 Accelerometer/Magnetometer 6 | paragraph=Unified sensor driver for the FXOS8700 Accelerometer/Magnetometer 7 | category=Sensors 8 | url=https://github.com/adafruit/Adafruit_FXOS8700 9 | architectures=* 10 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contribution Guidelines 2 | 3 | This library is the culmination of the expertise of many members of the open source community who have dedicated their time and hard work. The best way to ask for help or propose a new idea is to [create a new issue](https://github.com/adafruit/Adafruit_NeoPixel/issues/new) while creating a Pull Request with your code changes allows you to share your own innovations with the rest of the community. 4 | 5 | The following are some guidelines to observe when creating issues or PRs: 6 | 7 | - Be friendly; it is important that we can all enjoy a safe space as we are all working on the same project and it is okay for people to have different ideas 8 | 9 | - [Use code blocks](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet#code); it helps us help you when we can read your code! On that note also refrain from pasting more than 30 lines of code in a post, instead [create a gist](https://gist.github.com/) if you need to share large snippets 10 | 11 | - Use reasonable titles; refrain from using overly long or capitalized titles as they are usually annoying and do little to encourage others to help :smile: 12 | 13 | - Be detailed; refrain from mentioning code problems without sharing your source code and always give information regarding your board and version of the library 14 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/RGBWstrandtest/.esp8266.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_NeoPixel/examples/RGBWstrandtest/.esp8266.test.skip -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/RGBWstrandtest/.trinket.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_NeoPixel/examples/RGBWstrandtest/.trinket.test.skip -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/StrandtestArduinoBLE/.none.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_NeoPixel/examples/StrandtestArduinoBLE/.none.test.only -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/StrandtestArduinoBLECallback/.none.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_NeoPixel/examples/StrandtestArduinoBLECallback/.none.test.only -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/StrandtestBLE/.none.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_NeoPixel/examples/StrandtestBLE/.none.test.only -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/StrandtestBLE/BLESerial.h: -------------------------------------------------------------------------------- 1 | #ifndef _BLE_SERIAL_H_ 2 | #define _BLE_SERIAL_H_ 3 | 4 | #include 5 | #include 6 | 7 | class BLESerial : public BLEPeripheral, public Stream 8 | { 9 | public: 10 | BLESerial(unsigned char req, unsigned char rdy, unsigned char rst); 11 | 12 | void begin(...); 13 | void poll(); 14 | void end(); 15 | 16 | virtual int available(void); 17 | virtual int peek(void); 18 | virtual int read(void); 19 | virtual void flush(void); 20 | virtual size_t write(uint8_t byte); 21 | using Print::write; 22 | virtual operator bool(); 23 | 24 | private: 25 | unsigned long _flushed; 26 | static BLESerial* _instance; 27 | 28 | size_t _rxHead; 29 | size_t _rxTail; 30 | size_t _rxCount() const; 31 | uint8_t _rxBuffer[BLE_ATTRIBUTE_MAX_VALUE_LENGTH]; 32 | size_t _txCount; 33 | uint8_t _txBuffer[BLE_ATTRIBUTE_MAX_VALUE_LENGTH]; 34 | 35 | BLEService _uartService = BLEService("6E400001-B5A3-F393-E0A9-E50E24DCCA9E"); 36 | BLEDescriptor _uartNameDescriptor = BLEDescriptor("2901", "UART"); 37 | BLECharacteristic _rxCharacteristic = BLECharacteristic("6E400002-B5A3-F393-E0A9-E50E24DCCA9E", BLEWriteWithoutResponse, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 38 | BLEDescriptor _rxNameDescriptor = BLEDescriptor("2901", "RX - Receive Data (Write)"); 39 | BLECharacteristic _txCharacteristic = BLECharacteristic("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLENotify, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 40 | BLEDescriptor _txNameDescriptor = BLEDescriptor("2901", "TX - Transfer Data (Notify)"); 41 | 42 | void _received(const uint8_t* data, size_t size); 43 | static void _received(BLECentral& /*central*/, BLECharacteristic& rxCharacteristic); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/StrandtestBLE_nodelay/.none.test.only: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/StrandtestBLE_nodelay/BLESerial.h: -------------------------------------------------------------------------------- 1 | #ifndef _BLE_SERIAL_H_ 2 | #define _BLE_SERIAL_H_ 3 | 4 | #include 5 | #include 6 | 7 | class BLESerial : public BLEPeripheral, public Stream 8 | { 9 | public: 10 | BLESerial(unsigned char req, unsigned char rdy, unsigned char rst); 11 | 12 | void begin(...); 13 | void poll(); 14 | void end(); 15 | 16 | virtual int available(void); 17 | virtual int peek(void); 18 | virtual int read(void); 19 | virtual void flush(void); 20 | virtual size_t write(uint8_t byte); 21 | using Print::write; 22 | virtual operator bool(); 23 | 24 | private: 25 | unsigned long _flushed; 26 | static BLESerial* _instance; 27 | 28 | size_t _rxHead; 29 | size_t _rxTail; 30 | size_t _rxCount() const; 31 | uint8_t _rxBuffer[BLE_ATTRIBUTE_MAX_VALUE_LENGTH]; 32 | size_t _txCount; 33 | uint8_t _txBuffer[BLE_ATTRIBUTE_MAX_VALUE_LENGTH]; 34 | 35 | BLEService _uartService = BLEService("6E400001-B5A3-F393-E0A9-E50E24DCCA9E"); 36 | BLEDescriptor _uartNameDescriptor = BLEDescriptor("2901", "UART"); 37 | BLECharacteristic _rxCharacteristic = BLECharacteristic("6E400002-B5A3-F393-E0A9-E50E24DCCA9E", BLEWriteWithoutResponse, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 38 | BLEDescriptor _rxNameDescriptor = BLEDescriptor("2901", "RX - Receive Data (Write)"); 39 | BLECharacteristic _txCharacteristic = BLECharacteristic("6E400003-B5A3-F393-E0A9-E50E24DCCA9E", BLENotify, BLE_ATTRIBUTE_MAX_VALUE_LENGTH); 40 | BLEDescriptor _txNameDescriptor = BLEDescriptor("2901", "TX - Transfer Data (Notify)"); 41 | 42 | void _received(const uint8_t* data, size_t size); 43 | static void _received(BLECentral& /*central*/, BLECharacteristic& rxCharacteristic); 44 | }; 45 | 46 | #endif 47 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/buttoncycler/.esp8266.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_NeoPixel/examples/buttoncycler/.esp8266.test.skip -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/simple/.esp8266.test.skip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_NeoPixel/examples/simple/.esp8266.test.skip -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel/examples/simple/simple.ino: -------------------------------------------------------------------------------- 1 | // NeoPixel Ring simple sketch (c) 2013 Shae Erisson 2 | // Released under the GPLv3 license to match the rest of the 3 | // Adafruit NeoPixel library 4 | 5 | #include 6 | #ifdef __AVR__ 7 | #include // Required for 16 MHz Adafruit Trinket 8 | #endif 9 | 10 | // Which pin on the Arduino is connected to the NeoPixels? 11 | #define PIN 6 // On Trinket or Gemma, suggest changing this to 1 12 | 13 | // How many NeoPixels are attached to the Arduino? 14 | #define NUMPIXELS 16 // Popular NeoPixel ring size 15 | 16 | // When setting up the NeoPixel library, we tell it how many pixels, 17 | // and which pin to use to send signals. Note that for older NeoPixel 18 | // strips you might need to change the third parameter -- see the 19 | // strandtest example for more information on possible values. 20 | Adafruit_NeoPixel pixels(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); 21 | 22 | #define DELAYVAL 500 // Time (in milliseconds) to pause between pixels 23 | 24 | void setup() { 25 | // These lines are specifically to support the Adafruit Trinket 5V 16 MHz. 26 | // Any other board, you can remove this part (but no harm leaving it): 27 | #if defined(__AVR_ATtiny85__) && (F_CPU == 16000000) 28 | clock_prescale_set(clock_div_1); 29 | #endif 30 | // END of Trinket-specific code. 31 | 32 | pixels.begin(); // INITIALIZE NeoPixel strip object (REQUIRED) 33 | } 34 | 35 | void loop() { 36 | pixels.clear(); // Set all pixel colors to 'off' 37 | 38 | // The first NeoPixel in a strand is #0, second is 1, all the way up 39 | // to the count of pixels minus one. 40 | for(int i=0; i 5 | sentence=Arduino library for controlling single-wire-based LED pixels and strip. 6 | paragraph=Arduino library for controlling single-wire-based LED pixels and strip. 7 | category=Display 8 | url=https://github.com/adafruit/Adafruit_NeoPixel 9 | architectures=* 10 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel_ZeroDMA/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2018 Adafruit Industries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel_ZeroDMA/keywords.txt: -------------------------------------------------------------------------------- 1 | ####################################### 2 | # Syntax Coloring Map For Adafruit_NeoPixel_ZeroDMA 3 | ####################################### 4 | 5 | ####################################### 6 | # Datatypes (KEYWORD1) 7 | ####################################### 8 | 9 | Adafruit_NeoPixel_ZeroDMA KEYWORD1 10 | 11 | ####################################### 12 | # Methods and Functions (KEYWORD2) 13 | ####################################### 14 | 15 | begin KEYWORD2 16 | show KEYWORD2 17 | setBrightness KEYWORD2 18 | getBrightness KEYWORD2 19 | canShow KEYWORD2 20 | 21 | 22 | ####################################### 23 | # Instances (KEYWORD2) 24 | ####################################### 25 | 26 | 27 | ####################################### 28 | # Constants (LITERAL1) 29 | ####################################### 30 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_NeoPixel_ZeroDMA/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit DMA neopixel library 2 | version=1.3.0 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Arduino library for NeoPixel DMA on SAMD21 and SAMD51 microcontrollers 6 | paragraph=Arduino library for NeoPixel DMA on SAMD21 and SAMD51 microcontrollers 7 | category=Display 8 | url=https://github.com/adafruit/Adafruit_NeoPixel_ZeroDMA 9 | architectures=samd 10 | depends=Adafruit NeoPixel 11 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_Unified_Sensor/Adafruit_Sensor.h: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_Unified_Sensor/Adafruit_Sensor.h -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_Unified_Sensor/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit Unified Sensor 2 | version=1.0.2 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=Required for all Adafruit Unified Sensor based libraries. 6 | paragraph=A unified sensor abstraction layer used by many Adafruit sensor libraries. 7 | category=Sensors 8 | url=https://github.com/adafruit/Adafruit_Sensor 9 | architectures=* 10 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_ZeroDMA/LICENSE: -------------------------------------------------------------------------------- 1 | The MIT License (MIT) 2 | 3 | Copyright (c) 2016 Adafruit Industries 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_ZeroDMA/README.md: -------------------------------------------------------------------------------- 1 | # Adafruit_ZeroDMA library [![Build Status](https://github.com/adafruit/Adafruit_ZeroDMA/workflows/Arduino%20Library%20CI/badge.svg)](https://github.com/adafruit/Adafruit_ZeroDMA/actions) 2 | 3 | DMA helper/wrapped for ATSAMD21 such as Arduino Zero & Feather M0 4 | 5 | Current version of this library no longer requires Adafruit_ASFcore as a prerequisite. However...IT BREAKS COMPATIBILITY WITH PRIOR VERSIONS. Function names, calling sequence and return types/values have changed. See examples! 6 | 7 | Item(s) in 'utility' directory are much pared-down derivatives of Atmel ASFcore 3 files. Please keep their original copyright and license intact when editing. 8 | -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_ZeroDMA/examples/zerodma_adc/.zero.test.only: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/arduino/libraries/Adafruit_ZeroDMA/examples/zerodma_adc/.zero.test.only -------------------------------------------------------------------------------- /arduino/libraries/Adafruit_ZeroDMA/library.properties: -------------------------------------------------------------------------------- 1 | name=Adafruit Zero DMA Library 2 | version=1.1.0 3 | author=Adafruit 4 | maintainer=Adafruit 5 | sentence=DMA helper/wrapped for ATSAMD21 such as Arduino Zero & Feather M0 6 | paragraph=DMA helper/wrapped for ATSAMD21 such as Arduino Zero & Feather M0 7 | category=Signal Input/Output 8 | url=https://github.com/adafruit/Adafruit_ZeroDMA 9 | architectures=samd 10 | -------------------------------------------------------------------------------- /arduino/libraries/FlashStorage/examples/EmulateEEPROM/EmulateEEPROM.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Demonstrate how to use FlashStorage with an API that is similar to the EEPROM library. 3 | 4 | This example code is in the public domain. 5 | 6 | Written by A. Christian 7 | Edited 14 Oct 2016 by Cristian Maglie 8 | */ 9 | 10 | // Include EEPROM-like API for FlashStorage 11 | #include 12 | 13 | void setup() { 14 | Serial.begin(9600); 15 | 16 | // If the EEPROM is empty then isValid() is false 17 | if (!EEPROM.isValid()) { 18 | 19 | Serial.println("EEPROM is empty, writing some example data:"); 20 | Serial.print("->"); 21 | for (int i=0; i<20; i++) { 22 | EEPROM.write(i, 100+i); 23 | Serial.print(" "); 24 | Serial.print(100+i); 25 | } 26 | Serial.println(); 27 | 28 | // commit() saves all the changes to EEPROM, it must be called 29 | // every time the content of virtual EEPROM is changed to make 30 | // the change permanent. 31 | // This operation burns Flash write cycles and should not be 32 | // done too often. See readme for details: 33 | // https://github.com/cmaglie/FlashStorage#limited-number-of-writes 34 | EEPROM.commit(); 35 | Serial.println("Done!"); 36 | 37 | Serial.print("After commit, calling isValid() returns "); 38 | Serial.println(EEPROM.isValid()); 39 | 40 | } else { 41 | 42 | Serial.println("EEPROM has been written."); 43 | Serial.println("Here is the content of the first 20 bytes:"); 44 | 45 | Serial.print("->"); 46 | for (int i=0; i<20; i++) { 47 | Serial.print(" "); 48 | Serial.print(EEPROM.read(i)); 49 | } 50 | Serial.println(); 51 | 52 | } 53 | } 54 | 55 | void loop() { 56 | } 57 | -------------------------------------------------------------------------------- /arduino/libraries/FlashStorage/examples/FlashStoreAndRetrieve/FlashStoreAndRetrieve.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Store and retrieve an integer value in Flash memory. 3 | The value is increased each time the board is restarted. 4 | 5 | This example code is in the public domain. 6 | 7 | Written 30 Apr 2015 by Cristian Maglie 8 | */ 9 | 10 | #include 11 | 12 | // Reserve a portion of flash memory to store an "int" variable 13 | // and call it "my_flash_store". 14 | FlashStorage(my_flash_store, int); 15 | 16 | // Note: the area of flash memory reserved for the variable is 17 | // lost every time the sketch is uploaded on the board. 18 | 19 | void setup() { 20 | SERIAL_PORT_MONITOR.begin(9600); 21 | 22 | int number; 23 | 24 | // Read the content of "my_flash_store" and assign it to "number" 25 | number = my_flash_store.read(); 26 | 27 | // Print the current number on the serial monitor 28 | SERIAL_PORT_MONITOR.println(number); 29 | 30 | // Save into "my_flash_store" the number increased by 1 for the 31 | // next run of the sketch 32 | my_flash_store.write(number + 1); 33 | } 34 | 35 | void loop() { 36 | // Do nothing... 37 | } 38 | 39 | -------------------------------------------------------------------------------- /arduino/libraries/FlashStorage/library.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "FlashStorage", 3 | "keywords": "storage,data", 4 | "description": "The FlashStorage library aims to provide a convenient way to store and retrieve user's data using the non-volatile flash memory of microcontrollers.", 5 | "authors": 6 | { 7 | "name": "Arduino", 8 | "email": "info@arduino.cc", 9 | "url": "https://github.com/cmaglie/FlashStorage", 10 | "maintainer": true 11 | }, 12 | "repository": 13 | { 14 | "type": "git", 15 | "url": "https://github.com/cmaglie/FlashStorage" 16 | }, 17 | "version": "0.7.1", 18 | "frameworks": "arduino", 19 | "platforms": "atmelsam" 20 | } 21 | -------------------------------------------------------------------------------- /arduino/libraries/FlashStorage/library.properties: -------------------------------------------------------------------------------- 1 | name=FlashStorage 2 | version=0.7.1 3 | author=Various 4 | maintainer=Arduino 5 | sentence=The FlashStorage library aims to provide a convenient way to store and retrieve user's data using the non-volatile flash memory of microcontrollers. 6 | paragraph=Useful if the EEPROM is not available or too small. Currently, only ATSAMD21 cpu is supported (and consequently every board based on this cpu like the Arduino Zero or Aduino MKR1000). 7 | url=https://github.com/cmaglie/FlashStorage 8 | architectures=samd 9 | category=Data Storage 10 | -------------------------------------------------------------------------------- /arduino/libraries/Hello_Serial_Transport/Transport.h: -------------------------------------------------------------------------------- 1 | #ifndef __TRANSPORT_H__ 2 | #define __TRANSPORT_H__ 3 | #include "Arduino.h" 4 | bool stepTransport(void (*rpc_callback)()); 5 | void setupTransport(); 6 | 7 | extern uint8_t rpc_in[]; 8 | extern uint8_t rpc_out[]; 9 | extern uint16_t num_byte_rpc_out; 10 | extern uint16_t num_byte_rpc_in; 11 | 12 | 13 | #endif 14 | -------------------------------------------------------------------------------- /arduino/libraries/Hello_Serial_Transport/library.properties: -------------------------------------------------------------------------------- 1 | name=Hello-Serial-Transport 2 | version=0.1 3 | author=Aaron Edsinger 4 | maintainer=Aaron Edsinger 5 | sentence=A protocol for large data communication between Arduino and python 6 | paragraph=A protocol for large data communication between Arduino and python 7 | category=Communication 8 | url=https://github.com/foo 9 | architectures=* 10 | -------------------------------------------------------------------------------- /arduino/libraries/SparkFun_BNO080_Cortex_Based_IMU/CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | ### How to Contribute 2 | 3 | Thank you so *much* for offering to help out. We truly appreciate it. 4 | 5 | If you'd like to contribute, start by searching through the [issues](https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/issues) and [pull requests](https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/pulls) to see whether someone else has raised a similar idea or question. 6 | 7 | If you decide to add a feature to this library, please create a PR following these best practices: 8 | 9 | - Change as little as possible. Do not sumbit a PR that changes 100 lines of whitespace. Break up into multiple PRs if necessary. 10 | - If you've added a new feature document it with a simple example sketch. This serves both as a test of your PR and as a quick way for users to quickly learn how to use your new feature. 11 | - If you add new functions also add them to keywords.txt so that they are properly highlighted in Arduino. [Read more](https://www.arduino.cc/en/Hacking/libraryTutorial). 12 | - Please submit your PR using the [release-candidate branch](https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library/tree/release-candidate). That way, we can merge and test your PR quickly without changing the _main_ branch 13 | 14 | ## Style guide 15 | 16 | Please read and follow the [Arduino API style guide](https://www.arduino.cc/en/Reference/APIStyleGuide). Also read and consider the [Arduino style guide](https://www.arduino.cc/en/Reference/StyleGuide). 17 | -------------------------------------------------------------------------------- /arduino/libraries/SparkFun_BNO080_Cortex_Based_IMU/ISSUE_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | ### Subject of the issue 2 | Describe your issue here. 3 | 4 | ### Your workbench 5 | * What development board or microcontroller are you using? 6 | * What version of hardware or breakout board are you using? 7 | * How is the breakout board to your microcontroller? 8 | * How is everything being powered? 9 | * Are there any additional details that may help us help you? 10 | 11 | ### Steps to reproduce 12 | Tell us how to reproduce this issue. Please post stripped down example code demonstrating your issue. 13 | 14 | ### Expected behavior 15 | Tell us what should happen 16 | 17 | ### Actual behavior 18 | Tell us what happens instead 19 | -------------------------------------------------------------------------------- /arduino/libraries/SparkFun_BNO080_Cortex_Based_IMU/examples/Example10-PrintPacket/Example10-PrintPacket.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Using the BNO080 IMU 3 | By: Nathan Seidle 4 | SparkFun Electronics 5 | Date: December 21st, 2017 6 | SparkFun code, firmware, and software is released under the MIT License. 7 | Please see LICENSE.md for further details. 8 | 9 | Feel like supporting our work? Buy a board from SparkFun! 10 | https://www.sparkfun.com/products/14586 11 | 12 | This example shows how to print the raw packets. This is handy for debugging. 13 | 14 | It takes about 1ms at 400kHz I2C to read a record from the sensor, but we are polling the sensor continually 15 | between updates from the sensor. Use the interrupt pin on the BNO080 breakout to avoid polling. 16 | 17 | Hardware Connections: 18 | Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other 19 | Plug the sensor onto the shield 20 | Serial.print it out at 115200 baud to serial monitor. 21 | */ 22 | 23 | #include 24 | 25 | #include "SparkFun_BNO080_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_BNO080 26 | BNO080 myIMU; 27 | 28 | void setup() 29 | { 30 | Serial.begin(115200); 31 | Serial.println(); 32 | Serial.println("BNO080 Read Example"); 33 | 34 | Wire.begin(); 35 | 36 | myIMU.begin(); 37 | 38 | Wire.setClock(400000); //Increase I2C data rate to 400kHz 39 | 40 | myIMU.enableDebugging(Serial); //Output debug messages to the Serial port. Serial1, SerialUSB, etc is also allowed. 41 | 42 | myIMU.enableMagnetometer(1000); 43 | myIMU.enableAccelerometer(1000); 44 | } 45 | 46 | void loop() 47 | { 48 | //Look for reports from the IMU 49 | if (myIMU.receivePacket() == true) 50 | { 51 | myIMU.printPacket(); 52 | } 53 | } 54 | -------------------------------------------------------------------------------- /arduino/libraries/SparkFun_BNO080_Cortex_Based_IMU/examples/Example12-LinearAccelerometer/Example12-LinearAccelerometer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Using the BNO080 IMU 3 | By: Nathan Seidle 4 | SparkFun Electronics 5 | Date: December 21st, 2017 6 | SparkFun code, firmware, and software is released under the MIT License. 7 | Please see LICENSE.md for further details. 8 | 9 | Feel like supporting our work? Buy a board from SparkFun! 10 | https://www.sparkfun.com/products/14586 11 | 12 | This example shows how to output accelerometer values 13 | 14 | Hardware Connections: 15 | Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other 16 | Plug the sensor onto the shield 17 | Serial.print it out at 115200 baud to serial monitor. 18 | */ 19 | 20 | #include 21 | 22 | #include "SparkFun_BNO080_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_BNO080 23 | BNO080 myIMU; 24 | 25 | void setup() 26 | { 27 | Serial.begin(115200); 28 | Serial.println(); 29 | Serial.println("BNO080 Read Example"); 30 | 31 | Wire.begin(); 32 | 33 | myIMU.begin(); 34 | 35 | Wire.setClock(400000); //Increase I2C data rate to 400kHz 36 | 37 | myIMU.enableLinearAccelerometer(50); //Send data update every 50ms 38 | 39 | Serial.println(F("Linear Accelerometer enabled")); 40 | Serial.println(F("Output in form x, y, z, in m/s^2")); 41 | } 42 | 43 | void loop() 44 | { 45 | //Look for reports from the IMU 46 | if (myIMU.dataAvailable() == true) 47 | { 48 | float x = myIMU.getLinAccelX(); 49 | float y = myIMU.getLinAccelY(); 50 | float z = myIMU.getLinAccelZ(); 51 | byte linAccuracy = myIMU.getLinAccelAccuracy(); 52 | 53 | Serial.print(x, 2); 54 | Serial.print(F(",")); 55 | Serial.print(y, 2); 56 | Serial.print(F(",")); 57 | Serial.print(z, 2); 58 | Serial.print(F(",")); 59 | Serial.print(linAccuracy); 60 | 61 | Serial.println(); 62 | } 63 | } 64 | -------------------------------------------------------------------------------- /arduino/libraries/SparkFun_BNO080_Cortex_Based_IMU/examples/Example2-Accelerometer/Example2-Accelerometer.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Using the BNO080 IMU 3 | By: Nathan Seidle 4 | SparkFun Electronics 5 | Date: December 21st, 2017 6 | SparkFun code, firmware, and software is released under the MIT License. 7 | Please see LICENSE.md for further details. 8 | 9 | Feel like supporting our work? Buy a board from SparkFun! 10 | https://www.sparkfun.com/products/14586 11 | 12 | This example shows how to output accelerometer values 13 | 14 | Hardware Connections: 15 | Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other 16 | Plug the sensor onto the shield 17 | Serial.print it out at 115200 baud to serial monitor. 18 | */ 19 | 20 | #include 21 | 22 | #include "SparkFun_BNO080_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_BNO080 23 | BNO080 myIMU; 24 | 25 | void setup() 26 | { 27 | Serial.begin(115200); 28 | Serial.println(); 29 | Serial.println("BNO080 Read Example"); 30 | 31 | Wire.begin(); 32 | 33 | myIMU.begin(); 34 | 35 | Wire.setClock(400000); //Increase I2C data rate to 400kHz 36 | 37 | myIMU.enableAccelerometer(50); //Send data update every 50ms 38 | 39 | Serial.println(F("Accelerometer enabled")); 40 | Serial.println(F("Output in form x, y, z, in m/s^2")); 41 | } 42 | 43 | void loop() 44 | { 45 | //Look for reports from the IMU 46 | if (myIMU.dataAvailable() == true) 47 | { 48 | float x = myIMU.getAccelX(); 49 | float y = myIMU.getAccelY(); 50 | float z = myIMU.getAccelZ(); 51 | 52 | Serial.print(x, 2); 53 | Serial.print(F(",")); 54 | Serial.print(y, 2); 55 | Serial.print(F(",")); 56 | Serial.print(z, 2); 57 | Serial.print(F(",")); 58 | 59 | Serial.println(); 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /arduino/libraries/SparkFun_BNO080_Cortex_Based_IMU/examples/Example3-Gyro/Example3-Gyro.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Using the BNO080 IMU 3 | By: Nathan Seidle 4 | SparkFun Electronics 5 | Date: December 21st, 2017 6 | SparkFun code, firmware, and software is released under the MIT License. 7 | Please see LICENSE.md for further details. 8 | 9 | Feel like supporting our work? Buy a board from SparkFun! 10 | https://www.sparkfun.com/products/14586 11 | 12 | This example shows how to output the parts of the calibrated gyro. 13 | 14 | It takes about 1ms at 400kHz I2C to read a record from the sensor, but we are polling the sensor continually 15 | between updates from the sensor. Use the interrupt pin on the BNO080 breakout to avoid polling. 16 | 17 | Hardware Connections: 18 | Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other 19 | Plug the sensor onto the shield 20 | Serial.print it out at 115200 baud to serial monitor. 21 | */ 22 | 23 | #include 24 | 25 | #include "SparkFun_BNO080_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_BNO080 26 | BNO080 myIMU; 27 | 28 | void setup() 29 | { 30 | Serial.begin(115200); 31 | Serial.println(); 32 | Serial.println("BNO080 Read Example"); 33 | 34 | Wire.begin(); 35 | 36 | myIMU.begin(); 37 | 38 | Wire.setClock(400000); //Increase I2C data rate to 400kHz 39 | 40 | myIMU.enableGyro(50); //Send data update every 50ms 41 | 42 | Serial.println(F("Gyro enabled")); 43 | Serial.println(F("Output in form x, y, z, in radians per second")); 44 | } 45 | 46 | void loop() 47 | { 48 | //Look for reports from the IMU 49 | if (myIMU.dataAvailable() == true) 50 | { 51 | float x = myIMU.getGyroX(); 52 | float y = myIMU.getGyroY(); 53 | float z = myIMU.getGyroZ(); 54 | 55 | Serial.print(x, 2); 56 | Serial.print(F(",")); 57 | Serial.print(y, 2); 58 | Serial.print(F(",")); 59 | Serial.print(z, 2); 60 | Serial.print(F(",")); 61 | 62 | Serial.println(); 63 | } 64 | } 65 | -------------------------------------------------------------------------------- /arduino/libraries/SparkFun_BNO080_Cortex_Based_IMU/examples/Example5-StepCounter/Example5-StepCounter.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Using the BNO080 IMU 3 | By: Nathan Seidle 4 | SparkFun Electronics 5 | Date: December 21st, 2017 6 | SparkFun code, firmware, and software is released under the MIT License. 7 | Please see LICENSE.md for further details. 8 | 9 | Feel like supporting our work? Buy a board from SparkFun! 10 | https://www.sparkfun.com/products/14586 11 | 12 | This example shows the step count. Tap the IC a few times to emulate a step. 13 | 14 | It takes about 1ms at 400kHz I2C to read a record from the sensor, but we are polling the sensor continually 15 | between updates from the sensor. Use the interrupt pin on the BNO080 breakout to avoid polling. 16 | 17 | Hardware Connections: 18 | Attach the Qwiic Shield to your Arduino/Photon/ESP32 or other 19 | Plug the sensor onto the shield 20 | Serial.print it out at 115200 baud to serial monitor. 21 | */ 22 | 23 | #include 24 | 25 | #include "SparkFun_BNO080_Arduino_Library.h" // Click here to get the library: http://librarymanager/All#SparkFun_BNO080 26 | BNO080 myIMU; 27 | 28 | void setup() 29 | { 30 | Serial.begin(115200); 31 | Serial.println(); 32 | Serial.println("BNO080 Read Example"); 33 | 34 | Wire.begin(); 35 | 36 | myIMU.begin(); 37 | 38 | Wire.setClock(400000); //Increase I2C data rate to 400kHz 39 | 40 | myIMU.enableStepCounter(500); //Send data update every 500ms 41 | 42 | Serial.println(F("Step Counter enabled")); 43 | Serial.println(F("Step count since sketch started:")); 44 | } 45 | 46 | void loop() 47 | { 48 | //Look for reports from the IMU 49 | if (myIMU.dataAvailable() == true) 50 | { 51 | unsigned int steps = myIMU.getStepCount(); 52 | 53 | Serial.print(steps); 54 | Serial.print(F(",")); 55 | 56 | Serial.println(); 57 | } 58 | } 59 | -------------------------------------------------------------------------------- /arduino/libraries/SparkFun_BNO080_Cortex_Based_IMU/library.properties: -------------------------------------------------------------------------------- 1 | name=SparkFun BNO080 Cortex Based IMU 2 | version=1.1.12 3 | author=SparkFun Electronics 4 | maintainer=SparkFun Electronics 5 | sentence=Library for the SparkFun Qwiic VR IMU - BNO080/BNO085 6 | paragraph=An Arduino Library for the BNO080 IMU. The BNO080 IMU has a combination triple axis accelerometer/gyro/magnetometer packaged with an ARM Cortex M0+ running powerful algorithms. This enables the BNO080 Inertial Measurement Unit (IMU) to produce accurate rotation vector headings with an error of 5 degrees or less. It's what we've been waiting for: all the sensor data is combined into meaningful, accurate IMU information. Available at: https://www.sparkfun.com/products/14586 7 | category=Sensors 8 | url=https://github.com/sparkfun/SparkFun_BNO080_Arduino_Library 9 | architectures=* 10 | -------------------------------------------------------------------------------- /arduino/libraries/library.properties: -------------------------------------------------------------------------------- 1 | name=Hello_Serial_Transport 2 | version=0.1 3 | author=Aaron Edsinger 4 | maintainer=Aaron Edsinger 5 | sentence=A protocol for large data communication between Arduino and Python 6 | paragraph=A protocol for large data communication between Arduino and Python 7 | category=Communication 8 | url=https://github.com/hello-robot/stretch_firmware 9 | architectures=* 10 | stretch_ 11 | -------------------------------------------------------------------------------- /arduino/libraries/readme.txt: -------------------------------------------------------------------------------- 1 | For information on installing libraries, see: http://www.arduino.cc/en/Guide/Libraries 2 | -------------------------------------------------------------------------------- /docs/extra.css: -------------------------------------------------------------------------------- 1 | [data-md-color-primary=hello-robot-light]{ 2 | --md-primary-fg-color: #122837; 3 | --md-primary-fg-color--light: hsla(0,0%, 100%, 0.7); 4 | --md-primary-fg-color--dark: hsla(0, 0%, 0%, 0.07); 5 | --md-primary-bg-color: hsla(341, 85%, 89%, 1.0); 6 | --md-typeset-a-color: #0550b3; 7 | --md-code-hl-number-color: hsla(196, 86%, 29%, 1); 8 | } 9 | [data-md-color-primary=hello-robot-dark]{ 10 | --md-primary-fg-color: #122837; 11 | --md-primary-fg-color--light: hsla(0,0%, 100%, 0.7); 12 | --md-primary-fg-color--dark: hsla(0, 0%, 0%, 0.07); 13 | --md-primary-bg-color: hsla(341, 85%, 89%, 1.0); 14 | --md-typeset-a-color: hsla(341, 85%, 89%, 1.0); 15 | --md-code-hl-number-color: hsla(196, 86%, 29%, 1); 16 | } 17 | 18 | 19 | [data-md-color-scheme="slate"] { 20 | --md-hue: 210; /* [0, 360] */ 21 | } 22 | 23 | /* 24 | Tables set to 100% width 25 | */ 26 | 27 | .md-typeset__table { 28 | min-width: 100%; 29 | } 30 | 31 | .md-typeset table:not([class]) { 32 | display: table; 33 | } 34 | -------------------------------------------------------------------------------- /docs/images/HelloRobotLogoBar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/HelloRobotLogoBar.png -------------------------------------------------------------------------------- /docs/images/arduino-1.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/arduino-1.png -------------------------------------------------------------------------------- /docs/images/arduino-2.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/arduino-2.png -------------------------------------------------------------------------------- /docs/images/arduino-3.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/arduino-3.png -------------------------------------------------------------------------------- /docs/images/arduino-4.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/arduino-4.png -------------------------------------------------------------------------------- /docs/images/banner.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/banner.png -------------------------------------------------------------------------------- /docs/images/data_pipeline.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/data_pipeline.png -------------------------------------------------------------------------------- /docs/images/hello_robot_favicon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/hello_robot_favicon.png -------------------------------------------------------------------------------- /docs/images/hello_robot_logo_light.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/hello_robot_logo_light.png -------------------------------------------------------------------------------- /docs/images/wacc_i2c.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/wacc_i2c.png -------------------------------------------------------------------------------- /docs/images/wacc_metro.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/wacc_metro.png -------------------------------------------------------------------------------- /docs/images/wacc_serial_loopback.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/wacc_serial_loopback.png -------------------------------------------------------------------------------- /docs/images/wacc_spi.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/wacc_spi.png -------------------------------------------------------------------------------- /docs/images/wrist_expansion_header.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/wrist_expansion_header.png -------------------------------------------------------------------------------- /docs/images/wrist_expansion_schematic_rs.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/docs/images/wrist_expansion_schematic_rs.png -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_calc/Accel.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc Calc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef __ACCEL_H__ 13 | #define __ACCEL_H__ 14 | #include "Common.h" 15 | 16 | extern float ax,ay,az; 17 | extern uint32_t single_tap_count; 18 | extern uint32_t double_tap_count; 19 | 20 | void setupAccel(); 21 | void stepAccel(); 22 | void onAccelInt1(); 23 | void onAccelInt2(); 24 | void setAccelRange(uint8_t r); 25 | void setSingleTapSensitivity(uint8_t dur, uint8_t thresh); 26 | extern uint32_t accel_debug; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_calc/Wacc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc Calc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef __WACC_H__ 13 | #define __WACC_H__ 14 | 15 | #include "Common.h" 16 | 17 | extern void setupWacc(); 18 | extern void stepWaccRPC(); 19 | void TC5_Handler(); 20 | #endif 21 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_calc/hello_wacc_calc.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc Calc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #include 13 | #include "Common.h" 14 | #include "Transport.h" 15 | #include "Wacc.h" 16 | #include "Accel.h" 17 | 18 | 19 | void setup() // This code runs once at startup 20 | { 21 | pinMode(LED, OUTPUT); 22 | pinMode(A0, INPUT); 23 | pinMode(D0, INPUT); 24 | pinMode(D1, INPUT); 25 | pinMode(D2, OUTPUT); 26 | pinMode(D3, OUTPUT); 27 | pinMode(ACCEL_INT1, INPUT); 28 | pinMode(ACCEL_INT2, INPUT); 29 | digitalWrite(LED, LOW); 30 | pinMode(D0, INPUT_PULLUP); 31 | pinMode(D1, INPUT_PULLUP); 32 | setupAccel(); 33 | SerialUSB.begin(2000000); 34 | setupWacc(); 35 | setupTransport(); 36 | } 37 | 38 | void loop() 39 | { 40 | stepWaccRPC(); 41 | } 42 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_i2c/Accel.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc I2C 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef __ACCEL_H__ 13 | #define __ACCEL_H__ 14 | #include "Common.h" 15 | 16 | extern float ax,ay,az; 17 | extern uint32_t single_tap_count; 18 | extern uint32_t double_tap_count; 19 | 20 | void setupAccel(); 21 | void stepAccel(); 22 | void onAccelInt1(); 23 | void onAccelInt2(); 24 | void setAccelRange(uint8_t r); 25 | void setSingleTapSensitivity(uint8_t dur, uint8_t thresh); 26 | extern uint32_t accel_debug; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_i2c/Wacc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc I2C 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef __WACC_H__ 13 | #define __WACC_H__ 14 | 15 | #include "Common.h" 16 | 17 | extern void setupWacc(); 18 | extern void stepWaccRPC(); 19 | void TC5_Handler(); 20 | #endif 21 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_i2c/hello_wacc_i2c.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc I2C 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #include 13 | #include "Common.h" 14 | #include "Transport.h" 15 | #include "Wacc.h" 16 | #include "Accel.h" 17 | 18 | 19 | void setup() // This code runs once at startup 20 | { 21 | pinMode(LED, OUTPUT); 22 | pinMode(A0, INPUT); 23 | pinMode(D0, INPUT); 24 | pinMode(D1, INPUT); 25 | pinMode(D2, OUTPUT); 26 | pinMode(D3, OUTPUT); 27 | pinMode(ACCEL_INT1, INPUT); 28 | pinMode(ACCEL_INT2, INPUT); 29 | digitalWrite(LED, LOW); 30 | pinMode(D0, INPUT_PULLUP); 31 | pinMode(D1, INPUT_PULLUP); 32 | setupAccel(); 33 | SerialUSB.begin(2000000); 34 | setupWacc(); 35 | setupTransport(); 36 | } 37 | 38 | void loop() 39 | { 40 | stepWaccRPC(); 41 | } 42 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_serial/Accel.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc Calc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef __ACCEL_H__ 13 | #define __ACCEL_H__ 14 | #include "Common.h" 15 | 16 | extern float ax,ay,az; 17 | extern uint32_t single_tap_count; 18 | extern uint32_t double_tap_count; 19 | 20 | void setupAccel(); 21 | void stepAccel(); 22 | void onAccelInt1(); 23 | void onAccelInt2(); 24 | void setAccelRange(uint8_t r); 25 | void setSingleTapSensitivity(uint8_t dur, uint8_t thresh); 26 | extern uint32_t accel_debug; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_serial/Wacc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc Calc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef __WACC_H__ 13 | #define __WACC_H__ 14 | 15 | #include "Common.h" 16 | 17 | extern void setupWacc(); 18 | extern void stepWaccRPC(); 19 | void TC5_Handler(); 20 | #endif 21 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_serial/hello_wacc_serial.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc Calc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #include 13 | #include "Common.h" 14 | #include "Transport.h" 15 | #include "Wacc.h" 16 | #include "Accel.h" 17 | 18 | 19 | void setup() // This code runs once at startup 20 | { 21 | pinMode(LED, OUTPUT); 22 | pinMode(D1, INPUT); 23 | pinMode(D2, OUTPUT); 24 | pinMode(D3, OUTPUT); 25 | pinMode(ACCEL_INT1, INPUT); 26 | pinMode(ACCEL_INT2, INPUT); 27 | digitalWrite(LED, LOW); 28 | pinMode(D0, INPUT_PULLUP); 29 | pinMode(D1, INPUT_PULLUP); 30 | setupAccel(); 31 | SerialUSB.begin(2000000); 32 | //Initial the serial connection to your custom serial peripheral 33 | SerialExt.begin(115200); 34 | setupWacc(); 35 | setupTransport(); 36 | } 37 | 38 | void loop() 39 | { 40 | stepWaccRPC(); 41 | } 42 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_spi/Accel.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc Spi 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef __ACCEL_H__ 13 | #define __ACCEL_H__ 14 | #include "Common.h" 15 | 16 | extern float ax,ay,az; 17 | extern uint32_t single_tap_count; 18 | extern uint32_t double_tap_count; 19 | 20 | void setupAccel(); 21 | void stepAccel(); 22 | void onAccelInt1(); 23 | void onAccelInt2(); 24 | void setAccelRange(uint8_t r); 25 | void setSingleTapSensitivity(uint8_t dur, uint8_t thresh); 26 | extern uint32_t accel_debug; 27 | 28 | #endif 29 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_spi/Wacc.h: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc Spi 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #ifndef __WACC_H__ 13 | #define __WACC_H__ 14 | 15 | #include "Common.h" 16 | 17 | extern void setupWacc(); 18 | extern void stepWaccRPC(); 19 | void TC5_Handler(); 20 | #endif 21 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/hello_wacc_spi/hello_wacc_spi.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Wacc 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | #include 13 | #include "Common.h" 14 | #include "Transport.h" 15 | #include "Wacc.h" 16 | #include "Accel.h" 17 | 18 | 19 | void setup() // This code runs once at startup 20 | { 21 | pinMode(LED, OUTPUT); 22 | pinMode(A0, INPUT); 23 | pinMode(D0, INPUT); 24 | pinMode(D1, INPUT); 25 | pinMode(D2, OUTPUT); 26 | pinMode(D3, OUTPUT); 27 | pinMode(ACCEL_INT1, INPUT); 28 | pinMode(ACCEL_INT2, INPUT); 29 | digitalWrite(LED, LOW); 30 | pinMode(D0, INPUT_PULLUP); 31 | pinMode(D1, INPUT_PULLUP); 32 | setupAccel(); 33 | SerialUSB.begin(2000000); 34 | setupWacc(); 35 | setupTransport(); 36 | } 37 | 38 | void loop() 39 | { 40 | stepWaccRPC(); 41 | } 42 | -------------------------------------------------------------------------------- /docs/tutorials/arduino/zero_wacc_i2c/zero_wacc_i2c.ino: -------------------------------------------------------------------------------- 1 | /* 2 | ------------------------------------------------------------- 3 | Hello Robot - Hello Zero I2C Slave 4 | 5 | All materials released under the GNU General Public License v3.0 (GNU GPLv3). 6 | https://www.gnu.org/licenses/gpl-3.0.html 7 | 8 | Copyright (c) 2020 by Hello Robot Inc. 9 | -------------------------------------------------------------- 10 | */ 11 | 12 | 13 | #include 14 | #include 15 | 16 | Calc_Command cmd; 17 | Calc_Status stat; 18 | uint8_t buf_in[9]; 19 | uint8_t buf_in_idx=0; 20 | uint8_t buf_out[4]; 21 | uint8_t buf_out_idx=0; 22 | 23 | 24 | struct __attribute__ ((packed)) Calc_Command{ 25 | float var1; 26 | float var2; 27 | uint8_t op; 28 | }; 29 | 30 | struct __attribute__ ((packed)) Calc_Status{ 31 | float result; 32 | }; 33 | 34 | 35 | float my_calc(uint8_t op, float var1, float var2) 36 | { 37 | if (op == 0) 38 | return var1 + var2; 39 | if (op == 1) 40 | return var1 * var2; 41 | if (op == 2) 42 | return var1 / var2; 43 | return 0; 44 | } 45 | 46 | void setup() 47 | { 48 | Wire.begin(4); // join i2c bus with address #4 49 | Wire.onReceive(receiveEvent); // register event 50 | Wire.onRequest(requestEvent); // register event 51 | } 52 | 53 | void loop() 54 | { 55 | delay(100); 56 | } 57 | 58 | //Send back the status upon request 59 | void requestEvent() { 60 | memcpy(buf_out, (uint8_t *) (&stat), sizeof(Calc_Status)); 61 | for (int i=0;i1: 30 | if x[0]=='m': 31 | menu() 32 | if x[0] == 'a': 33 | w.set_D2(1) 34 | if x[0] == 'b': 35 | w.set_D2(0) 36 | if x[0] == 'c': 37 | w.set_D3(1) 38 | if x[0] == 'd': 39 | w.set_D3(0) 40 | if x[0]=='r': 41 | print 'Resetting Board. Exiting...' 42 | w.board_reset() 43 | w.push_command() 44 | exit() 45 | 46 | if x[0]=='X': 47 | print '---Calculate Op(Var1,Var2) ---' 48 | print 'Op=0: Add' 49 | print 'Op=1: Mult' 50 | print 'Op=2: Div' 51 | print 'Enter Op' 52 | op=float(sys.stdin.readline()) 53 | print 'Enter Var1' 54 | var1 = float(sys.stdin.readline()) 55 | print 'Enter Var2' 56 | var2 = float(sys.stdin.readline()) 57 | w.calculate(op,var1,var2) 58 | 59 | w.push_command() 60 | else: 61 | w.pull_status() 62 | w.pretty_print() 63 | 64 | try: 65 | while True: 66 | try: 67 | step_interaction() 68 | except (ValueError): 69 | print('Bad input...') 70 | except (KeyboardInterrupt, SystemExit): 71 | w.stop() 72 | -------------------------------------------------------------------------------- /docs/tutorials/python/stretch_wacc_serial_jog.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | from wacc_serial_ext import WaccSerialExt 3 | w=WaccSerialExt() 4 | w.startup() 5 | try: 6 | while True: 7 | print('Hit enter to do TX/RX cycle') 8 | raw_input() 9 | w.serial_data_increment() 10 | w.push_command() 11 | print('TX to SerialExt', w._command['serial_ext']) 12 | w.pull_status() 13 | print('RX from SerialExt', w.status['serial_ext']) 14 | except (KeyboardInterrupt, SystemExit): 15 | w.stop() 16 | -------------------------------------------------------------------------------- /docs/tutorials/python/wacc_calc.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | from stretch_body.wacc import * 4 | from stretch_body.transport import * 5 | 6 | 7 | class WaccCalc(Wacc): 8 | """ 9 | This class demonstrates how to extend the Wacc class with custom data 10 | See the corresponding tutorial for more information. 11 | """ 12 | def __init__(self,verbose=False): 13 | Wacc.__init__(self,verbose=verbose, 14 | ext_status_cb=self.ext_unpack_status, #Set callback to unpack status 15 | ext_command_cb=self.ext_pack_command) #Set callback to pack command 16 | 17 | self._command['calc']={'op':0,'var1':0,'var2':0} #Extend command dictionary with custom fields 18 | self.status['calc'] =0.0 #Extend status dictionary with custom fields 19 | self.valid_firmware_protocol = ‘p99’ 20 | 21 | def calculate(self,op,var1,var2): 22 | """ 23 | 0: addition 24 | 1: multiplication 25 | 2: division 26 | """ 27 | self._command['calc']['op'] =int(op) 28 | self._command['calc']['var1']=float(var1) 29 | self._command['calc']['var2']=float(var2) 30 | self._dirty_command=True 31 | 32 | def pretty_print(self): 33 | Wacc.pretty_print(self) 34 | print 'Calc:',self.status['calc'] 35 | 36 | def ext_unpack_status(self,s): 37 | """ 38 | s: byte array to unpack 39 | return: number of bytes unpacked 40 | """ 41 | sidx=0 42 | self.status['calc'] = unpack_float_t(s[sidx:]) 43 | return 4 44 | 45 | def ext_pack_command(self,s,sidx): 46 | """ 47 | s: byte array to pack in to 48 | sidx: index to start packing at 49 | return: new sidx 50 | """ 51 | pack_float_t(s, sidx, self._command['calc']['var1']) 52 | sidx += 4 53 | pack_float_t(s, sidx, self._command['calc']['var2']) 54 | sidx += 4 55 | pack_uint8_t(s, sidx, self._command['calc']['op']) 56 | sidx += 1 57 | return sidx 58 | 59 | 60 | 61 | 62 | 63 | 64 | -------------------------------------------------------------------------------- /docs/tutorials/python/wacc_serial_ext.py: -------------------------------------------------------------------------------- 1 | #! /usr/bin/env python 2 | 3 | from stretch_body.wacc import * 4 | from stretch_body.transport import * 5 | 6 | 7 | class WaccSerialExt(Wacc): 8 | """ 9 | This class demonstrates how to extend the Wacc class with custom data 10 | See the corresponding tutorial for more information. 11 | """ 12 | def __init__(self,verbose=False): 13 | Wacc.__init__(self,verbose=verbose, 14 | ext_status_cb=self.ext_unpack_status, #Set callback to unpack status 15 | ext_command_cb=self.ext_pack_command) #Set callback to pack command 16 | self.valid_firmware_protocol = 'p99' #Ensure the custom protocol identifier matches that in the Common.h of the custom Wacc Serial firmware 17 | self.n_float=10 18 | self._command['serial_ext']=range(self.n_float) #Extend command dictionary with custom fields 19 | self.status['serial_ext'] =[0.0]*self.n_float #Extend status dictionary with custom fields 20 | 21 | def serial_data_increment(self): 22 | for i in range(self.n_float): 23 | self._command['serial_ext'][i] =float(self._command['serial_ext'][i]+1) 24 | self._dirty_command=True 25 | 26 | def pretty_print(self): 27 | Wacc.pretty_print(self) 28 | print('Serial Ext:',self.status['serial_ext']) 29 | 30 | def ext_unpack_status(self,s): 31 | """ 32 | s: byte array to unpack 33 | return: number of bytes unpacked 34 | """ 35 | sidx=0 36 | for i in range(self.n_float): 37 | self.status['serial_ext'][i] = unpack_float_t(s[sidx:]) 38 | sidx+=4 39 | return sidx 40 | 41 | def ext_pack_command(self,s,sidx): 42 | """ 43 | s: byte array to pack in to 44 | sidx: index to start packing at 45 | return: new sidx 46 | """ 47 | for i in range(self.n_float): 48 | pack_float_t(s, sidx, self._command['serial_ext'][i]) 49 | sidx += 4 50 | return sidx 51 | 52 | -------------------------------------------------------------------------------- /docs/tutorials_overview.md: -------------------------------------------------------------------------------- 1 | ![](./images/banner.png) 2 | 3 | # Integrating Custom Hardware 4 | 5 | These tutorials demonstrate how to use the Stretch wrist expansion header to integrate custom hardware into [Stretch Body](https://github.com/hello-robot/stretch_body). 6 | 7 | 8 | **NOTE** It is possible to brick the Wacc board by incorrectly configuring the hardware peripherals of the SAMD uC. 9 | Therefore, when integrating your custom hardware into the Wacc we strongly recommend emulating the Wacc board until the functionality is complete. 10 | The tutorial [Wacc Emulation](./tutorial_wacc_emulation.md) describes how to configure an Adafruit Metro M0 Express to behave as a stand-in for a Wacc board. 11 | 12 | 13 | 14 | | Tutorial | Description | 15 | |----------------------------------------------| ------------------------------------------------------------ | 16 | | [Data Transfer](./tutorial_data_transfer.md) | How to plumb your custom data from the wrist Arduino through Stretch Body | 17 | | [Wrist Board Emulation](./tutorial_wacc_emulation.md) | How to emulate the Stretch wrist board using an off the shelf Arduino | 18 | | [SPI Sensor](./tutorial_spi_sensor.md) | How to integrate an SPI sensor | 19 | | [I2C Sensor](./tutorial_i2c_sensor.md) | How to integrate an I2C sensor | 20 | | [Serial Sensor](./tutorial_serial_sensor.md) | How to integrate a Serial UART sensor | 21 | 22 | -------------------------------------------------------------------------------- /hardware/hello_stepper/guthrie/Stretch_RE1_Stepper_BOM_V1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/hardware/hello_stepper/guthrie/Stretch_RE1_Stepper_BOM_V1.pdf -------------------------------------------------------------------------------- /hardware/hello_stepper/guthrie/Stretch_RE1_Stepper_V1.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/hello-robot/stretch_firmware/dac1a3aa8bd415e1a3b8f2337553becebfd66351/hardware/hello_stepper/guthrie/Stretch_RE1_Stepper_V1.pdf -------------------------------------------------------------------------------- /hardware/hello_stepper/guthrie/gerber/Stretch_RE1_Stepper_PCB_V1.GBP: -------------------------------------------------------------------------------- 1 | G04 Layer_Color=16770453* 2 | %FSLAX25Y25*% 3 | %MOIN*% 4 | G70* 5 | G01* 6 | G75* 7 | %ADD29R,0.03150X0.03150*% 8 | %ADD49R,0.01200X0.03900*% 9 | D29* 10 | X507901Y1103535D02* 11 | D03* 12 | X513807D02* 13 | D03* 14 | D49* 15 | X521431Y1072449D02* 16 | D03* 17 | X518872D02* 18 | D03* 19 | X516313D02* 20 | D03* 21 | X513754D02* 22 | D03* 23 | X511195D02* 24 | D03* 25 | X508636D02* 26 | D03* 27 | X506077D02* 28 | D03* 29 | Y1095422D02* 30 | D03* 31 | X508636D02* 32 | D03* 33 | X511195D02* 34 | D03* 35 | X513754D02* 36 | D03* 37 | X516313D02* 38 | D03* 39 | X518872D02* 40 | D03* 41 | X521431D02* 42 | D03* 43 | M02* 44 | --------------------------------------------------------------------------------