├── .gitignore ├── 3DP-RingThing ├── BE Ring v1.f3d └── BE Ring v1.stl ├── Ard-1SheeldOmega └── DHTshield │ └── DHTshield.ino ├── Ard-Analog └── AnalogIn │ └── AnalogIn.ino ├── Ard-BLELED └── Bluetooth_LED │ └── Bluetooth_LED.ino ├── Ard-BooleanLogic ├── BooleanLogic.fzz ├── BooleanLogic_bb.png ├── Logic Sheet.xlsx └── LogicTest │ └── LogicTest.ino ├── Ard-DataCollect ├── DataCollect-1.fzz ├── DataCollect-1_bb.png └── bme280test │ └── bme280test.ino ├── Ard-InfraRed ├── Ard-InfraRed.fzz ├── Ard-InfraRed_bb.png └── IRrecvDemo │ └── IRrecvDemo.ino ├── Ard-InfraRed2 ├── IRDemo.fzz ├── IRDemo_bb.png └── IRDiode │ └── IRDiode.ino ├── Ard-Inputs ├── ButtonLED │ └── ButtonLED.ino ├── ButtonLED2 │ └── ButtonLED2.ino └── ButtonLED3 │ └── ButtonLED3.ino ├── Ard-IoTCloud └── MKR-1010-TEMP │ ├── MKR-1010-TEMP.ino │ ├── arduino_secrets.h │ ├── sketch.json │ └── thingProperties.h ├── Ard-LCD-DHT ├── Ard-LCD-DHT.fzz ├── Ard-LCD-DHT_bb.png ├── Ard-LCD-HelloWorld │ └── Ard-LCD-HelloWorld.ino └── Ard-LCDDHT │ └── Ard-LCDDHT.ino ├── Ard-MKR1010 ├── ColourLED │ └── ColourLED.ino └── MKRWiFi1010V2.0_sch.pdf ├── Ard-Programming ├── ArduinoProgramming.fzz ├── ArduinoProgramming_bb.png ├── ArduinoProgramming_schem.png └── ForInterrupt │ └── ForInterrupt.ino ├── Ard-SensorEyes ├── HCSR04_SerialOutput │ └── HCSR04_SerialOutput.ino ├── PiR.fzz ├── PiR_Test │ └── PiR_Test.ino ├── PiR_bb.png ├── SensorEyes.fzz ├── SensorEyes_bb.png ├── Sensor_Eyes │ └── Sensor_Eyes.ino ├── Ultrasound.fzz └── Ultrasound_bb.png ├── Ard-Servos └── Sweep │ └── Sweep.ino ├── Ard-SevenSegment ├── 7SegShift │ └── 7SegShift.ino ├── 7seg-pinout-annotated.jpg ├── SevSeg_Counter │ └── SevSeg_Counter.ino ├── SevenSegment-1.fzz ├── SevenSegment-1_bb.png ├── SevenSegment-2.fzz ├── SevenSegment-2_bb.png └── pins-shift_register.jpg ├── Ard-ShiftReg ├── Shift1 │ └── Shift1.ino ├── Shift2 │ └── Shift2.ino ├── ShiftClear │ └── ShiftClear.ino ├── ShiftReg.fzz └── ShiftReg_bb.png ├── Ard-StepperMotors └── Stepper │ └── Stepper.ino ├── Ard-TFTButtons └── TFT-RGB-LED │ └── TFT-RGB-LED.ino ├── Ard-TFTDisplay ├── BMP-Paint │ └── BMP-Paint.ino └── arduino.bmp ├── Ard-TempFan ├── TempFan │ └── TempFan.ino ├── TemperatureFan-1.fzz └── TemperatureFan-1_bb.png ├── Ard-TouchSensor ├── Touch1 │ └── Touch1.ino ├── Touch2 │ └── Touch2.ino ├── touch_sensor.fzz └── touch_sensor_bb.png ├── ESP-AdafruitIO ├── AdafruitIO_Publish │ ├── AdafruitIO_Publish.ino │ └── config.h └── mqtt_esp32 │ └── mqtt_esp32.ino ├── ESP-BLEDHT └── BLE-DHT │ └── BLE-DHT.ino ├── ESP-HallTFT ├── ESP-096TFT.fzz ├── ESP-096TFT_bb.png └── ESP-TFT │ └── ESP-TFT.ino ├── ESP-OTA ├── OTA-Blink │ └── OTA-Blink.ino ├── Youtube_GetSubs │ └── Youtube_GetSubs.ino ├── Youtube_GetSubs_OTA │ └── Youtube_GetSubs_OTA.ino └── Youtube_GetSubs_OTAWeb │ └── Youtube_GetSubs_OTAWeb.ino ├── ESP-SPIFFS └── SimpleSPIFFSWeb │ ├── SimpleSPIFFSWeb.ino │ └── data │ ├── be.png │ └── index.htm ├── ESP-TFT ├── ESP-TFT_Wiring.fzz └── ESP-TFT_Wiring_bb.png ├── ESP-Webservices ├── ESP-Weather │ └── ESP-Weather.ino ├── ESP-Webservices.fzz ├── ESP-Webservices_bb.png └── description.txt ├── ESP32-CamCard └── SD_Camera │ ├── SD_Camera.ino │ └── camera_pins.h ├── ESP32-IRSend ├── IR_Receive.fzz ├── IR_Receive_bb.png ├── IR_Receive_schem.png ├── IR_Send_ESP32.fzz ├── IR_Send_ESP32_bb.png └── IR_Send_ESP32_schem.png ├── ESP32-LCDTemp ├── TempHumi_Display-1 │ ├── ArialBoldMT28.h │ └── TempHumi_Display-1.ino └── TempHumi_Display-2 │ ├── ArialBoldMT28.h │ └── TempHumi_Display-2.ino ├── ESP32-RCBLE ├── robot_car_ble_control │ ├── BLE2901.cpp │ ├── BLE2901.h │ └── robot_car_ble_control.ino └── robot_car_ble_led │ ├── BLE2901.cpp │ ├── BLE2901.h │ └── robot_car_ble_led.ino ├── ESP32-TTGOCamera └── Camera-TTGO │ ├── Camera-TTGO.ino │ ├── app_httpd.cpp │ ├── camera_index.h │ └── camera_pins.h ├── Electronics-555Timer ├── 555-Timer.fzz ├── 555-Timer_bb.png ├── 555-Timer_schem.png └── 555-timer-pinout.png ├── Electronics-DarlingtonPair ├── DarlingtonPair.fzz ├── DarlingtonPair_bb.png └── DarlingtonPair_schem.png ├── Electronics-FlashingLights ├── flashing_light.fzz ├── flashing_light_bb.png └── flashing_light_schem.png ├── Electronics-MOSFET ├── MOSFET-1.fzz ├── MOSFET-1_bb.png ├── MOSFET-1_schem.png ├── MOSFET-2.fzz ├── MOSFET-2_bb.png ├── MOSFET-2_schem.png ├── MOSFET-Var │ └── MOSFET-Var.ino └── MOSFET │ └── MOSFET.ino ├── Electronics-MQTT ├── Arduino-MQTT │ └── Arduino-MQTT.ino └── NodeMCU-MQTT │ └── NodeMCU-MQTT.ino ├── Electronics-ManualLCD ├── LCD-Commands.png ├── ManualLCD-8.fzz ├── ManualLCD-8_bb.png └── Show-bits.png ├── Electronics-Transistors ├── trans-switch.fzz ├── trans-switch_bb.png └── trans-switch_schem.png ├── Kit-WeatherStation ├── WSK-ThingSpeak │ └── WSK-ThingSpeak.ino └── WeatherStationKit │ └── WeatherStationKit.ino ├── LICENSE ├── Onion-SubCounter ├── 7SegShift │ └── 7SegShift.ino ├── getstats.py └── resources.txt ├── Project-IRRelay ├── IRreceiveRemote │ └── IRreceiveRemote.ino └── IRsendRemote │ └── IRsendRemote.ino ├── Project-LEDStrip ├── CircuitPython │ ├── alt_colours.txt │ ├── lib │ │ ├── adafruit_pypixelbuf.mpy │ │ └── neopixel.mpy │ └── pixel_demo.py └── NeoPix_Colours │ └── NeoPix_Colours.ino ├── Project-NFC Reader ├── nfc-reader.py ├── nfc-reader2.py ├── punchclock │ ├── clock.py │ ├── clock_db.py │ ├── create_database.py │ └── punchclock.py ├── wx-punchclock.sh └── wx-punchclock │ ├── clock_db.py │ ├── create_database.py │ └── wx-punchclock.py ├── Project-Temperature ├── LUA │ ├── UcgLogo.lua │ ├── dht-test.lua │ ├── init.lua │ ├── project.lua │ └── tmr-test.lua ├── RemoteTemp.fzz └── RemoteTemp_bb.png ├── README.md ├── RPi-Analog ├── Layout-Wiring.png ├── RPi-Analog.fzz ├── Schematic.png ├── adc_input.py ├── led_pwm.py └── tune_led.py ├── RPi-Buttons └── button.py ├── RPi-CharDisp ├── Adafruit_CharLCD.py ├── Character Display.fzz ├── CharacterDisplay_bb.png ├── DateTime.py ├── HelloWorldLCD.py └── clear.py ├── RPi-FirstStart ├── led1.py └── led_repeat.py ├── RPi-SPIOLED └── oledinfo.py ├── RPi3-TestResults ├── pts-results-viewer │ ├── background-pattern.png │ ├── favicon.ico │ ├── horizontal-nav-bg-hover.png │ ├── horizontal-nav-bg.png │ ├── phoronix-test-suite.css │ ├── pts-106x55.png │ ├── pts-logo-bottom.png │ ├── pts-logo-top.png │ ├── pts-results-viewer.xsl │ └── pts.js ├── rpi2-cpu-test │ ├── composite.xml │ ├── index.html │ ├── pts-results-viewer.xsl │ ├── result-graphs │ │ ├── 1.svg │ │ ├── 10.svg │ │ ├── 10_table.svg │ │ ├── 11.svg │ │ ├── 11_table.svg │ │ ├── 12.svg │ │ ├── 12_table.svg │ │ ├── 13.svg │ │ ├── 13_table.svg │ │ ├── 14.svg │ │ ├── 14_table.svg │ │ ├── 15.svg │ │ ├── 15_table.svg │ │ ├── 16.svg │ │ ├── 16_table.svg │ │ ├── 17.svg │ │ ├── 17_table.svg │ │ ├── 18.svg │ │ ├── 18_table.svg │ │ ├── 19.svg │ │ ├── 19_table.svg │ │ ├── 1_table.svg │ │ ├── 2.svg │ │ ├── 2_table.svg │ │ ├── 3.svg │ │ ├── 3_table.svg │ │ ├── 4.svg │ │ ├── 4_table.svg │ │ ├── 5.svg │ │ ├── 5_table.svg │ │ ├── 6.svg │ │ ├── 6_table.svg │ │ ├── 7.svg │ │ ├── 7_table.svg │ │ ├── 8.svg │ │ ├── 8_table.svg │ │ ├── 9.svg │ │ ├── 9_table.svg │ │ ├── overview.svg │ │ └── systems.svg │ ├── system-logs │ │ └── rpi2-cpu-test │ │ │ ├── Xorg.0.log │ │ │ ├── cc │ │ │ ├── cmdline │ │ │ ├── cpuinfo │ │ │ ├── dmesg │ │ │ ├── dmidecode │ │ │ ├── environment-variables │ │ │ ├── glxinfo │ │ │ ├── lscpu │ │ │ ├── lsmod │ │ │ ├── lsusb │ │ │ ├── meminfo │ │ │ ├── modules │ │ │ ├── mounts │ │ │ ├── scaling_available_frequencies │ │ │ ├── uname │ │ │ └── version │ └── test-1.xml ├── rpi2-rpi3-merge │ ├── composite.xml │ ├── index.html │ ├── pts-results-viewer.xsl │ └── result-graphs │ │ ├── 1.svg │ │ ├── 10.svg │ │ ├── 10_table.svg │ │ ├── 11.svg │ │ ├── 11_table.svg │ │ ├── 12.svg │ │ ├── 12_table.svg │ │ ├── 13.svg │ │ ├── 13_table.svg │ │ ├── 14.svg │ │ ├── 14_table.svg │ │ ├── 15.svg │ │ ├── 15_table.svg │ │ ├── 16.svg │ │ ├── 16_table.svg │ │ ├── 17.svg │ │ ├── 17_table.svg │ │ ├── 18.svg │ │ ├── 18_table.svg │ │ ├── 19.svg │ │ ├── 19_table.svg │ │ ├── 1_table.svg │ │ ├── 2.svg │ │ ├── 2_table.svg │ │ ├── 3.svg │ │ ├── 3_table.svg │ │ ├── 4.svg │ │ ├── 4_table.svg │ │ ├── 5.svg │ │ ├── 5_table.svg │ │ ├── 6.svg │ │ ├── 6_table.svg │ │ ├── 7.svg │ │ ├── 7_table.svg │ │ ├── 8.svg │ │ ├── 8_table.svg │ │ ├── 9.svg │ │ ├── 9_table.svg │ │ ├── overview.svg │ │ ├── systems.svg │ │ └── visualize.svg └── rpi3-cpu-test │ ├── composite.xml │ ├── index.html │ ├── pts-results-viewer.xsl │ ├── result-graphs │ ├── 1.svg │ ├── 10.svg │ ├── 10_table.svg │ ├── 11.svg │ ├── 11_table.svg │ ├── 12.svg │ ├── 12_table.svg │ ├── 13.svg │ ├── 13_table.svg │ ├── 14.svg │ ├── 14_table.svg │ ├── 15.svg │ ├── 15_table.svg │ ├── 16.svg │ ├── 16_table.svg │ ├── 17.svg │ ├── 17_table.svg │ ├── 1_table.svg │ ├── 2.svg │ ├── 2_table.svg │ ├── 3.svg │ ├── 3_table.svg │ ├── 4.svg │ ├── 4_table.svg │ ├── 5.svg │ ├── 5_table.svg │ ├── 6.svg │ ├── 6_table.svg │ ├── 7.svg │ ├── 7_table.svg │ ├── 8.svg │ ├── 8_table.svg │ ├── 9.svg │ ├── 9_table.svg │ ├── overview.svg │ └── systems.svg │ ├── system-logs │ └── rpi3-cpu-test │ │ ├── Xorg.0.log │ │ ├── cc │ │ ├── cmdline │ │ ├── cpuinfo │ │ ├── dmesg │ │ ├── dmidecode │ │ ├── environment-variables │ │ ├── glxinfo │ │ ├── lscpu │ │ ├── lsmod │ │ ├── lsusb │ │ ├── meminfo │ │ ├── modules │ │ ├── mounts │ │ ├── scaling_available_frequencies │ │ ├── uname │ │ └── version │ └── test-1.xml ├── Review - IoTaaP └── IRreceiveRemoteSSL │ └── IRreceiveRemoteSSL.ino ├── Review-RYC1001 ├── DHT_RYC1001 │ ├── DHT_RYC1001.ino │ └── reyax_vars.h └── ryc1001-notes.txt └── Rpi-BTDevices ├── bt_read.py ├── led_control.py └── notes.txt /.gitignore: -------------------------------------------------------------------------------- 1 | .vscode/arduino.json 2 | -------------------------------------------------------------------------------- /3DP-RingThing/BE Ring v1.f3d: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/3DP-RingThing/BE Ring v1.f3d -------------------------------------------------------------------------------- /3DP-RingThing/BE Ring v1.stl: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/3DP-RingThing/BE Ring v1.stl -------------------------------------------------------------------------------- /Ard-1SheeldOmega/DHTshield/DHTshield.ino: -------------------------------------------------------------------------------- 1 | 2 | // Example testing sketch for various DHT humidity/temperature sensors 3 | // Written by ladyada, public domain 4 | 5 | #define CUSTOM_SETTINGS 6 | #define INCLUDE_TERMINAL_SHIELD 7 | 8 | /* Include 1Sheeld library. */ 9 | #include 10 | #include 11 | #include "DHT.h" 12 | 13 | #define DHTPIN 2 // what pin we're connected to 14 | 15 | // Uncomment whatever type you're using! 16 | //#define DHTTYPE DHT11 // DHT 11 17 | #define DHTTYPE DHT22 // DHT 22 (AM2302) 18 | //#define DHTTYPE DHT21 // DHT 21 (AM2301) 19 | 20 | // Connect pin 1 (on the left) of the sensor to +5V 21 | // Connect pin 2 of the sensor to whatever your DHTPIN is 22 | // Connect pin 4 (on the right) of the sensor to GROUND 23 | // Connect a 10K resistor from pin 2 (data) to pin 1 (power) of the sensor 24 | 25 | DHT dht(DHTPIN, DHTTYPE); 26 | Onion* onionSetup; 27 | 28 | void setup() { 29 | onionSetup = new Onion; 30 | /* Start communication. */ 31 | OneSheeld.begin(); 32 | 33 | dht.begin(); 34 | Terminal.println("DHTxx test!"); 35 | } 36 | 37 | void loop() { 38 | // Reading temperature or humidity takes about 250 milliseconds! 39 | // Sensor readings may also be up to 2 seconds 'old' (its a very slow sensor) 40 | float h = dht.readHumidity(); 41 | float t = dht.readTemperature(); 42 | 43 | // check if returns are valid, if they are NaN (not a number) then something went wrong! 44 | if (isnan(t) || isnan(h)) { 45 | Terminal.println("Failed to read from DHT"); 46 | } else { 47 | Terminal.print("Humidity: "); 48 | Terminal.print(h); 49 | Terminal.print(" %\t"); 50 | Terminal.print("Temperature: "); 51 | Terminal.print(t); 52 | Terminal.println(" *C"); 53 | } 54 | } 55 | -------------------------------------------------------------------------------- /Ard-Analog/AnalogIn/AnalogIn.ino: -------------------------------------------------------------------------------- 1 | const int analogInPin = A0; 2 | const int analogOutPin = 3; 3 | 4 | int sensorValue = 0; 5 | int outputValue = 0; 6 | 7 | void setup() { 8 | Serial.begin(9600); 9 | } 10 | 11 | void loop() { 12 | sensorValue = analogRead(analogInPin); 13 | outputValue = map(sensorValue, 0, 1023, 0, 255); 14 | analogWrite(analogOutPin, outputValue); 15 | 16 | // print the results to the serial monitor: 17 | Serial.print("sensor = " ); 18 | Serial.print(sensorValue); 19 | Serial.print("\t output = "); 20 | Serial.println(outputValue); 21 | delay(250); 22 | } 23 | -------------------------------------------------------------------------------- /Ard-BLELED/Bluetooth_LED/Bluetooth_LED.ino: -------------------------------------------------------------------------------- 1 | /* 2 | Bluetooth controlled LED 3 | 4 | This example creates a Bluetooth® Low Energy peripheral with service that contains a 5 | characteristic to control an LED. 6 | 7 | The circuit: 8 | - Arduino MKR WiFi 1010, Arduino Uno WiFi Rev2 board, Arduino Nano 33 IoT, 9 | Arduino Nano 33 BLE, or Arduino Nano 33 BLE Sense board. 10 | 11 | You can use a generic Bluetooth® Low Energy central app, like LightBlue (iOS and Android) or 12 | nRF Connect (Android), to interact with the services and characteristics 13 | created in this sketch. 14 | 15 | This example code is in the public domain. 16 | */ 17 | 18 | #include 19 | 20 | BLEService ledService("19B10000-E8F2-537E-4F6C-D104768A1214"); // Bluetooth® Low Energy LED Service 21 | 22 | // Bluetooth® Low Energy LED Switch Characteristic - custom 128-bit UUID, read and writable by central 23 | BLEByteCharacteristic switchCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1214", BLERead | BLEWrite); 24 | BLEStringCharacteristic colorCharacteristic("19B10001-E8F2-537E-4F6C-D104768A1215", BLERead | BLEWrite, 11); 25 | 26 | // Set the pins controlling the RGB LED 27 | const int PIN_RED = 3; 28 | const int PIN_GREEN = 5; 29 | const int PIN_BLUE = 6; 30 | 31 | // Function to set the RGB LED based on a string 32 | void setLED(String rgbString) { 33 | int sep_1 = rgbString.indexOf(','); 34 | int sep_2 = rgbString.indexOf(',', (sep_1 + 1)); 35 | int led_r = rgbString.substring(0, sep_1).toInt(); 36 | int led_g = rgbString.substring(sep_1+1, sep_2).toInt(); 37 | int led_b = rgbString.substring(sep_2 + 1).toInt(); 38 | 39 | analogWrite(PIN_RED, led_r); 40 | analogWrite(PIN_GREEN, led_g); 41 | analogWrite(PIN_BLUE, led_b); 42 | } 43 | 44 | void setup() { 45 | Serial.begin(9600); 46 | while (!Serial); 47 | 48 | // set LED pin to output mode 49 | pinMode(PIN_RED, OUTPUT); 50 | pinMode(PIN_GREEN, OUTPUT); 51 | pinMode(PIN_BLUE, OUTPUT); 52 | 53 | // begin initialization 54 | if (!BLE.begin()) { 55 | Serial.println("starting Bluetooth® Low Energy module failed!"); 56 | 57 | while (1); 58 | } 59 | 60 | // set advertised local name and service UUID: 61 | BLE.setLocalName("Arduino LED"); 62 | BLE.setAdvertisedService(ledService); 63 | 64 | // add the characteristic to the service 65 | ledService.addCharacteristic(switchCharacteristic); 66 | ledService.addCharacteristic(colorCharacteristic); 67 | 68 | // add service 69 | BLE.addService(ledService); 70 | 71 | // set the initial value for the characeristic: 72 | switchCharacteristic.writeValue(0); 73 | // colorCharacteristic.writeValue("0,0,0"); 74 | 75 | // start advertising 76 | BLE.advertise(); 77 | 78 | Serial.println("BLE LED Peripheral"); 79 | } 80 | 81 | void loop() { 82 | // listen for Bluetooth® Low Energy peripherals to connect: 83 | BLEDevice central = BLE.central(); 84 | 85 | // if a central is connected to peripheral: 86 | if (central) { 87 | Serial.print("Connected to central: "); 88 | // print the central's MAC address: 89 | Serial.println(central.address()); 90 | 91 | // while the central is still connected to peripheral: 92 | while (central.connected()) { 93 | // if the remote device wrote to the characteristic, 94 | // use the value to control the LED: 95 | if (switchCharacteristic.written()) { 96 | if (switchCharacteristic.value()) { // any value other than 0 97 | Serial.println("LED on"); 98 | 99 | String LEDvalue = colorCharacteristic.value(); 100 | Serial.print("RGB Value: "); 101 | Serial.println(LEDvalue); 102 | setLED(LEDvalue); 103 | } else { // a 0 value 104 | Serial.println(F("LED off")); 105 | setLED("0,0,0"); 106 | } 107 | } 108 | } 109 | 110 | // when the central disconnects, print it out: 111 | Serial.print(F("Disconnected from central: ")); 112 | Serial.println(central.address()); 113 | } 114 | } 115 | -------------------------------------------------------------------------------- /Ard-BooleanLogic/BooleanLogic.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-BooleanLogic/BooleanLogic.fzz -------------------------------------------------------------------------------- /Ard-BooleanLogic/BooleanLogic_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-BooleanLogic/BooleanLogic_bb.png -------------------------------------------------------------------------------- /Ard-BooleanLogic/Logic Sheet.xlsx: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-BooleanLogic/Logic Sheet.xlsx -------------------------------------------------------------------------------- /Ard-BooleanLogic/LogicTest/LogicTest.ino: -------------------------------------------------------------------------------- 1 | const int logicSwitchPin = 2; 2 | const int ledOrOutPin = 3; 3 | const int ledAndOutPin = 4; 4 | const int ledXorOutPin = 5; 5 | 6 | const int inputXPin = 11; 7 | const int inputYPin = 12; 8 | const int outputPin = 13; 9 | 10 | // mode: 0 - OR, 1 - AND, 2 - XOR 11 | int mode = 0; 12 | int x = LOW; 13 | int y = LOW; 14 | int output = LOW; 15 | 16 | void setup() { 17 | pinMode(logicSwitchPin, INPUT); 18 | pinMode(ledOrOutPin, OUTPUT); 19 | pinMode(ledAndOutPin, OUTPUT); 20 | pinMode(ledXorOutPin, OUTPUT); 21 | 22 | pinMode(inputXPin, INPUT); 23 | pinMode(inputYPin, INPUT); 24 | pinMode(outputPin, OUTPUT); 25 | } 26 | 27 | void loop() { 28 | x = digitalRead(inputXPin); 29 | y = digitalRead(inputYPin); 30 | 31 | switch (mode) { 32 | case 0: // x OR y 33 | digitalWrite(ledOrOutPin, HIGH); 34 | digitalWrite(ledAndOutPin, LOW); 35 | digitalWrite(ledXorOutPin, LOW); 36 | 37 | output = (x || y); 38 | digitalWrite(outputPin, output); 39 | break; 40 | case 1: // x AND y 41 | digitalWrite(ledOrOutPin, LOW); 42 | digitalWrite(ledAndOutPin, HIGH); 43 | digitalWrite(ledXorOutPin, LOW); 44 | 45 | output = (x && y); 46 | digitalWrite(outputPin, output); 47 | break; 48 | case 2: // x XOR y 49 | digitalWrite(ledOrOutPin, LOW); 50 | digitalWrite(ledAndOutPin, LOW); 51 | digitalWrite(ledXorOutPin, HIGH); 52 | 53 | output = ((x || y) && !(x && y)); 54 | digitalWrite(outputPin, output); 55 | break; 56 | default: 57 | digitalWrite(ledOrOutPin, LOW); 58 | digitalWrite(ledAndOutPin, LOW); 59 | digitalWrite(ledXorOutPin, LOW); 60 | } 61 | 62 | if (digitalRead(logicSwitchPin)) { 63 | mode = (mode + 1) % 3; 64 | } 65 | 66 | delay(250); 67 | } 68 | -------------------------------------------------------------------------------- /Ard-DataCollect/DataCollect-1.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-DataCollect/DataCollect-1.fzz -------------------------------------------------------------------------------- /Ard-DataCollect/DataCollect-1_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-DataCollect/DataCollect-1_bb.png -------------------------------------------------------------------------------- /Ard-DataCollect/bme280test/bme280test.ino: -------------------------------------------------------------------------------- 1 | /*************************************************************************** 2 | This is a library for the BME280 humidity, temperature & pressure sensor 3 | 4 | Designed specifically to work with the Adafruit BME280 Breakout 5 | ----> http://www.adafruit.com/products/2650 6 | 7 | These sensors use I2C or SPI to communicate, 2 or 4 pins are required 8 | to interface. The device's I2C address is either 0x76 or 0x77. 9 | 10 | Adafruit invests time and resources providing this open source code, 11 | please support Adafruit andopen-source hardware by purchasing products 12 | from Adafruit! 13 | 14 | Written by Limor Fried & Kevin Townsend for Adafruit Industries. 15 | BSD license, all text above must be included in any redistribution 16 | ***************************************************************************/ 17 | 18 | #include 19 | #include 20 | #include 21 | #include 22 | #include 23 | 24 | #define BME_SCK 13 25 | #define BME_MISO 12 26 | #define BME_MOSI 11 27 | #define BME_CS 10 28 | #define SD_CS 9 29 | 30 | #define SEALEVELPRESSURE_HPA (1013.25) 31 | // Calculated from https://barani.biz/apps/sea-level-pressure/ 32 | 33 | //Adafruit_BME280 bme; // I2C 34 | Adafruit_BME280 bme(BME_CS); // hardware SPI 35 | //Adafruit_BME280 bme(BME_CS, BME_MOSI, BME_MISO, BME_SCK); // software SPI 36 | 37 | unsigned long delayTime; 38 | 39 | void setup() { 40 | Serial.begin(9600); 41 | Serial.println(F("BME280 test")); 42 | 43 | bool status; 44 | 45 | // default settings 46 | // (you can also pass in a Wire library object like &Wire2) 47 | status = bme.begin(); 48 | if (!status) { 49 | Serial.println("Could not find a valid BME280 sensor, check wiring!"); 50 | while (1); 51 | } 52 | 53 | Serial.print("Initializing SD card..."); 54 | 55 | // see if the card is present and can be initialized: 56 | if (!SD.begin(SD_CS)) { 57 | Serial.println("Card failed, or not present"); 58 | // don't do anything more: 59 | while (1); 60 | } 61 | Serial.println("card initialized."); 62 | 63 | 64 | Serial.println("-- Default Test --"); 65 | delayTime = 1000; 66 | 67 | Serial.println(); 68 | } 69 | 70 | 71 | void loop() { 72 | String dataString = printValues(); 73 | 74 | File dataFile = SD.open("datalog.txt", FILE_WRITE); 75 | 76 | // if the file is available, write to it: 77 | if (dataFile) { 78 | dataFile.println(dataString); 79 | dataFile.close(); 80 | // print to the serial port too: 81 | // Serial.println(dataString); 82 | } 83 | // if the file isn't open, pop up an error: 84 | else { 85 | Serial.println("error opening datalog.txt"); 86 | } 87 | 88 | delay(delayTime); 89 | } 90 | 91 | 92 | String printValues() { 93 | String dataString = ""; 94 | char str_temp[7]; 95 | 96 | Serial.print("Temperature = "); 97 | Serial.print(bme.readTemperature()); 98 | Serial.println(" *C"); 99 | dtostrf(bme.readTemperature(), 4, 2, str_temp); 100 | dataString = String(str_temp); 101 | 102 | Serial.print("Pressure = "); 103 | Serial.print(bme.readPressure() / 100.0F); 104 | Serial.println(" hPa"); 105 | dtostrf((bme.readPressure() / 100.0F), 4, 2, str_temp); 106 | dataString += "," + String(str_temp); 107 | 108 | Serial.print("Approx. Altitude = "); 109 | Serial.print(bme.readAltitude(SEALEVELPRESSURE_HPA)); 110 | Serial.println(" m"); 111 | 112 | Serial.print("Humidity = "); 113 | Serial.print(bme.readHumidity()); 114 | Serial.println(" %"); 115 | dtostrf(bme.readHumidity(), 4, 2, str_temp); 116 | dataString += "," + String(str_temp); 117 | 118 | Serial.println(); 119 | // Serial.println(dataString); 120 | 121 | return(dataString); 122 | } 123 | -------------------------------------------------------------------------------- /Ard-InfraRed/Ard-InfraRed.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-InfraRed/Ard-InfraRed.fzz -------------------------------------------------------------------------------- /Ard-InfraRed/Ard-InfraRed_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-InfraRed/Ard-InfraRed_bb.png -------------------------------------------------------------------------------- /Ard-InfraRed/IRrecvDemo/IRrecvDemo.ino: -------------------------------------------------------------------------------- 1 | /* 2 | * IRremote: IRrecvDemo - demonstrates receiving IR codes with IRrecv 3 | * An IR detector/demodulator must be connected to the input RECV_PIN. 4 | * Version 0.1 July, 2009 5 | * Copyright 2009 Ken Shirriff 6 | * http://arcfn.com 7 | */ 8 | 9 | #include 10 | 11 | int RECV_PIN = 11; 12 | 13 | IRrecv irrecv(RECV_PIN); 14 | 15 | decode_results results; 16 | 17 | void setup() 18 | { 19 | 20 | pinMode(2, OUTPUT); 21 | pinMode(3, OUTPUT); 22 | pinMode(4, OUTPUT); 23 | Serial.begin(9600); 24 | // In case the interrupt driver crashes on setup, give a clue 25 | // to the user what's going on. 26 | Serial.println("Enabling IRin"); 27 | irrecv.enableIRIn(); // Start the receiver 28 | Serial.println("Enabled IRin"); 29 | } 30 | 31 | void loop() { 32 | if (irrecv.decode(&results)) { 33 | Serial.println(results.value, HEX); 34 | if(results.value == 0xff02fd) { 35 | digitalWrite(2, HIGH); 36 | } else if(results.value == 0xff52ad) { 37 | digitalWrite(2, HIGH); 38 | digitalWrite(3, HIGH); 39 | digitalWrite(4, HIGH); 40 | } else if(results.value == 0xff42bd) { 41 | digitalWrite(2, LOW); 42 | digitalWrite(3, LOW); 43 | digitalWrite(4, LOW); 44 | } 45 | 46 | irrecv.resume(); // Receive the next value 47 | } 48 | delay(100); 49 | } 50 | -------------------------------------------------------------------------------- /Ard-InfraRed2/IRDemo.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-InfraRed2/IRDemo.fzz -------------------------------------------------------------------------------- /Ard-InfraRed2/IRDemo_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-InfraRed2/IRDemo_bb.png -------------------------------------------------------------------------------- /Ard-InfraRed2/IRDiode/IRDiode.ino: -------------------------------------------------------------------------------- 1 | int pd=2; 2 | int act_led=13; 3 | int senRead=0; 4 | //int limit=850; 5 | int limit=995; 6 | 7 | void setup() 8 | { 9 | pinMode(pd,OUTPUT); 10 | pinMode(act_led,OUTPUT); 11 | 12 | digitalWrite(pd,HIGH); 13 | digitalWrite(act_led,LOW); 14 | 15 | Serial.begin(9600); 16 | } 17 | 18 | void loop() 19 | { 20 | int val=analogRead(senRead); 21 | Serial.println(val); 22 | 23 | if(val <= limit) 24 | { 25 | digitalWrite(act_led,HIGH); 26 | delay(20); 27 | } 28 | else if(val > limit) 29 | { 30 | digitalWrite(act_led,LOW); 31 | delay(20); 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /Ard-Inputs/ButtonLED/ButtonLED.ino: -------------------------------------------------------------------------------- 1 | #define LED_PIN 12 2 | #define BUTTON_PIN 2 3 | 4 | void setup() { 5 | pinMode(LED_PIN, OUTPUT); 6 | pinMode(BUTTON_PIN, INPUT); 7 | 8 | digitalWrite(LED_PIN, digitalRead(BUTTON_PIN)); 9 | } 10 | 11 | void loop() { 12 | digitalWrite(LED_PIN, digitalRead(BUTTON_PIN)); 13 | } 14 | -------------------------------------------------------------------------------- /Ard-Inputs/ButtonLED2/ButtonLED2.ino: -------------------------------------------------------------------------------- 1 | #define RED_LED 12 2 | #define GREEN_LED 11 3 | #define BLUE_LED 10 4 | #define BUTTON_PIN 2 5 | 6 | int choose_led = 0; 7 | 8 | void change_led() { 9 | if (choose_led == 0) { 10 | digitalWrite(RED_LED, HIGH); 11 | digitalWrite(GREEN_LED, LOW); 12 | digitalWrite(BLUE_LED, LOW); 13 | } else if (choose_led == 1) { 14 | digitalWrite(RED_LED, LOW); 15 | digitalWrite(GREEN_LED, HIGH); 16 | digitalWrite(BLUE_LED, LOW); 17 | } else if (choose_led == 2) { 18 | digitalWrite(RED_LED, LOW); 19 | digitalWrite(GREEN_LED, LOW); 20 | digitalWrite(BLUE_LED, HIGH); 21 | } 22 | 23 | choose_led = (choose_led + 1) % 3; 24 | } 25 | 26 | void setup() { 27 | pinMode(RED_LED, OUTPUT); 28 | pinMode(GREEN_LED, OUTPUT); 29 | pinMode(BLUE_LED, OUTPUT); 30 | pinMode(BUTTON_PIN, INPUT); 31 | 32 | digitalWrite(RED_LED, LOW); 33 | digitalWrite(GREEN_LED, LOW); 34 | digitalWrite(BLUE_LED, LOW); 35 | } 36 | 37 | void loop() { 38 | if (digitalRead(BUTTON_PIN)) { 39 | change_led(); 40 | } 41 | 42 | delay(250); 43 | } 44 | -------------------------------------------------------------------------------- /Ard-Inputs/ButtonLED3/ButtonLED3.ino: -------------------------------------------------------------------------------- 1 | #define RED_LED 12 2 | #define GREEN_LED 11 3 | #define BLUE_LED 10 4 | #define BUTTON_PIN 2 5 | 6 | int choose_led = 0; 7 | volatile int state = LOW; 8 | 9 | void setup() { 10 | pinMode(RED_LED, OUTPUT); 11 | pinMode(GREEN_LED, OUTPUT); 12 | pinMode(BLUE_LED, OUTPUT); 13 | pinMode(BUTTON_PIN, INPUT); 14 | 15 | digitalWrite(RED_LED, LOW); 16 | digitalWrite(GREEN_LED, LOW); 17 | digitalWrite(BLUE_LED, LOW); 18 | 19 | attachInterrupt(0, blink, CHANGE); 20 | } 21 | 22 | void loop() { 23 | if (choose_led == 0) { 24 | digitalWrite(RED_LED, HIGH); 25 | digitalWrite(GREEN_LED, LOW); 26 | } else { 27 | digitalWrite(RED_LED, LOW); 28 | digitalWrite(GREEN_LED, HIGH); 29 | } 30 | 31 | choose_led = (choose_led + 1) % 2; 32 | delay(500); 33 | } 34 | 35 | void blink() 36 | { 37 | state = !state; 38 | digitalWrite(BLUE_LED, state); 39 | } 40 | -------------------------------------------------------------------------------- /Ard-IoTCloud/MKR-1010-TEMP/MKR-1010-TEMP.ino: -------------------------------------------------------------------------------- 1 | #include "arduino_secrets.h" 2 | // OneWire - Version: Latest 3 | #include 4 | 5 | // DallasTemperature - Version: 3.8.0 6 | #include 7 | 8 | /* 9 | Sketch generated by the Arduino IoT Cloud Thing "MKR-1010-TEMP" 10 | https://create.arduino.cc/cloud/things/2ebd2327-fd77-43ff-ad36-f441c17e328b 11 | 12 | Arduino IoT Cloud Properties description 13 | 14 | The following variables are automatically generated and updated when changes are made to the Thing properties 15 | 16 | float be_temp; 17 | 18 | Properties which are marked as READ/WRITE in the Cloud Thing will also have functions 19 | which are called when their values are changed from the Dashboard. 20 | These functions are generated with the Thing and added at the end of this sketch. 21 | */ 22 | 23 | #include "thingProperties.h" 24 | 25 | 26 | #define ONE_WIRE_BUS 2 27 | OneWire oneWire(ONE_WIRE_BUS); 28 | DallasTemperature sensors(&oneWire); 29 | DeviceAddress insideThermometer; 30 | 31 | void setup() { 32 | /* 33 | The following function allows you to obtain more information 34 | related to the state of network and IoT Cloud connection and errors 35 | the higher number the more granular information you’ll get. 36 | The default is 0 (only errors). 37 | Maximum is 3 38 | */ 39 | setDebugMessageLevel(2); 40 | 41 | // Initialize serial and wait for port to open: 42 | Serial.begin(9600); 43 | Serial.println("Dallas Temperature IC Control Library Demo"); 44 | // This delay gives the chance to wait for a Serial Monitor without blocking if none is found 45 | delay(1500); 46 | 47 | // Defined in thingProperties.h 48 | initProperties(); 49 | 50 | // Connect to Arduino IoT Cloud 51 | ArduinoCloud.begin(ArduinoIoTPreferredConnection); 52 | 53 | // Start temperature readings 54 | be_temp = 0.0; 55 | 56 | sensors.begin(); 57 | 58 | sensors.getAddress(insideThermometer, 0); 59 | sensors.setResolution(insideThermometer, 9); 60 | } 61 | 62 | void loop() { 63 | ArduinoCloud.update(); 64 | 65 | // Get current temperature 66 | Serial.print("Requesting temperatures..."); 67 | sensors.requestTemperatures(); 68 | Serial.println("DONE"); 69 | 70 | be_temp = sensors.getTempC(insideThermometer); 71 | Serial.print("Temperature for the device is: "); 72 | Serial.println(be_temp); 73 | } 74 | 75 | 76 | 77 | 78 | 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | 108 | 109 | 110 | 111 | 112 | 113 | -------------------------------------------------------------------------------- /Ard-IoTCloud/MKR-1010-TEMP/arduino_secrets.h: -------------------------------------------------------------------------------- 1 | #define SECRET_SSID "" 2 | #define SECRET_PASS "" 3 | -------------------------------------------------------------------------------- /Ard-IoTCloud/MKR-1010-TEMP/sketch.json: -------------------------------------------------------------------------------- 1 | {"cpu":{"fqbn":"arduino:samd:mkrwifi1010","name":"Arduino MKR WiFi 1010","port":""},"included_libs":[{"name":"DallasTemperature","version":"3.8.0"}],"secrets":[{"name":"SECRET_SSID","value":"","isOptional":false},{"name":"SECRET_PASS","value":"","isOptional":false}]} -------------------------------------------------------------------------------- /Ard-IoTCloud/MKR-1010-TEMP/thingProperties.h: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | const char THING_ID[] = "2ebd2327-fd77-43ff-ad36-f441c17e328b"; 6 | 7 | const char SSID[] = SECRET_SSID; // Network SSID (name) 8 | const char PASS[] = SECRET_PASS; // Network password (use for WPA, or use as key for WEP) 9 | 10 | 11 | float be_temp; 12 | 13 | void initProperties(){ 14 | 15 | ArduinoCloud.setThingId(THING_ID); 16 | ArduinoCloud.addProperty(be_temp, READ, 60 * SECONDS, NULL); 17 | 18 | } 19 | 20 | WiFiConnectionHandler ArduinoIoTPreferredConnection(SSID, PASS); 21 | -------------------------------------------------------------------------------- /Ard-LCD-DHT/Ard-LCD-DHT.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-LCD-DHT/Ard-LCD-DHT.fzz -------------------------------------------------------------------------------- /Ard-LCD-DHT/Ard-LCD-DHT_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-LCD-DHT/Ard-LCD-DHT_bb.png -------------------------------------------------------------------------------- /Ard-LCD-DHT/Ard-LCD-HelloWorld/Ard-LCD-HelloWorld.ino: -------------------------------------------------------------------------------- 1 | /* 2 | LiquidCrystal Library - Hello World 3 | 4 | Demonstrates the use a 16x2 LCD display. The LiquidCrystal 5 | library works with all LCD displays that are compatible with the 6 | Hitachi HD44780 driver. There are many of them out there, and you 7 | can usually tell them by the 16-pin interface. 8 | 9 | This sketch prints "Hello World!" to the LCD 10 | and shows the time. 11 | 12 | The circuit: 13 | * LCD RS pin to digital pin 7 14 | * LCD Enable pin to digital pin 8 15 | * LCD D4 pin to digital pin 9 16 | * LCD D5 pin to digital pin 10 17 | * LCD D6 pin to digital pin 11 18 | * LCD D7 pin to digital pin 12 19 | * LCD R/W pin to ground 20 | * LCD VSS pin to ground 21 | * LCD VCC pin to 5V 22 | * 10K pot resistor: 23 | * ends to +5V and ground 24 | * wiper to LCD VO pin (pin 3) 25 | 26 | Library originally added 18 Apr 2008 27 | by David A. Mellis 28 | library modified 5 Jul 2009 29 | by Limor Fried (http://www.ladyada.net) 30 | example added 9 Jul 2009 31 | by Tom Igoe 32 | modified 22 Nov 2010 33 | by Tom Igoe 34 | 35 | This example code is in the public domain. 36 | 37 | http://www.arduino.cc/en/Tutorial/LiquidCrystal 38 | */ 39 | 40 | // include the library code: 41 | #include 42 | 43 | // initialize the library with the numbers of the interface pins 44 | LiquidCrystal lcd(7, 8, 9, 10, 11, 12); 45 | 46 | void setup() { 47 | // set up the LCD's number of columns and rows: 48 | lcd.begin(16, 2); 49 | // Print a message to the LCD. 50 | lcd.print("Hello, world!"); 51 | } 52 | 53 | void loop() { 54 | // set the cursor to column 0, line 1 55 | // (note: line 1 is the second row, since counting begins with 0): 56 | lcd.setCursor(0, 1); 57 | // print the number of seconds since reset: 58 | lcd.print(millis() / 1000); 59 | } 60 | 61 | -------------------------------------------------------------------------------- /Ard-LCD-DHT/Ard-LCDDHT/Ard-LCDDHT.ino: -------------------------------------------------------------------------------- 1 | // include the library code: 2 | #include 3 | #include 4 | 5 | #define DHTPIN 2 // what pin we're connected to 6 | #define DHTTYPE DHT22 // DHT 22 (AM2302) 7 | 8 | // initialize the library with the numbers of the interface pins 9 | LiquidCrystal lcd(7, 8, 9, 10, 11, 12); 10 | DHT dht(DHTPIN, DHTTYPE); 11 | 12 | void setup() { 13 | // set up the LCD's number of columns and rows: 14 | lcd.begin(16, 2); 15 | 16 | // Initialize the DHT sensor 17 | dht.begin(); 18 | 19 | // Print a message to the LCD. 20 | lcd.print("Initializing"); 21 | lcd.setCursor(0, 1); 22 | lcd.print("Sensor"); 23 | lcd.blink(); 24 | } 25 | 26 | void loop() { 27 | // Wait a couple seconde between measurements 28 | delay(2000); 29 | 30 | // Get the sensor data 31 | float h = dht.readHumidity(); 32 | float t = dht.readTemperature(); 33 | 34 | // Turn off cursor blink and clear the LCD 35 | lcd.noBlink(); 36 | lcd.clear(); 37 | 38 | if (isnan(h) || isnan(t)) { 39 | lcd.print("Sensor Failure"); 40 | return; 41 | } 42 | 43 | // Print the temperature on the first line 44 | lcd.setCursor(0, 0); 45 | lcd.print("Temp: "); 46 | lcd.print(t); 47 | lcd.print(" C"); 48 | 49 | // Print the humidity on the second line 50 | lcd.setCursor(0, 1); 51 | lcd.print("Humid: "); 52 | lcd.print(h); 53 | lcd.print("%"); 54 | } 55 | 56 | -------------------------------------------------------------------------------- /Ard-MKR1010/ColourLED/ColourLED.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | void setup() { 5 | Serial.begin(9600); 6 | WiFi.WiFiInitLEDs(); 7 | } 8 | 9 | void loop() { 10 | 11 | for(int i = 0; i < 256; i++) { 12 | WiFi.WiFiRedLED(i); 13 | WiFi.WiFiBlueLED(255-i); 14 | Serial.print("Red: "); 15 | Serial.println(i); 16 | Serial.print("Blue: "); 17 | Serial.println(255 - i); 18 | delay(100); 19 | } 20 | for(int i = 0; i < 256; i++) { 21 | WiFi.WiFiGreenLED(i); 22 | WiFi.WiFiRedLED(255-i); 23 | Serial.print("Green: "); 24 | Serial.println(i); 25 | Serial.print("Red: "); 26 | Serial.println(255 - i); 27 | delay(100); 28 | } 29 | for(int i = 0; i < 256; i++) { 30 | WiFi.WiFiBlueLED(i); 31 | WiFi.WiFiGreenLED(255-i); 32 | Serial.print("Blue: "); 33 | Serial.println(i); 34 | Serial.print("Green: "); 35 | Serial.println(255 - i); 36 | delay(100); 37 | } 38 | } 39 | -------------------------------------------------------------------------------- /Ard-MKR1010/MKRWiFi1010V2.0_sch.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-MKR1010/MKRWiFi1010V2.0_sch.pdf -------------------------------------------------------------------------------- /Ard-Programming/ArduinoProgramming.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-Programming/ArduinoProgramming.fzz -------------------------------------------------------------------------------- /Ard-Programming/ArduinoProgramming_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-Programming/ArduinoProgramming_bb.png -------------------------------------------------------------------------------- /Ard-Programming/ArduinoProgramming_schem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-Programming/ArduinoProgramming_schem.png -------------------------------------------------------------------------------- /Ard-Programming/ForInterrupt/ForInterrupt.ino: -------------------------------------------------------------------------------- 1 | int led_array[] = { 10, 11, 12, 13 }; 2 | int led_count = 4; 3 | volatile int led_pos = 0; 4 | 5 | int button_pin = 2; 6 | 7 | void setup() { 8 | for (int this_led = 0; this_led < led_count; this_led++) { 9 | pinMode(led_array[this_led], OUTPUT); 10 | digitalWrite(led_array[this_led], LOW); 11 | } 12 | 13 | pinMode(button_pin, INPUT); 14 | attachInterrupt(0, change, FALLING); 15 | } 16 | 17 | void loop() { 18 | for (int this_led = 0; this_led < led_count; this_led++) { 19 | if( this_led == led_pos ) { 20 | digitalWrite(led_array[this_led], HIGH); 21 | } else { 22 | digitalWrite(led_array[this_led], LOW); 23 | } 24 | } 25 | } 26 | 27 | void change() { 28 | led_pos = (led_pos + 1) % 4; 29 | } 30 | 31 | -------------------------------------------------------------------------------- /Ard-SensorEyes/HCSR04_SerialOutput/HCSR04_SerialOutput.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #define TRIG_PIN 12 4 | #define ECHO_PIN 11 5 | 6 | HCSR04 hcsr04(TRIG_PIN, ECHO_PIN, 20, 4000); 7 | 8 | void setup(){ 9 | Serial.begin(9600); 10 | } 11 | 12 | void loop() { 13 | Serial.println(hcsr04.ToString()); 14 | 15 | delay(250); 16 | } 17 | -------------------------------------------------------------------------------- /Ard-SensorEyes/PiR.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SensorEyes/PiR.fzz -------------------------------------------------------------------------------- /Ard-SensorEyes/PiR_Test/PiR_Test.ino: -------------------------------------------------------------------------------- 1 | //www.elegoo.com 2 | //2016.12.9 3 | 4 | int ledPin = 13; // LED on Pin 13 of Arduino 5 | int pirPin = 7; // Input for HC-S501 6 | 7 | int pirValue; // Place to store read PIR Value 8 | 9 | 10 | void setup() { 11 | 12 | pinMode(ledPin, OUTPUT); 13 | pinMode(pirPin, INPUT); 14 | digitalWrite(ledPin, LOW); 15 | 16 | } 17 | 18 | void loop() { 19 | pirValue = digitalRead(pirPin); 20 | digitalWrite(ledPin, pirValue); 21 | } 22 | -------------------------------------------------------------------------------- /Ard-SensorEyes/PiR_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SensorEyes/PiR_bb.png -------------------------------------------------------------------------------- /Ard-SensorEyes/SensorEyes.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SensorEyes/SensorEyes.fzz -------------------------------------------------------------------------------- /Ard-SensorEyes/SensorEyes_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SensorEyes/SensorEyes_bb.png -------------------------------------------------------------------------------- /Ard-SensorEyes/Sensor_Eyes/Sensor_Eyes.ino: -------------------------------------------------------------------------------- 1 | /*********************************************** 2 | * This is a little Halloween special 3 | * 4 | * Use a PiR sensor to turn on an ultrasound. 5 | * Set the LED brightness based on the distance from 6 | * the ultrasound. 7 | ***********************************************/ 8 | 9 | #include 10 | 11 | #define TRIG_PIN 12 12 | #define ECHO_PIN 11 13 | 14 | const byte interruptPin = 2; 15 | const byte signalPin = 13; 16 | const byte ledPin = 3; 17 | 18 | int distance = 0; 19 | int pir_distance = 0; 20 | 21 | HCSR04 hcsr04(TRIG_PIN, ECHO_PIN, 20, 4000); 22 | 23 | void setup(){ 24 | Serial.begin(9600); 25 | 26 | pinMode(signalPin, OUTPUT); 27 | pinMode(interruptPin, INPUT); 28 | attachInterrupt(digitalPinToInterrupt(interruptPin), togglePiR, CHANGE); 29 | } 30 | 31 | void loop() { 32 | // Show the distance in mm from the ultrasound 33 | Serial.print("PiR Distance: "); 34 | Serial.println(pir_distance); 35 | 36 | // If the PiR is not triggered, turn off the eyes 37 | if(digitalRead(interruptPin) == LOW) { 38 | distance = 0; 39 | } else { 40 | distance = map(pir_distance, 0, 2000, 0, 255); 41 | } 42 | // Set an upper limit to the PWM output value 43 | if(distance > 255) distance=255; 44 | 45 | // Show the PWM value for the eyes 46 | Serial.print("LED Distance: "); 47 | Serial.println(distance); 48 | 49 | // Turn on the LEDs using an analog value 50 | analogWrite(ledPin, distance); 51 | 52 | // Grab a new measurement from the ultrasound 53 | pir_distance = hcsr04.distanceInMillimeters(); 54 | delay(250); 55 | } 56 | 57 | // If the PiR is triggered, send a voltage to the ultrasound 58 | void togglePiR() { 59 | digitalWrite(signalPin, digitalRead(interruptPin)); 60 | } 61 | -------------------------------------------------------------------------------- /Ard-SensorEyes/Ultrasound.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SensorEyes/Ultrasound.fzz -------------------------------------------------------------------------------- /Ard-SensorEyes/Ultrasound_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SensorEyes/Ultrasound_bb.png -------------------------------------------------------------------------------- /Ard-Servos/Sweep/Sweep.ino: -------------------------------------------------------------------------------- 1 | /* Sweep 2 | by BARRAGAN 3 | This example code is in the public domain. 4 | 5 | modified 8 Nov 2013 6 | by Scott Fitzgerald 7 | http://www.arduino.cc/en/Tutorial/Sweep 8 | */ 9 | 10 | #include 11 | 12 | Servo myservo; // create servo object to control a servo 13 | // twelve servo objects can be created on most boards 14 | 15 | int pos = 0; // variable to store the servo position 16 | 17 | void setup() { 18 | myservo.attach(9); // attaches the servo on pin 9 to the servo object 19 | } 20 | 21 | void loop() { 22 | for (pos = 0; pos <= 180; pos += 1) { // goes from 0 degrees to 180 degrees 23 | // in steps of 1 degree 24 | myservo.write(pos); // tell servo to go to position in variable 'pos' 25 | delay(15); // waits 15ms for the servo to reach the position 26 | } 27 | delay(500); // Wait half a second before going back 28 | 29 | for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees 30 | myservo.write(pos); // tell servo to go to position in variable 'pos' 31 | delay(15); // waits 15ms for the servo to reach the position 32 | } 33 | delay(500); // Wait half a second before starting over 34 | } 35 | 36 | -------------------------------------------------------------------------------- /Ard-SevenSegment/7SegShift/7SegShift.ino: -------------------------------------------------------------------------------- 1 | #include "Timer.h" //include timer library 2 | Timer t; // craete a timer object 3 | long number = 0; //declear the variables 4 | int first_digit = 0; 5 | int second_digit = 0; 6 | int third_digit = 0; 7 | int fourth_digit = 0; 8 | int timer_event = 0; 9 | int CA_1 = 12; 10 | int CA_2 = 11; 11 | int CA_3 = 10; 12 | int CA_4 = 9; 13 | int clk = 6; 14 | int latch = 5; 15 | int data = 4; 16 | int count = 0; 17 | int digits[4] ; 18 | int CAS[4] = {12, 11, 10, 9}; 19 | byte numbers[10] {B11111100, B01100000, B11011010, B11110010, B01100110, B10110110, B10111110, B11100000, B11111110, B11110110}; 20 | //byte combinations for each number 0-9 21 | void setup() { 22 | Serial.begin(9600); //serial start and pin config 23 | pinMode(CA_1, OUTPUT); 24 | pinMode(CA_2, OUTPUT); 25 | pinMode(CA_3, OUTPUT); 26 | pinMode(CA_4, OUTPUT); 27 | pinMode(clk, OUTPUT); 28 | pinMode(latch, OUTPUT); 29 | pinMode(data, OUTPUT); 30 | digitalWrite(CA_1, HIGH); 31 | digitalWrite(CA_2, HIGH); 32 | digitalWrite(CA_3, HIGH); 33 | digitalWrite(CA_4, HIGH); 34 | Serial.println("please Enter a number from 0 to 9999"); 35 | } 36 | 37 | void loop() { 38 | t.update(); //timer update 39 | if (Serial.available()) { // read from serial 40 | t.stop(timer_event); //stop timer if anythign to read 41 | cathode_high(); // blank the screen 42 | String s = Serial.readString(); //read the serail value 43 | number = (long)s.toInt(); //convert it to int 44 | if (number > 9999) { //check the number is 0-9999 45 | Serial.println("Please Enter Number Between 0 - 9999"); 46 | } else { 47 | break_number(number); 48 | timer_event = t.every(1, display_number); // start timer again 49 | } 50 | } 51 | } 52 | 53 | void break_number(long num) { // seperate the input number into 4 single digits 54 | 55 | first_digit = num / 1000; 56 | digits[0] = first_digit; 57 | 58 | int first_left = num - (first_digit * 1000); 59 | second_digit = first_left / 100; 60 | digits[1] = second_digit; 61 | int second_left = first_left - (second_digit * 100); 62 | third_digit = second_left / 10; 63 | digits[2] = third_digit; 64 | fourth_digit = second_left - (third_digit * 10); 65 | digits[3] = fourth_digit; 66 | } 67 | 68 | void display_number() { //scanning 69 | 70 | cathode_high(); //black screen 71 | digitalWrite(latch, LOW); //put the shift register to read 72 | shiftOut(data, clk, LSBFIRST, numbers[digits[count]]); //send the data 73 | digitalWrite(CAS[count], LOW); //turn on the relevent digit 74 | digitalWrite(latch, HIGH); //put the shift register to write mode 75 | count++; //count up the digit 76 | if (count == 4) { // keep the count between 0-3 77 | count = 0; 78 | } 79 | } 80 | 81 | void cathode_high() { //turn off all 4 digits 82 | digitalWrite(CA_1, HIGH); 83 | digitalWrite(CA_2, HIGH); 84 | digitalWrite(CA_3, HIGH); 85 | digitalWrite(CA_4, HIGH); 86 | } 87 | -------------------------------------------------------------------------------- /Ard-SevenSegment/7seg-pinout-annotated.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SevenSegment/7seg-pinout-annotated.jpg -------------------------------------------------------------------------------- /Ard-SevenSegment/SevSeg_Counter/SevSeg_Counter.ino: -------------------------------------------------------------------------------- 1 | /* SevSeg Counter Example 2 | 3 | Copyright 2017 Dean Reading 4 | 5 | Licensed under the Apache License, Version 2.0 (the "License"); 6 | you may not use this file except in compliance with the License. 7 | You may obtain a copy of the License at 8 | http://www.apache.org/licenses/LICENSE-2.0 9 | 10 | Unless required by applicable law or agreed to in writing, software 11 | distributed under the License is distributed on an "AS IS" BASIS, 12 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 | See the License for the specific language governing permissions and 14 | limitations under the License. 15 | 16 | 17 | This example demonstrates a very simple use of the SevSeg library with a 4 18 | digit display. It displays a counter that counts up, showing deci-seconds. 19 | */ 20 | 21 | #include "SevSeg.h" 22 | SevSeg sevseg; //Instantiate a seven segment controller object 23 | 24 | void setup() { 25 | byte numDigits = 4; 26 | byte digitPins[] = {2, 3, 4, 5}; 27 | byte segmentPins[] = {6, 7, 8, 9, 10, 11, 12, 13}; 28 | bool resistorsOnSegments = false; // 'false' means resistors are on digit pins 29 | byte hardwareConfig = COMMON_CATHODE; // See README.md for options 30 | bool updateWithDelays = false; // Default. Recommended 31 | bool leadingZeros = true; // Use 'true' if you'd like to keep the leading zeros 32 | 33 | sevseg.begin(hardwareConfig, numDigits, digitPins, segmentPins, resistorsOnSegments, updateWithDelays, leadingZeros); 34 | sevseg.setBrightness(90); 35 | } 36 | 37 | void loop() { 38 | static unsigned long timer = millis(); 39 | static int deciSeconds = 0; 40 | 41 | if (millis() - timer >= 100) { 42 | timer += 100; 43 | deciSeconds++; // 100 milliSeconds is equal to 1 deciSecond 44 | 45 | if (deciSeconds == 10000) { // Reset to 0 after counting for 1000 seconds. 46 | deciSeconds=0; 47 | } 48 | sevseg.setNumber(deciSeconds, 1); 49 | } 50 | 51 | sevseg.refreshDisplay(); // Must run repeatedly 52 | } 53 | 54 | /// END /// 55 | -------------------------------------------------------------------------------- /Ard-SevenSegment/SevenSegment-1.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SevenSegment/SevenSegment-1.fzz -------------------------------------------------------------------------------- /Ard-SevenSegment/SevenSegment-1_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SevenSegment/SevenSegment-1_bb.png -------------------------------------------------------------------------------- /Ard-SevenSegment/SevenSegment-2.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SevenSegment/SevenSegment-2.fzz -------------------------------------------------------------------------------- /Ard-SevenSegment/SevenSegment-2_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SevenSegment/SevenSegment-2_bb.png -------------------------------------------------------------------------------- /Ard-SevenSegment/pins-shift_register.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-SevenSegment/pins-shift_register.jpg -------------------------------------------------------------------------------- /Ard-ShiftReg/Shift1/Shift1.ino: -------------------------------------------------------------------------------- 1 | int serial = 13; 2 | int sclk = 11; 3 | int latch = 12; 4 | 5 | void setup() { 6 | pinMode(serial, OUTPUT); 7 | pinMode(sclk, OUTPUT); 8 | pinMode(latch, OUTPUT); 9 | 10 | digitalWrite(sclk, LOW); 11 | digitalWrite(latch, LOW); 12 | 13 | shiftOut(serial, sclk, MSBFIRST, B0); 14 | digitalWrite(latch, HIGH); 15 | 16 | delay(1000); 17 | 18 | digitalWrite(latch, LOW); 19 | digitalWrite(serial, HIGH); 20 | digitalWrite(sclk, HIGH); 21 | digitalWrite(sclk, LOW); 22 | 23 | digitalWrite(latch, HIGH); 24 | 25 | delay(1000); 26 | 27 | digitalWrite(latch, LOW); 28 | digitalWrite(serial, LOW); 29 | digitalWrite(sclk, HIGH); 30 | digitalWrite(sclk, LOW); 31 | 32 | digitalWrite(latch, HIGH); 33 | } 34 | 35 | void loop() { 36 | // put your main code here, to run repeatedly: 37 | 38 | } 39 | -------------------------------------------------------------------------------- /Ard-ShiftReg/Shift2/Shift2.ino: -------------------------------------------------------------------------------- 1 | int serial = 13; 2 | int sclk = 11; 3 | int latch = 12; 4 | 5 | int i = 0; 6 | 7 | void setup() { 8 | pinMode(serial, OUTPUT); 9 | pinMode(sclk, OUTPUT); 10 | pinMode(latch, OUTPUT); 11 | 12 | digitalWrite(sclk, LOW); 13 | digitalWrite(latch, LOW); 14 | 15 | shiftOut(serial, sclk, MSBFIRST, B0); 16 | digitalWrite(latch, HIGH); 17 | } 18 | 19 | void loop() { 20 | i = (i + 1) % 3; 21 | digitalWrite(latch, LOW); 22 | 23 | if (i != 0) { 24 | digitalWrite(serial, LOW); 25 | } else { 26 | digitalWrite(serial, HIGH); 27 | } 28 | 29 | digitalWrite(sclk, HIGH); 30 | digitalWrite(sclk, LOW); 31 | digitalWrite(latch, HIGH); 32 | 33 | delay(1000); 34 | } 35 | -------------------------------------------------------------------------------- /Ard-ShiftReg/ShiftClear/ShiftClear.ino: -------------------------------------------------------------------------------- 1 | int serial = 13; 2 | int sclk = 11; 3 | int latch = 12; 4 | 5 | int i = 0; 6 | 7 | void setup() { 8 | pinMode(serial, OUTPUT); 9 | pinMode(sclk, OUTPUT); 10 | pinMode(latch, OUTPUT); 11 | 12 | digitalWrite(sclk, LOW); 13 | digitalWrite(latch, LOW); 14 | 15 | shiftOut(serial, sclk, MSBFIRST, B0); 16 | digitalWrite(latch, HIGH); 17 | } 18 | 19 | void loop() { 20 | // put your main code here, to run repeatedly: 21 | 22 | } 23 | -------------------------------------------------------------------------------- /Ard-ShiftReg/ShiftReg.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-ShiftReg/ShiftReg.fzz -------------------------------------------------------------------------------- /Ard-ShiftReg/ShiftReg_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-ShiftReg/ShiftReg_bb.png -------------------------------------------------------------------------------- /Ard-StepperMotors/Stepper/Stepper.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #define HALFSTEP 8 3 | 4 | // Motor pin definitions 5 | #define motorPin1 8 // IN1 on the ULN2003 driver 1 6 | #define motorPin2 9 // IN2 on the ULN2003 driver 1 7 | #define motorPin3 10 // IN3 on the ULN2003 driver 1 8 | #define motorPin4 11 // IN4 on the ULN2003 driver 1 9 | 10 | // Initialize with pin sequence IN1-IN3-IN2-IN4 for using the AccelStepper with 28BYJ-48 11 | AccelStepper stepper1(HALFSTEP, motorPin1, motorPin3, motorPin2, motorPin4); 12 | 13 | void setup() { 14 | stepper1.setMaxSpeed(1000.0); 15 | stepper1.setAcceleration(100.0); 16 | stepper1.setSpeed(200); 17 | stepper1.moveTo(2048); 18 | 19 | }//--(end setup )--- 20 | 21 | void loop() { 22 | 23 | //Change direction when the stepper reaches the target position 24 | if (stepper1.distanceToGo() == 0) { 25 | stepper1.moveTo(-stepper1.currentPosition()); 26 | } 27 | stepper1.run(); 28 | } 29 | -------------------------------------------------------------------------------- /Ard-TFTDisplay/arduino.bmp: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-TFTDisplay/arduino.bmp -------------------------------------------------------------------------------- /Ard-TempFan/TempFan/TempFan.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #define DHT_SENSOR_TYPE DHT_TYPE_11 3 | 4 | static const int DHT_SENSOR_PIN = 2; 5 | DHT_nonblocking dht_sensor( DHT_SENSOR_PIN, DHT_SENSOR_TYPE ); 6 | 7 | boolean fan_on = false; 8 | 9 | #define ENABLE 5 10 | #define DIRA 3 11 | #define DIRB 4 12 | 13 | void setup() { 14 | Serial.begin( 9600); 15 | 16 | pinMode(ENABLE,OUTPUT); 17 | pinMode(DIRA,OUTPUT); 18 | pinMode(DIRB,OUTPUT); 19 | 20 | digitalWrite(DIRA,HIGH); //one way 21 | digitalWrite(DIRB,LOW); 22 | digitalWrite(ENABLE,LOW); // enable off 23 | } 24 | 25 | /* 26 | * Poll for a measurement, keeping the state machine alive. Returns 27 | * true if a measurement is available. 28 | */ 29 | static bool measure_environment( float *temperature, float *humidity ) 30 | { 31 | static unsigned long measurement_timestamp = millis( ); 32 | 33 | /* Measure once every four seconds. */ 34 | if( millis( ) - measurement_timestamp > 3000ul ) 35 | { 36 | if( dht_sensor.measure( temperature, humidity ) == true ) 37 | { 38 | measurement_timestamp = millis( ); 39 | return( true ); 40 | } 41 | } 42 | 43 | return( false ); 44 | } 45 | 46 | void loop() { 47 | float temperature; 48 | float humidity; 49 | 50 | if( measure_environment( &temperature, &humidity ) == true ) 51 | { 52 | if (temperature > 29.0) { 53 | digitalWrite(ENABLE,HIGH); 54 | if(! fan_on) { 55 | Serial.println("High temperature - turn on fan"); 56 | fan_on = true; 57 | } 58 | } else { 59 | digitalWrite(ENABLE,LOW); 60 | if(fan_on) { 61 | Serial.println("Low temperature - turn off fan"); 62 | fan_on = false; 63 | } 64 | } 65 | Serial.print( "T = " ); 66 | Serial.print( temperature, 1 ); 67 | Serial.print( " deg. C, H = " ); 68 | Serial.print( humidity, 1 ); 69 | Serial.println( "%" ); 70 | 71 | } 72 | } 73 | -------------------------------------------------------------------------------- /Ard-TempFan/TemperatureFan-1.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-TempFan/TemperatureFan-1.fzz -------------------------------------------------------------------------------- /Ard-TempFan/TemperatureFan-1_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-TempFan/TemperatureFan-1_bb.png -------------------------------------------------------------------------------- /Ard-TouchSensor/Touch1/Touch1.ino: -------------------------------------------------------------------------------- 1 | const int analogInPin = A1; 2 | 3 | int sensorValue = 0; 4 | 5 | void setup() { 6 | Serial.begin(9600); 7 | } 8 | 9 | void loop() { 10 | sensorValue = analogRead(analogInPin); 11 | 12 | // print the results to the serial monitor: 13 | Serial.print("sensor = " ); 14 | Serial.println(sensorValue); 15 | delay(250); 16 | } 17 | -------------------------------------------------------------------------------- /Ard-TouchSensor/Touch2/Touch2.ino: -------------------------------------------------------------------------------- 1 | const int analogInPin = A1; 2 | const int analogOutPin = 3; 3 | 4 | int sensorValue = 0; 5 | int outputValue = 0; 6 | 7 | void setup() { 8 | Serial.begin(9600); 9 | } 10 | 11 | void loop() { 12 | sensorValue = analogRead(analogInPin); 13 | outputValue = map(sensorValue, 0, 1023, 0, 255); 14 | analogWrite(analogOutPin, outputValue); 15 | 16 | // print the results to the serial monitor: 17 | Serial.print("sensor = " ); 18 | Serial.print(sensorValue); 19 | Serial.print("\t output = "); 20 | Serial.println(outputValue); 21 | delay(250); 22 | } 23 | -------------------------------------------------------------------------------- /Ard-TouchSensor/touch_sensor.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-TouchSensor/touch_sensor.fzz -------------------------------------------------------------------------------- /Ard-TouchSensor/touch_sensor_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Ard-TouchSensor/touch_sensor_bb.png -------------------------------------------------------------------------------- /ESP-AdafruitIO/AdafruitIO_Publish/AdafruitIO_Publish.ino: -------------------------------------------------------------------------------- 1 | // Adafruit IO Publish Example 2 | // 3 | // Adafruit invests time and resources providing this open source code. 4 | // Please support Adafruit and open source hardware by purchasing 5 | // products from Adafruit! 6 | // 7 | // Written by Todd Treece for Adafruit Industries 8 | // Copyright (c) 2016 Adafruit Industries 9 | // Licensed under the MIT license. 10 | // 11 | // All text above must be included in any redistribution. 12 | 13 | /************************** Configuration ***********************************/ 14 | 15 | // edit the config.h tab and enter your Adafruit IO credentials 16 | // and any additional configuration needed for WiFi, cellular, 17 | // or ethernet clients. 18 | #include "config.h" 19 | 20 | /************************ Example Starts Here *******************************/ 21 | 22 | // this int will hold the current count for our sketch 23 | int count = 0; 24 | 25 | // set up the 'counter' feed 26 | AdafruitIO_Feed *counter = io.feed("counter"); 27 | 28 | void setup() { 29 | 30 | // start the serial connection 31 | Serial.begin(115200); 32 | 33 | // wait for serial monitor to open 34 | while(! Serial); 35 | 36 | Serial.print("Connecting to Adafruit IO"); 37 | 38 | // connect to io.adafruit.com 39 | io.connect(); 40 | 41 | // wait for a connection 42 | while(io.status() < AIO_CONNECTED) { 43 | Serial.print("."); 44 | delay(500); 45 | } 46 | 47 | // we are connected 48 | Serial.println(); 49 | Serial.println(io.statusText()); 50 | 51 | } 52 | 53 | void loop() { 54 | 55 | // io.run(); is required for all sketches. 56 | // it should always be present at the top of your loop 57 | // function. it keeps the client connected to 58 | // io.adafruit.com, and processes any incoming data. 59 | io.run(); 60 | 61 | // save count to the 'counter' feed on Adafruit IO 62 | Serial.print("sending -> "); 63 | Serial.println(count); 64 | counter->save(count); 65 | 66 | // increment the count by 1 67 | count++; 68 | 69 | // Adafruit IO is rate limited for publishing, so a delay is required in 70 | // between feed->save events. In this example, we will wait three seconds 71 | // (1000 milliseconds == 1 second) during each loop. 72 | delay(3000); 73 | 74 | } 75 | -------------------------------------------------------------------------------- /ESP-AdafruitIO/AdafruitIO_Publish/config.h: -------------------------------------------------------------------------------- 1 | /************************ Adafruit IO Config *******************************/ 2 | 3 | // visit io.adafruit.com if you need to create an account, 4 | // or if you need your Adafruit IO key. 5 | #define IO_USERNAME "username" 6 | #define IO_KEY "aio_key" 7 | /******************************* WIFI **************************************/ 8 | 9 | // the AdafruitIO_WiFi client will work with the following boards: 10 | // - HUZZAH ESP8266 Breakout -> https://www.adafruit.com/products/2471 11 | // - Feather HUZZAH ESP8266 -> https://www.adafruit.com/products/2821 12 | // - Feather HUZZAH ESP32 -> https://www.adafruit.com/product/3405 13 | // - Feather M0 WiFi -> https://www.adafruit.com/products/3010 14 | // - Feather WICED -> https://www.adafruit.com/products/3056 15 | // - Adafruit PyPortal -> https://www.adafruit.com/product/4116 16 | // - Adafruit Metro M4 Express AirLift Lite -> 17 | // https://www.adafruit.com/product/4000 18 | // - Adafruit AirLift Breakout -> https://www.adafruit.com/product/4201 19 | // - Adafruit AirLift Shield -> https://www.adafruit.com/product/4285 20 | // - Adafruit AirLift FeatherWing -> https://www.adafruit.com/product/4264 21 | 22 | #define WIFI_SSID "WIFI_SSID" 23 | #define WIFI_PASS "WIFI_PASS" 24 | 25 | // uncomment the following line if you are using airlift 26 | // #define USE_AIRLIFT 27 | 28 | // uncomment the following line if you are using winc1500 29 | // #define USE_WINC1500 30 | 31 | // comment out the following lines if you are using fona or ethernet 32 | #include "AdafruitIO_WiFi.h" 33 | 34 | #if defined(USE_AIRLIFT) || defined(ADAFRUIT_METRO_M4_AIRLIFT_LITE) || \ 35 | defined(ADAFRUIT_PYPORTAL) 36 | // Configure the pins used for the ESP32 connection 37 | #if !defined(SPIWIFI_SS) // if the wifi definition isnt in the board variant 38 | // Don't change the names of these #define's! they match the variant ones 39 | #define SPIWIFI SPI 40 | #define SPIWIFI_SS 10 // Chip select pin 41 | #define NINA_ACK 9 // a.k.a BUSY or READY pin 42 | #define NINA_RESETN 6 // Reset pin 43 | #define NINA_GPIO0 -1 // Not connected 44 | #endif 45 | AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS, SPIWIFI_SS, 46 | NINA_ACK, NINA_RESETN, NINA_GPIO0, &SPIWIFI); 47 | #else 48 | AdafruitIO_WiFi io(IO_USERNAME, IO_KEY, WIFI_SSID, WIFI_PASS); 49 | #endif 50 | /******************************* FONA **************************************/ 51 | 52 | // the AdafruitIO_FONA client will work with the following boards: 53 | // - Feather 32u4 FONA -> https://www.adafruit.com/product/3027 54 | 55 | // uncomment the following two lines for 32u4 FONA, 56 | // and comment out the AdafruitIO_WiFi client in the WIFI section 57 | // #include "AdafruitIO_FONA.h" 58 | // AdafruitIO_FONA io(IO_USERNAME, IO_KEY); 59 | 60 | /**************************** ETHERNET ************************************/ 61 | 62 | // the AdafruitIO_Ethernet client will work with the following boards: 63 | // - Ethernet FeatherWing -> https://www.adafruit.com/products/3201 64 | 65 | // uncomment the following two lines for ethernet, 66 | // and comment out the AdafruitIO_WiFi client in the WIFI section 67 | // #include "AdafruitIO_Ethernet.h" 68 | // AdafruitIO_Ethernet io(IO_USERNAME, IO_KEY); 69 | -------------------------------------------------------------------------------- /ESP-BLEDHT/BLE-DHT/BLE-DHT.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #include "DHT.h" 6 | 7 | #define DHTPIN 16 8 | #define DHTTYPE DHT22 // DHT 22 (AM2302), AM2321 9 | 10 | BLEServer* pServer = NULL; 11 | BLECharacteristic* pTempCharacteristic = NULL; 12 | BLECharacteristic* pHumiCharacteristic = NULL; 13 | bool deviceConnected = false; 14 | bool oldDeviceConnected = false; 15 | 16 | // See the following for generating UUIDs: 17 | // https://www.uuidgenerator.net/ 18 | 19 | #define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" 20 | #define TEMP_CHAR_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" 21 | #define HUMI_CHAR_UUID "16d3930d-2523-4e25-bee8-86c84708b63c" 22 | 23 | DHT dht(DHTPIN, DHTTYPE); 24 | 25 | 26 | class MyServerCallbacks: public BLEServerCallbacks { 27 | void onConnect(BLEServer* pServer) { 28 | deviceConnected = true; 29 | }; 30 | 31 | void onDisconnect(BLEServer* pServer) { 32 | deviceConnected = false; 33 | } 34 | }; 35 | 36 | 37 | 38 | void setup() { 39 | Serial.begin(115200); 40 | 41 | dht.begin(); 42 | 43 | // Create the BLE Device 44 | BLEDevice::init("ESP32DHT"); 45 | 46 | // Create the BLE Server 47 | pServer = BLEDevice::createServer(); 48 | pServer->setCallbacks(new MyServerCallbacks()); 49 | 50 | // Create the BLE Service 51 | BLEService *pService = pServer->createService(SERVICE_UUID); 52 | 53 | // Create a BLE Characteristic for temperature 54 | pTempCharacteristic = pService->createCharacteristic( 55 | TEMP_CHAR_UUID, 56 | BLECharacteristic::PROPERTY_READ | 57 | BLECharacteristic::PROPERTY_WRITE | 58 | BLECharacteristic::PROPERTY_NOTIFY | 59 | BLECharacteristic::PROPERTY_INDICATE 60 | ); 61 | 62 | // Create a BLE Descriptor 63 | pTempCharacteristic->addDescriptor(new BLE2902()); 64 | 65 | // Create a BLE Characteristic for humidity 66 | pHumiCharacteristic = pService->createCharacteristic( 67 | HUMI_CHAR_UUID, 68 | BLECharacteristic::PROPERTY_READ | 69 | BLECharacteristic::PROPERTY_WRITE | 70 | BLECharacteristic::PROPERTY_NOTIFY | 71 | BLECharacteristic::PROPERTY_INDICATE 72 | ); 73 | 74 | // Create a BLE Descriptor 75 | pHumiCharacteristic->addDescriptor(new BLE2902()); 76 | 77 | // Start the service 78 | pService->start(); 79 | 80 | // Start advertising 81 | BLEAdvertising *pAdvertising = BLEDevice::getAdvertising(); 82 | pAdvertising->addServiceUUID(SERVICE_UUID); 83 | pAdvertising->setScanResponse(false); 84 | pAdvertising->setMinPreferred(0x0); // set value to 0x00 to not advertise this parameter 85 | BLEDevice::startAdvertising(); 86 | Serial.println("Waiting a client connection to notify..."); 87 | } 88 | 89 | void loop() { 90 | // notify changed value 91 | if (deviceConnected) { 92 | float t = dht.readTemperature(); 93 | float h = dht.readHumidity(); 94 | 95 | Serial.print("Temperature: "); 96 | Serial.print(t); 97 | Serial.print(" *C\t"); 98 | Serial.print("Humidity: "); 99 | Serial.print(h); 100 | Serial.println(" %"); 101 | 102 | char buffer[6]; 103 | 104 | sprintf(buffer, "%02.02f", t); 105 | pTempCharacteristic->setValue(buffer); 106 | pTempCharacteristic->notify(); 107 | 108 | sprintf(buffer, "%02.02f", h); 109 | pHumiCharacteristic->setValue(buffer); 110 | pHumiCharacteristic->notify(); 111 | 112 | delay(2000); // bluetooth stack will go into congestion, if too many packets are sent, in 6 hours test i was able to go as low as 3ms 113 | } 114 | // disconnecting 115 | if (!deviceConnected && oldDeviceConnected) { 116 | delay(500); // give the bluetooth stack the chance to get things ready 117 | pServer->startAdvertising(); // restart advertising 118 | Serial.println("start advertising"); 119 | oldDeviceConnected = deviceConnected; 120 | } 121 | // connecting 122 | if (deviceConnected && !oldDeviceConnected) { 123 | // do stuff here on connecting 124 | oldDeviceConnected = deviceConnected; 125 | } 126 | } 127 | -------------------------------------------------------------------------------- /ESP-HallTFT/ESP-096TFT.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP-HallTFT/ESP-096TFT.fzz -------------------------------------------------------------------------------- /ESP-HallTFT/ESP-096TFT_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP-HallTFT/ESP-096TFT_bb.png -------------------------------------------------------------------------------- /ESP-HallTFT/ESP-TFT/ESP-TFT.ino: -------------------------------------------------------------------------------- 1 | #include // Graphics and font library for ST7735 driver chip 2 | #include 3 | 4 | TFT_eSPI tft = TFT_eSPI(); // Invoke library, pins defined in User_Setup.h 5 | 6 | char sensorPrintout[4]; 7 | 8 | void setup() { 9 | tft.init(); 10 | tft.setRotation(3); 11 | 12 | tft.fillScreen(TFT_BLACK); 13 | 14 | tft.setCursor(0, 0, 2); 15 | tft.setTextColor(TFT_WHITE); 16 | // tft.setTextFont(2); 17 | tft.setTextSize(1); 18 | tft.print("Sensor Value : "); 19 | 20 | tft.setTextSize(5); 21 | } 22 | 23 | void loop() { 24 | String sensorVal = String(hallRead()); 25 | sensorVal.toCharArray(sensorPrintout, 4); 26 | 27 | tft.setTextColor(TFT_RED, TFT_BLACK); 28 | tft.setCursor(0, 15); 29 | tft.print(sensorPrintout); 30 | 31 | delay(1000); 32 | } 33 | -------------------------------------------------------------------------------- /ESP-OTA/OTA-Blink/OTA-Blink.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | const char* ssid = "BasementElectronics"; 7 | const char* password = "AmateurHour"; 8 | 9 | //variabls for blinking an LED with Millis 10 | const int led = 2; // ESP32 Pin to which onboard LED is connected 11 | unsigned long previousMillis = 0; // will store last time LED was updated 12 | const long interval = 1000; // interval at which to blink (milliseconds) 13 | int ledState = LOW; // ledState used to set the LED 14 | 15 | void setup() { 16 | 17 | pinMode(led, OUTPUT); 18 | 19 | Serial.begin(115200); 20 | Serial.println("Booting"); 21 | WiFi.mode(WIFI_STA); 22 | WiFi.begin(ssid, password); 23 | while (WiFi.waitForConnectResult() != WL_CONNECTED) { 24 | Serial.println("Connection Failed! Rebooting..."); 25 | delay(5000); 26 | ESP.restart(); 27 | } 28 | 29 | // Port defaults to 3232 30 | // ArduinoOTA.setPort(3232); 31 | 32 | // Hostname defaults to esp3232-[MAC] 33 | // ArduinoOTA.setHostname("myesp32"); 34 | 35 | // No authentication by default 36 | // ArduinoOTA.setPassword("admin"); 37 | 38 | // Password can be set with it's md5 value as well 39 | // MD5(admin) = 21232f297a57a5a743894a0e4a801fc3 40 | // ArduinoOTA.setPasswordHash("21232f297a57a5a743894a0e4a801fc3"); 41 | 42 | ArduinoOTA 43 | .onStart([]() { 44 | String type; 45 | if (ArduinoOTA.getCommand() == U_FLASH) 46 | type = "sketch"; 47 | else // U_SPIFFS 48 | type = "filesystem"; 49 | 50 | // NOTE: if updating SPIFFS this would be the place to unmount SPIFFS using SPIFFS.end() 51 | Serial.println("Start updating " + type); 52 | }) 53 | .onEnd([]() { 54 | Serial.println("\nEnd"); 55 | }) 56 | .onProgress([](unsigned int progress, unsigned int total) { 57 | Serial.printf("Progress: %u%%\r", (progress / (total / 100))); 58 | }) 59 | .onError([](ota_error_t error) { 60 | Serial.printf("Error[%u]: ", error); 61 | if (error == OTA_AUTH_ERROR) Serial.println("Auth Failed"); 62 | else if (error == OTA_BEGIN_ERROR) Serial.println("Begin Failed"); 63 | else if (error == OTA_CONNECT_ERROR) Serial.println("Connect Failed"); 64 | else if (error == OTA_RECEIVE_ERROR) Serial.println("Receive Failed"); 65 | else if (error == OTA_END_ERROR) Serial.println("End Failed"); 66 | }); 67 | 68 | ArduinoOTA.begin(); 69 | 70 | Serial.println("Ready"); 71 | Serial.print("IP address: "); 72 | Serial.println(WiFi.localIP()); 73 | } 74 | 75 | void loop() { 76 | ArduinoOTA.handle(); 77 | 78 | //loop to blink without delay 79 | unsigned long currentMillis = millis(); 80 | if (currentMillis - previousMillis >= interval) { 81 | // save the last time you blinked the LED 82 | previousMillis = currentMillis; 83 | // if the LED is off turn it on and vice-versa: 84 | ledState = not(ledState); 85 | // set the LED with the ledState of the variable: 86 | digitalWrite(led, ledState); 87 | } 88 | 89 | } 90 | -------------------------------------------------------------------------------- /ESP-SPIFFS/SimpleSPIFFSWeb/SimpleSPIFFSWeb.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | 6 | const char* ssid = "BasementElectronics"; 7 | const char* password = "AmateurHour"; 8 | 9 | WebServer server(80); 10 | 11 | String formatBytes(size_t bytes) { 12 | if (bytes < 1024) { 13 | return String(bytes) + "B"; 14 | } else if (bytes < (1024 * 1024)) { 15 | return String(bytes / 1024.0) + "KB"; 16 | } else if (bytes < (1024 * 1024 * 1024)) { 17 | return String(bytes / 1024.0 / 1024.0) + "MB"; 18 | } else { 19 | return String(bytes / 1024.0 / 1024.0 / 1024.0) + "GB"; 20 | } 21 | } 22 | 23 | String getContentType(String filename) { 24 | if (server.hasArg("download")) { 25 | return "application/octet-stream"; 26 | } else if (filename.endsWith(".htm")) { 27 | return "text/html"; 28 | } else if (filename.endsWith(".html")) { 29 | return "text/html"; 30 | } else if (filename.endsWith(".css")) { 31 | return "text/css"; 32 | } else if (filename.endsWith(".js")) { 33 | return "application/javascript"; 34 | } else if (filename.endsWith(".png")) { 35 | return "image/png"; 36 | } else if (filename.endsWith(".gif")) { 37 | return "image/gif"; 38 | } else if (filename.endsWith(".jpg")) { 39 | return "image/jpeg"; 40 | } else if (filename.endsWith(".ico")) { 41 | return "image/x-icon"; 42 | } else if (filename.endsWith(".xml")) { 43 | return "text/xml"; 44 | } else if (filename.endsWith(".pdf")) { 45 | return "application/x-pdf"; 46 | } else if (filename.endsWith(".zip")) { 47 | return "application/x-zip"; 48 | } else if (filename.endsWith(".gz")) { 49 | return "application/x-gzip"; 50 | } 51 | return "text/plain"; 52 | } 53 | 54 | bool exists(String path){ 55 | bool yes = false; 56 | File file = SPIFFS.open(path, "r"); 57 | if(!file.isDirectory()){ 58 | yes = true; 59 | } 60 | file.close(); 61 | return yes; 62 | } 63 | 64 | bool handleFileRead(String path) { 65 | Serial.println("handleFileRead: " + path); 66 | if (path.endsWith("/")) { 67 | path += "index.htm"; 68 | } 69 | String contentType = getContentType(path); 70 | String pathWithGz = path + ".gz"; 71 | if (exists(pathWithGz) || exists(path)) { 72 | if (exists(pathWithGz)) { 73 | path += ".gz"; 74 | } 75 | File file = SPIFFS.open(path, "r"); 76 | server.streamFile(file, contentType); 77 | file.close(); 78 | return true; 79 | } 80 | return false; 81 | } 82 | 83 | void handleIndex() { 84 | handleFileRead("/"); 85 | return; 86 | } 87 | 88 | void setup() { 89 | Serial.begin(115200); 90 | Serial.print("\n"); 91 | Serial.setDebugOutput(true); 92 | SPIFFS.begin(); 93 | { 94 | // First party trick - do a directory listing 95 | File root = SPIFFS.open("/"); 96 | File file = root.openNextFile(); 97 | while(file){ 98 | String fileName = file.name(); 99 | size_t fileSize = file.size(); 100 | Serial.printf("FS File: %s, size: %s\n", fileName.c_str(), formatBytes(fileSize).c_str()); 101 | file = root.openNextFile(); 102 | } 103 | Serial.printf("\n"); 104 | } 105 | 106 | 107 | //WIFI INIT 108 | Serial.printf("Connecting to %s\n", ssid); 109 | if (String(WiFi.SSID()) != String(ssid)) { 110 | WiFi.mode(WIFI_STA); 111 | WiFi.begin(ssid, password); 112 | } 113 | 114 | while (WiFi.status() != WL_CONNECTED) { 115 | delay(500); 116 | Serial.print("."); 117 | } 118 | Serial.println(""); 119 | Serial.print("Connected! IP address: "); 120 | Serial.println(WiFi.localIP()); 121 | 122 | //SERVER INIT 123 | server.on("/", HTTP_GET, handleIndex); 124 | 125 | //called when the url is not defined here 126 | //use it to load content from SPIFFS 127 | server.onNotFound([]() { 128 | if (!handleFileRead(server.uri())) { 129 | server.send(404, "text/plain", "FileNotFound"); 130 | } 131 | }); 132 | 133 | server.begin(); 134 | Serial.println("HTTP server started"); 135 | } 136 | 137 | void loop() { 138 | server.handleClient(); 139 | } 140 | -------------------------------------------------------------------------------- /ESP-SPIFFS/SimpleSPIFFSWeb/data/be.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP-SPIFFS/SimpleSPIFFSWeb/data/be.png -------------------------------------------------------------------------------- /ESP-SPIFFS/SimpleSPIFFSWeb/data/index.htm: -------------------------------------------------------------------------------- 1 | 2 | 3 | ESP Test Page 4 | 5 | 6 |

ESP Test Page

7 |

This is a simple web page put together to demonstrate the embedded filesystem

8 |
9 | 10 | -------------------------------------------------------------------------------- /ESP-TFT/ESP-TFT_Wiring.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP-TFT/ESP-TFT_Wiring.fzz -------------------------------------------------------------------------------- /ESP-TFT/ESP-TFT_Wiring_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP-TFT/ESP-TFT_Wiring_bb.png -------------------------------------------------------------------------------- /ESP-Webservices/ESP-Weather/ESP-Weather.ino: -------------------------------------------------------------------------------- 1 | #include 2 | 3 | #include 4 | #include 5 | 6 | #include 7 | 8 | const char* ssid = "WIFI_SSID"; 9 | const char* password = "WiFi_Password"; 10 | 11 | String api_url = "http://dataservice.accuweather.com/currentconditions/v1/"; 12 | String api_location = "55488"; // Toronto 13 | 14 | String api_key = ""; 15 | String api_details = "true"; 16 | 17 | String web_url = api_url + api_location + "?apikey=" + api_key + "&details=" + api_details; 18 | 19 | const int RS = 5, EN = 18, d4 = 19, d5 = 21, d6 = 22, d7 = 23; 20 | LiquidCrystal lcd(RS, EN, d4, d5, d6, d7); 21 | 22 | void setup() { 23 | Serial.begin(115200); //serial start and pin config 24 | WiFi.begin(ssid, password); 25 | 26 | while (WiFi.status() != WL_CONNECTED) { 27 | delay(500); 28 | Serial.print("."); 29 | } 30 | Serial.println(""); 31 | Serial.println("WiFi connected"); 32 | 33 | lcd.begin(16, 2); 34 | lcd.print("WiFi Connected"); 35 | lcd.setCursor(0, 1); 36 | lcd.print("Getting data..."); 37 | } 38 | 39 | void loop() { 40 | HTTPClient http; 41 | http.begin(web_url); 42 | int httpCode = http.GET(); 43 | 44 | if(httpCode > 0) { 45 | // file found at server 46 | if(httpCode == HTTP_CODE_OK) { 47 | String payload = http.getString(); 48 | 49 | Serial.println(payload); 50 | 51 | const size_t capacity = JSON_ARRAY_SIZE(1) + JSON_OBJECT_SIZE(1) + 33*JSON_OBJECT_SIZE(2) + 58*JSON_OBJECT_SIZE(3) + JSON_OBJECT_SIZE(8) + JSON_OBJECT_SIZE(31) + 2940; 52 | DynamicJsonDocument doc(capacity); 53 | 54 | deserializeJson(doc, payload); 55 | 56 | String json_temp = doc[0]["Temperature"]["Metric"]["Value"]; 57 | String json_tempunt = doc[0]["Temperature"]["Metric"]["Unit"]; 58 | String json_winddir = doc[0]["Wind"]["Direction"]["Localized"]; 59 | String json_windspd = doc[0]["Wind"]["Speed"]["Metric"]["Value"]; 60 | String json_windspdunt = doc[0]["Wind"]["Speed"]["Metric"]["Unit"]; 61 | 62 | Serial.print("Temp: "); 63 | Serial.print(json_temp ); 64 | Serial.println(" C"); 65 | 66 | lcd.clear(); 67 | lcd.setCursor(0, 0); 68 | lcd.print("T: " + json_temp + " " + json_tempunt); 69 | lcd.setCursor(0, 1); 70 | lcd.print("W: " + json_windspd + " " + json_windspdunt + " " + json_winddir); 71 | } 72 | } else { 73 | Serial.printf("[HTTP] GET... failed, error: %s\n", http.errorToString(httpCode).c_str()); 74 | } 75 | http.end(); 76 | 77 | delay(3600000); // Sleep for an hour 78 | } 79 | -------------------------------------------------------------------------------- /ESP-Webservices/ESP-Webservices.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP-Webservices/ESP-Webservices.fzz -------------------------------------------------------------------------------- /ESP-Webservices/ESP-Webservices_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP-Webservices/ESP-Webservices_bb.png -------------------------------------------------------------------------------- /ESP-Webservices/description.txt: -------------------------------------------------------------------------------- 1 | JSON Deserializer: https://arduinojson.org/v6/assistant/ 2 | AccuWeather Developer: https://developer.accuweather.com/ 3 | -------------------------------------------------------------------------------- /ESP32-CamCard/SD_Camera/camera_pins.h: -------------------------------------------------------------------------------- 1 | 2 | #if defined(CAMERA_MODEL_WROVER_KIT) 3 | #define PWDN_GPIO_NUM -1 4 | #define RESET_GPIO_NUM -1 5 | #define XCLK_GPIO_NUM 21 6 | #define SIOD_GPIO_NUM 26 7 | #define SIOC_GPIO_NUM 27 8 | 9 | #define Y9_GPIO_NUM 35 10 | #define Y8_GPIO_NUM 34 11 | #define Y7_GPIO_NUM 39 12 | #define Y6_GPIO_NUM 36 13 | #define Y5_GPIO_NUM 19 14 | #define Y4_GPIO_NUM 18 15 | #define Y3_GPIO_NUM 5 16 | #define Y2_GPIO_NUM 4 17 | #define VSYNC_GPIO_NUM 25 18 | #define HREF_GPIO_NUM 23 19 | #define PCLK_GPIO_NUM 22 20 | 21 | #elif defined(CAMERA_MODEL_ESP_EYE) 22 | #define PWDN_GPIO_NUM -1 23 | #define RESET_GPIO_NUM -1 24 | #define XCLK_GPIO_NUM 4 25 | #define SIOD_GPIO_NUM 18 26 | #define SIOC_GPIO_NUM 23 27 | 28 | #define Y9_GPIO_NUM 36 29 | #define Y8_GPIO_NUM 37 30 | #define Y7_GPIO_NUM 38 31 | #define Y6_GPIO_NUM 39 32 | #define Y5_GPIO_NUM 35 33 | #define Y4_GPIO_NUM 14 34 | #define Y3_GPIO_NUM 13 35 | #define Y2_GPIO_NUM 34 36 | #define VSYNC_GPIO_NUM 5 37 | #define HREF_GPIO_NUM 27 38 | #define PCLK_GPIO_NUM 25 39 | 40 | #elif defined(CAMERA_MODEL_M5STACK_PSRAM) 41 | #define PWDN_GPIO_NUM -1 42 | #define RESET_GPIO_NUM 15 43 | #define XCLK_GPIO_NUM 27 44 | #define SIOD_GPIO_NUM 25 45 | #define SIOC_GPIO_NUM 23 46 | 47 | #define Y9_GPIO_NUM 19 48 | #define Y8_GPIO_NUM 36 49 | #define Y7_GPIO_NUM 18 50 | #define Y6_GPIO_NUM 39 51 | #define Y5_GPIO_NUM 5 52 | #define Y4_GPIO_NUM 34 53 | #define Y3_GPIO_NUM 35 54 | #define Y2_GPIO_NUM 32 55 | #define VSYNC_GPIO_NUM 22 56 | #define HREF_GPIO_NUM 26 57 | #define PCLK_GPIO_NUM 21 58 | 59 | #elif defined(CAMERA_MODEL_M5STACK_WIDE) 60 | #define PWDN_GPIO_NUM -1 61 | #define RESET_GPIO_NUM 15 62 | #define XCLK_GPIO_NUM 27 63 | #define SIOD_GPIO_NUM 22 64 | #define SIOC_GPIO_NUM 23 65 | 66 | #define Y9_GPIO_NUM 19 67 | #define Y8_GPIO_NUM 36 68 | #define Y7_GPIO_NUM 18 69 | #define Y6_GPIO_NUM 39 70 | #define Y5_GPIO_NUM 5 71 | #define Y4_GPIO_NUM 34 72 | #define Y3_GPIO_NUM 35 73 | #define Y2_GPIO_NUM 32 74 | #define VSYNC_GPIO_NUM 25 75 | #define HREF_GPIO_NUM 26 76 | #define PCLK_GPIO_NUM 21 77 | 78 | #elif defined(CAMERA_MODEL_AI_THINKER) 79 | #define PWDN_GPIO_NUM 32 80 | #define RESET_GPIO_NUM -1 81 | #define XCLK_GPIO_NUM 0 82 | #define SIOD_GPIO_NUM 26 83 | #define SIOC_GPIO_NUM 27 84 | 85 | #define Y9_GPIO_NUM 35 86 | #define Y8_GPIO_NUM 34 87 | #define Y7_GPIO_NUM 39 88 | #define Y6_GPIO_NUM 36 89 | #define Y5_GPIO_NUM 21 90 | #define Y4_GPIO_NUM 19 91 | #define Y3_GPIO_NUM 18 92 | #define Y2_GPIO_NUM 5 93 | #define VSYNC_GPIO_NUM 25 94 | #define HREF_GPIO_NUM 23 95 | #define PCLK_GPIO_NUM 22 96 | 97 | #else 98 | #error "Camera model not selected" 99 | #endif 100 | -------------------------------------------------------------------------------- /ESP32-IRSend/IR_Receive.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP32-IRSend/IR_Receive.fzz -------------------------------------------------------------------------------- /ESP32-IRSend/IR_Receive_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP32-IRSend/IR_Receive_bb.png -------------------------------------------------------------------------------- /ESP32-IRSend/IR_Receive_schem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP32-IRSend/IR_Receive_schem.png -------------------------------------------------------------------------------- /ESP32-IRSend/IR_Send_ESP32.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP32-IRSend/IR_Send_ESP32.fzz -------------------------------------------------------------------------------- /ESP32-IRSend/IR_Send_ESP32_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP32-IRSend/IR_Send_ESP32_bb.png -------------------------------------------------------------------------------- /ESP32-IRSend/IR_Send_ESP32_schem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/ESP32-IRSend/IR_Send_ESP32_schem.png -------------------------------------------------------------------------------- /ESP32-RCBLE/robot_car_ble_control/BLE2901.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * BLE2901.cpp 3 | * 4 | */ 5 | 6 | /* 7 | * See also: 8 | * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml 9 | */ 10 | #include "sdkconfig.h" 11 | #if defined(CONFIG_BT_ENABLED) 12 | 13 | #include "BLE2901.h" 14 | 15 | BLE2901::BLE2901() : BLEDescriptor(BLEUUID((uint16_t) 0x2901)) { 16 | uint8_t data[2] = { 0, 0 }; 17 | setValue(data, 2); 18 | } // BLE2901 19 | 20 | 21 | /** 22 | * @brief Get the notifications value. 23 | * @return The notifications value. True if notifications are enabled and false if not. 24 | */ 25 | bool BLE2901::getNotifications() { 26 | return (getValue()[0] & (1 << 0)) != 0; 27 | } // getNotifications 28 | 29 | 30 | /** 31 | * @brief Get the indications value. 32 | * @return The indications value. True if indications are enabled and false if not. 33 | */ 34 | bool BLE2901::getIndications() { 35 | return (getValue()[0] & (1 << 1)) != 0; 36 | } // getIndications 37 | 38 | 39 | /** 40 | * @brief Set the indications flag. 41 | * @param [in] flag The indications flag. 42 | */ 43 | void BLE2901::setIndications(bool flag) { 44 | uint8_t *pValue = getValue(); 45 | if (flag) pValue[0] |= 1 << 1; 46 | else pValue[0] &= ~(1 << 1); 47 | } // setIndications 48 | 49 | 50 | /** 51 | * @brief Set the notifications flag. 52 | * @param [in] flag The notifications flag. 53 | */ 54 | void BLE2901::setNotifications(bool flag) { 55 | uint8_t *pValue = getValue(); 56 | if (flag) pValue[0] |= 1 << 0; 57 | else pValue[0] &= ~(1 << 0); 58 | } // setNotifications 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /ESP32-RCBLE/robot_car_ble_control/BLE2901.h: -------------------------------------------------------------------------------- 1 | /* 2 | * BLE2901.h 3 | * 4 | */ 5 | 6 | #ifndef COMPONENTS_CPP_UTILS_BLE2901_H_ 7 | #define COMPONENTS_CPP_UTILS_BLE2901_H_ 8 | #include "sdkconfig.h" 9 | #if defined(CONFIG_BT_ENABLED) 10 | 11 | #include "BLEDescriptor.h" 12 | 13 | /** 14 | * @brief Descriptor for Client Characteristic Configuration. 15 | * 16 | * This is a convenience descriptor for the Client Characteristic Configuration which has a UUID of 0x2901. 17 | * 18 | * See also: 19 | * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml 20 | */ 21 | class BLE2901: public BLEDescriptor { 22 | public: 23 | BLE2901(); 24 | bool getNotifications(); 25 | bool getIndications(); 26 | void setNotifications(bool flag); 27 | void setIndications(bool flag); 28 | 29 | }; // BLE2901 30 | 31 | #endif /* CONFIG_BT_ENABLED */ 32 | #endif /* COMPONENTS_CPP_UTILS_BLE2901_H_ */ 33 | -------------------------------------------------------------------------------- /ESP32-RCBLE/robot_car_ble_led/BLE2901.cpp: -------------------------------------------------------------------------------- 1 | /* 2 | * BLE2901.cpp 3 | * 4 | */ 5 | 6 | /* 7 | * See also: 8 | * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml 9 | */ 10 | #include "sdkconfig.h" 11 | #if defined(CONFIG_BT_ENABLED) 12 | 13 | #include "BLE2901.h" 14 | 15 | BLE2901::BLE2901() : BLEDescriptor(BLEUUID((uint16_t) 0x2901)) { 16 | uint8_t data[2] = { 0, 0 }; 17 | setValue(data, 2); 18 | } // BLE2901 19 | 20 | 21 | /** 22 | * @brief Get the notifications value. 23 | * @return The notifications value. True if notifications are enabled and false if not. 24 | */ 25 | bool BLE2901::getNotifications() { 26 | return (getValue()[0] & (1 << 0)) != 0; 27 | } // getNotifications 28 | 29 | 30 | /** 31 | * @brief Get the indications value. 32 | * @return The indications value. True if indications are enabled and false if not. 33 | */ 34 | bool BLE2901::getIndications() { 35 | return (getValue()[0] & (1 << 1)) != 0; 36 | } // getIndications 37 | 38 | 39 | /** 40 | * @brief Set the indications flag. 41 | * @param [in] flag The indications flag. 42 | */ 43 | void BLE2901::setIndications(bool flag) { 44 | uint8_t *pValue = getValue(); 45 | if (flag) pValue[0] |= 1 << 1; 46 | else pValue[0] &= ~(1 << 1); 47 | } // setIndications 48 | 49 | 50 | /** 51 | * @brief Set the notifications flag. 52 | * @param [in] flag The notifications flag. 53 | */ 54 | void BLE2901::setNotifications(bool flag) { 55 | uint8_t *pValue = getValue(); 56 | if (flag) pValue[0] |= 1 << 0; 57 | else pValue[0] &= ~(1 << 0); 58 | } // setNotifications 59 | 60 | #endif 61 | -------------------------------------------------------------------------------- /ESP32-RCBLE/robot_car_ble_led/BLE2901.h: -------------------------------------------------------------------------------- 1 | /* 2 | * BLE2901.h 3 | * 4 | */ 5 | 6 | #ifndef COMPONENTS_CPP_UTILS_BLE2901_H_ 7 | #define COMPONENTS_CPP_UTILS_BLE2901_H_ 8 | #include "sdkconfig.h" 9 | #if defined(CONFIG_BT_ENABLED) 10 | 11 | #include "BLEDescriptor.h" 12 | 13 | /** 14 | * @brief Descriptor for Client Characteristic Configuration. 15 | * 16 | * This is a convenience descriptor for the Client Characteristic Configuration which has a UUID of 0x2901. 17 | * 18 | * See also: 19 | * https://www.bluetooth.com/specifications/gatt/viewer?attributeXmlFile=org.bluetooth.descriptor.gatt.client_characteristic_configuration.xml 20 | */ 21 | class BLE2901: public BLEDescriptor { 22 | public: 23 | BLE2901(); 24 | bool getNotifications(); 25 | bool getIndications(); 26 | void setNotifications(bool flag); 27 | void setIndications(bool flag); 28 | 29 | }; // BLE2901 30 | 31 | #endif /* CONFIG_BT_ENABLED */ 32 | #endif /* COMPONENTS_CPP_UTILS_BLE2901_H_ */ 33 | -------------------------------------------------------------------------------- /ESP32-RCBLE/robot_car_ble_led/robot_car_ble_led.ino: -------------------------------------------------------------------------------- 1 | /* 2 | */ 3 | #include 4 | #include 5 | #include 6 | #include 7 | #include "BLE2901.h" 8 | 9 | BLEServer *pServer = NULL; 10 | BLECharacteristic * pCharacteristicA1; 11 | bool deviceConnected = false; 12 | bool oldDeviceConnected = false; 13 | 14 | // See the following for generating UUIDs: 15 | // https://www.uuidgenerator.net/ 16 | 17 | // Create Service A - ffe0 18 | #define SERVICE_A_UUID "0000FFE0-0000-1000-8000-00805F9B34FB" 19 | #define CHARACTERISTIC_A1_UUID "0000FFE1-0000-1000-8000-00805F9B34FB" 20 | 21 | int LED=2; // Define pin for on-board LED 22 | volatile int state = LOW; // The initial state of the LED pin 23 | 24 | void stateChange(){ 25 | state = !state; 26 | digitalWrite(LED, state); 27 | } 28 | 29 | class MyServerCallbacks: public BLEServerCallbacks { 30 | void onConnect(BLEServer* pServer) { 31 | Serial.println("BLE Connected"); 32 | deviceConnected = true; 33 | }; 34 | 35 | void onDisconnect(BLEServer* pServer) { 36 | Serial.println("BLE Disconnected"); 37 | deviceConnected = false; 38 | } 39 | }; 40 | 41 | class MyCallbacks: public BLECharacteristicCallbacks { 42 | void onWrite(BLECharacteristic *pCharacteristic) { 43 | std::string rxValue = pCharacteristic->getValue(); 44 | 45 | if (rxValue.length() > 0) { 46 | if(rxValue[0] == 'A') { 47 | stateChange(); 48 | } 49 | 50 | Serial.print("Received Value: "); 51 | for (int i = 0; i < rxValue.length(); i++) 52 | Serial.print(rxValue[i]); 53 | Serial.println(); 54 | } 55 | } 56 | }; 57 | 58 | 59 | void setup() { 60 | pinMode(LED, OUTPUT); 61 | 62 | Serial.begin(115200); 63 | 64 | // Create the BLE Device 65 | BLEDevice::init("ELEGOO Car"); 66 | 67 | // Create the BLE Server 68 | pServer = BLEDevice::createServer(); 69 | pServer->setCallbacks(new MyServerCallbacks()); 70 | 71 | // Create the BLE Service 72 | BLEService *pServiceA = pServer->createService(SERVICE_A_UUID); 73 | 74 | // Create a BLE Characteristic 75 | pCharacteristicA1 = pServiceA->createCharacteristic( 76 | CHARACTERISTIC_A1_UUID, 77 | BLECharacteristic::PROPERTY_NOTIFY | BLECharacteristic::PROPERTY_READ | BLECharacteristic::PROPERTY_WRITE_NR 78 | ); 79 | 80 | pCharacteristicA1->addDescriptor(new BLE2902()); 81 | pCharacteristicA1->addDescriptor(new BLE2901()); 82 | pCharacteristicA1->setCallbacks(new MyCallbacks()); 83 | 84 | // Start the service 85 | pServiceA->start(); 86 | 87 | // Start advertising 88 | pServer->getAdvertising()->start(); 89 | Serial.println("Waiting a client connection to notify..."); 90 | } 91 | 92 | void loop() { 93 | if (deviceConnected) { 94 | // pCharacteristicA1->notify(); 95 | delay(10); // bluetooth stack will go into congestion, if too many packets are sent 96 | } 97 | 98 | // disconnecting 99 | if (!deviceConnected && oldDeviceConnected) { 100 | delay(500); // give the bluetooth stack the chance to get things ready 101 | pServer->startAdvertising(); // restart advertising 102 | Serial.println("start advertising"); 103 | oldDeviceConnected = deviceConnected; 104 | } 105 | // connecting 106 | if (deviceConnected && !oldDeviceConnected) { 107 | // do stuff here on connecting 108 | oldDeviceConnected = deviceConnected; 109 | } 110 | } 111 | -------------------------------------------------------------------------------- /ESP32-TTGOCamera/Camera-TTGO/Camera-TTGO.ino: -------------------------------------------------------------------------------- 1 | #include "esp_camera.h" 2 | #include 3 | 4 | // 5 | // WARNING!!! PSRAM IC required for UXGA resolution and high JPEG quality 6 | // Ensure ESP32 Wrover Module or other board with PSRAM is selected 7 | // Partial images will be transmitted if image exceeds buffer size 8 | // 9 | 10 | // Select camera model 11 | //#define CAMERA_MODEL_WROVER_KIT // Has PSRAM 12 | //#define CAMERA_MODEL_ESP_EYE // Has PSRAM 13 | //#define CAMERA_MODEL_M5STACK_PSRAM // Has PSRAM 14 | //#define CAMERA_MODEL_M5STACK_V2_PSRAM // M5Camera version B Has PSRAM 15 | //#define CAMERA_MODEL_M5STACK_WIDE // Has PSRAM 16 | //#define CAMERA_MODEL_M5STACK_ESP32CAM // No PSRAM 17 | //#define CAMERA_MODEL_AI_THINKER // Has PSRAM 18 | //#define CAMERA_MODEL_TTGO_T_JOURNAL // No PSRAM 19 | #define CAMERA_MODEL_TTGO_CAMERA_PLUS // Custom camera 20 | 21 | #include "camera_pins.h" 22 | 23 | const char* ssid = "BasementElectronics"; 24 | const char* password = "AmateurHour"; 25 | 26 | void startCameraServer(); 27 | 28 | void setup() { 29 | Serial.begin(115200); 30 | Serial.setDebugOutput(true); 31 | Serial.println(); 32 | 33 | camera_config_t config; 34 | config.ledc_channel = LEDC_CHANNEL_0; 35 | config.ledc_timer = LEDC_TIMER_0; 36 | config.pin_d0 = Y2_GPIO_NUM; 37 | config.pin_d1 = Y3_GPIO_NUM; 38 | config.pin_d2 = Y4_GPIO_NUM; 39 | config.pin_d3 = Y5_GPIO_NUM; 40 | config.pin_d4 = Y6_GPIO_NUM; 41 | config.pin_d5 = Y7_GPIO_NUM; 42 | config.pin_d6 = Y8_GPIO_NUM; 43 | config.pin_d7 = Y9_GPIO_NUM; 44 | config.pin_xclk = XCLK_GPIO_NUM; 45 | config.pin_pclk = PCLK_GPIO_NUM; 46 | config.pin_vsync = VSYNC_GPIO_NUM; 47 | config.pin_href = HREF_GPIO_NUM; 48 | config.pin_sscb_sda = SIOD_GPIO_NUM; 49 | config.pin_sscb_scl = SIOC_GPIO_NUM; 50 | config.pin_pwdn = PWDN_GPIO_NUM; 51 | config.pin_reset = RESET_GPIO_NUM; 52 | config.xclk_freq_hz = 20000000; 53 | config.pixel_format = PIXFORMAT_JPEG; 54 | 55 | // if PSRAM IC present, init with UXGA resolution and higher JPEG quality 56 | // for larger pre-allocated frame buffer. 57 | if(psramFound()){ 58 | config.frame_size = FRAMESIZE_UXGA; 59 | config.jpeg_quality = 10; 60 | config.fb_count = 2; 61 | } else { 62 | config.frame_size = FRAMESIZE_SVGA; 63 | config.jpeg_quality = 12; 64 | config.fb_count = 1; 65 | } 66 | 67 | #if defined(CAMERA_MODEL_ESP_EYE) 68 | pinMode(13, INPUT_PULLUP); 69 | pinMode(14, INPUT_PULLUP); 70 | #endif 71 | 72 | // camera init 73 | esp_err_t err = esp_camera_init(&config); 74 | if (err != ESP_OK) { 75 | Serial.printf("Camera init failed with error 0x%x", err); 76 | return; 77 | } 78 | 79 | sensor_t * s = esp_camera_sensor_get(); 80 | // initial sensors are flipped vertically and colors are a bit saturated 81 | if (s->id.PID == OV3660_PID) { 82 | s->set_vflip(s, 1); // flip it back 83 | s->set_brightness(s, 1); // up the brightness just a bit 84 | s->set_saturation(s, -2); // lower the saturation 85 | } 86 | // drop down frame size for higher initial frame rate 87 | s->set_framesize(s, FRAMESIZE_QVGA); 88 | 89 | #if defined(CAMERA_MODEL_M5STACK_WIDE) || defined(CAMERA_MODEL_M5STACK_ESP32CAM) 90 | s->set_vflip(s, 1); 91 | s->set_hmirror(s, 1); 92 | #endif 93 | 94 | WiFi.begin(ssid, password); 95 | 96 | while (WiFi.status() != WL_CONNECTED) { 97 | delay(500); 98 | Serial.print("."); 99 | } 100 | Serial.println(""); 101 | Serial.println("WiFi connected"); 102 | 103 | startCameraServer(); 104 | 105 | Serial.print("Camera Ready! Use 'http://"); 106 | Serial.print(WiFi.localIP()); 107 | Serial.println("' to connect"); 108 | } 109 | 110 | void loop() { 111 | // put your main code here, to run repeatedly: 112 | delay(10000); 113 | } 114 | -------------------------------------------------------------------------------- /Electronics-555Timer/555-Timer.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-555Timer/555-Timer.fzz -------------------------------------------------------------------------------- /Electronics-555Timer/555-Timer_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-555Timer/555-Timer_bb.png -------------------------------------------------------------------------------- /Electronics-555Timer/555-Timer_schem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-555Timer/555-Timer_schem.png -------------------------------------------------------------------------------- /Electronics-555Timer/555-timer-pinout.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-555Timer/555-timer-pinout.png -------------------------------------------------------------------------------- /Electronics-DarlingtonPair/DarlingtonPair.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-DarlingtonPair/DarlingtonPair.fzz -------------------------------------------------------------------------------- /Electronics-DarlingtonPair/DarlingtonPair_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-DarlingtonPair/DarlingtonPair_bb.png -------------------------------------------------------------------------------- /Electronics-DarlingtonPair/DarlingtonPair_schem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-DarlingtonPair/DarlingtonPair_schem.png -------------------------------------------------------------------------------- /Electronics-FlashingLights/flashing_light.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-FlashingLights/flashing_light.fzz -------------------------------------------------------------------------------- /Electronics-FlashingLights/flashing_light_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-FlashingLights/flashing_light_bb.png -------------------------------------------------------------------------------- /Electronics-FlashingLights/flashing_light_schem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-FlashingLights/flashing_light_schem.png -------------------------------------------------------------------------------- /Electronics-MOSFET/MOSFET-1.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-MOSFET/MOSFET-1.fzz -------------------------------------------------------------------------------- /Electronics-MOSFET/MOSFET-1_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-MOSFET/MOSFET-1_bb.png -------------------------------------------------------------------------------- /Electronics-MOSFET/MOSFET-1_schem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-MOSFET/MOSFET-1_schem.png -------------------------------------------------------------------------------- /Electronics-MOSFET/MOSFET-2.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-MOSFET/MOSFET-2.fzz -------------------------------------------------------------------------------- /Electronics-MOSFET/MOSFET-2_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-MOSFET/MOSFET-2_bb.png -------------------------------------------------------------------------------- /Electronics-MOSFET/MOSFET-2_schem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-MOSFET/MOSFET-2_schem.png -------------------------------------------------------------------------------- /Electronics-MOSFET/MOSFET-Var/MOSFET-Var.ino: -------------------------------------------------------------------------------- 1 | const int analogInPin = A0; 2 | const int mosGatePin = 3; 3 | 4 | int inValue = 0; 5 | int outValue = 0; 6 | 7 | void setup() { 8 | Serial.begin(9600); 9 | pinMode(mosGatePin, OUTPUT); 10 | } 11 | 12 | void loop() { 13 | inValue = analogRead(analogInPin); 14 | outValue = map(inValue, 0, 1023, 0, 255); 15 | analogWrite(mosGatePin, outValue); 16 | 17 | // print the results to the serial monitor: 18 | Serial.print("input = " ); 19 | Serial.print(inValue); 20 | Serial.print("\t MOSFET = "); 21 | Serial.println(outValue); 22 | delay(250); 23 | } 24 | -------------------------------------------------------------------------------- /Electronics-MOSFET/MOSFET/MOSFET.ino: -------------------------------------------------------------------------------- 1 | const int nMOS = 3; 2 | 3 | void setup() { 4 | pinMode(nMOS, OUTPUT); 5 | pinMode(13, OUTPUT); 6 | } 7 | 8 | void loop() { 9 | digitalWrite(nMOS, HIGH); 10 | digitalWrite(13, HIGH); 11 | delay(750); 12 | digitalWrite(nMOS, LOW); 13 | digitalWrite(13, LOW); 14 | delay(750); 15 | } 16 | -------------------------------------------------------------------------------- /Electronics-MQTT/Arduino-MQTT/Arduino-MQTT.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | #include 5 | #define SERVO_CONTROL 6 6 | byte mac[] = { 0xDE, 0xAD, 0xBE, 0xEF, 0xFE, 0xED }; 7 | Servo servo; 8 | EthernetClient ethClient; 9 | // mqtt configuration 10 | const char* server = "192.168.5.10"; 11 | const char* topic = "example/pot"; 12 | const char* clientName = "com.be.arduino"; 13 | PubSubClient client(ethClient); 14 | void callback(char* topic, byte* payload, unsigned int length) { 15 | Serial.print("Message arrived ["); 16 | Serial.print(topic); 17 | Serial.print("] angle:"); 18 | String data; 19 | for (int i = 0; i < length; i++) { 20 | data += (char)payload[i]; 21 | } 22 | double angle = ((data.toInt() * 180) / 100); 23 | constrain(angle, 0, 180); 24 | servo.write((int) angle); 25 | Serial.println((int) angle); 26 | } 27 | void mqttReConnect() { 28 | while (!client.connected()) { 29 | Serial.print("Attempting MQTT connection..."); 30 | // Attempt to connect 31 | if (client.connect(clientName)) { 32 | Serial.println("connected"); 33 | client.subscribe(topic); 34 | } else { 35 | Serial.print("failed, rc="); 36 | Serial.print(client.state()); 37 | Serial.println(" try again in 5 seconds"); 38 | delay(5000); 39 | } 40 | } 41 | } 42 | void setup() 43 | { 44 | Serial.begin(9600); 45 | client.setServer(server, 1883); 46 | client.setCallback(callback); 47 | servo.attach(SERVO_CONTROL); 48 | if (Ethernet.begin(mac) == 0) { 49 | Serial.println("Failed to configure Ethernet using DHCP"); 50 | } 51 | delay(1500); // Allow the hardware to sort itself out 52 | } 53 | void loop() 54 | { 55 | if (!client.connected()) { 56 | mqttReConnect(); 57 | } 58 | client.loop(); 59 | } 60 | -------------------------------------------------------------------------------- /Electronics-MQTT/NodeMCU-MQTT/NodeMCU-MQTT.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | // Wifi configuration 4 | const char* ssid = "BasementElectronics"; 5 | const char* password = "AmateurHour"; 6 | // mqtt configuration 7 | const char* server = "192.168.5.10"; 8 | const char* topic = "example/pot"; 9 | const char* clientName = "com.be.nodemcu"; 10 | int value; 11 | int percent; 12 | String payload; 13 | WiFiClient wifiClient; 14 | PubSubClient client(wifiClient); 15 | void wifiConnect() { 16 | Serial.println(); 17 | Serial.print("Connecting to "); 18 | Serial.println(ssid); 19 | WiFi.begin(ssid, password); 20 | while (WiFi.status() != WL_CONNECTED) { 21 | delay(500); 22 | Serial.print("."); 23 | } 24 | Serial.println(""); 25 | Serial.print("WiFi connected."); 26 | Serial.print("IP address: "); 27 | Serial.println(WiFi.localIP()); 28 | if (client.connect(clientName)) { 29 | Serial.print("Connected to MQTT broker at "); 30 | Serial.print(server); 31 | Serial.print(" as "); 32 | Serial.println(clientName); 33 | Serial.print("Topic is: "); 34 | Serial.println(topic); 35 | } 36 | else { 37 | Serial.println("MQTT connect failed"); 38 | Serial.println("Will reset and try again..."); 39 | abort(); 40 | } 41 | } 42 | void mqttReConnect() { 43 | while (!client.connected()) { 44 | Serial.print("Attempting MQTT connection..."); 45 | // Attempt to connect 46 | if (client.connect(clientName)) { 47 | Serial.println("connected"); 48 | client.subscribe(topic); 49 | } else { 50 | Serial.print("failed, rc="); 51 | Serial.print(client.state()); 52 | Serial.println(" try again in 5 seconds"); 53 | delay(5000); 54 | } 55 | } 56 | } 57 | void setup() { 58 | Serial.begin(9600); 59 | client.setServer(server, 1883); 60 | wifiConnect(); 61 | delay(10); 62 | } 63 | void loop() { 64 | value = analogRead(A0); 65 | percent = (int) ((value * 100) / 1010); 66 | payload = (String) percent; 67 | if (client.connected()) { 68 | if (client.publish(topic, (char*) payload.c_str())) { 69 | Serial.print("Publish ok ("); 70 | Serial.print(payload); 71 | Serial.println(")"); 72 | } else { 73 | Serial.println("Publish failed"); 74 | } 75 | } else { 76 | mqttReConnect(); 77 | } 78 | delay(200); 79 | } 80 | -------------------------------------------------------------------------------- /Electronics-ManualLCD/LCD-Commands.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-ManualLCD/LCD-Commands.png -------------------------------------------------------------------------------- /Electronics-ManualLCD/ManualLCD-8.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-ManualLCD/ManualLCD-8.fzz -------------------------------------------------------------------------------- /Electronics-ManualLCD/ManualLCD-8_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-ManualLCD/ManualLCD-8_bb.png -------------------------------------------------------------------------------- /Electronics-ManualLCD/Show-bits.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-ManualLCD/Show-bits.png -------------------------------------------------------------------------------- /Electronics-Transistors/trans-switch.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-Transistors/trans-switch.fzz -------------------------------------------------------------------------------- /Electronics-Transistors/trans-switch_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-Transistors/trans-switch_bb.png -------------------------------------------------------------------------------- /Electronics-Transistors/trans-switch_schem.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Electronics-Transistors/trans-switch_schem.png -------------------------------------------------------------------------------- /Kit-WeatherStation/WeatherStationKit/WeatherStationKit.ino: -------------------------------------------------------------------------------- 1 | /********* 2 | Gabor Mate 3 | https://github.com/Mategm 4 | *********/ 5 | 6 | #include 7 | #include 8 | #include 9 | #include 10 | #include 11 | #include 12 | 13 | BH1750 lightMeter; 14 | Adafruit_BMP085 pressure; 15 | double baseline; // For the pressure 16 | 17 | #define ALTITUDE 87.0 // Altitude of Sarszentmiklos, Hungary, Central-Europe in meters 18 | 19 | #define SCREEN_WIDTH 128 // OLED display width, in pixels 20 | #define SCREEN_HEIGHT 64 // OLED display height, in pixels 21 | 22 | // Declaration for an SSD1306 display connected to I2C (SDA, SCL pins) SDA = D2; SCL = D1 23 | Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1); 24 | 25 | #define DHTPIN 14 // Digital pin connected to the DHT sensor as D5 26 | #define DHTTYPE DHT11 // DHT 11 27 | DHT dht(DHTPIN, DHTTYPE); 28 | 29 | void setup(){ 30 | Serial.begin(115200); 31 | if(!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Its works for my 128x64 OLED 0,96" screen 32 | Serial.println(F("SSD1306 allocation failed")); 33 | for(;;); 34 | } 35 | display.clearDisplay(); 36 | Wire.begin(); 37 | dht.begin(); 38 | 39 | lightMeter.begin(); 40 | lightMeter.configure(BH1750::CONTINUOUS_HIGH_RES_MODE_2); 41 | 42 | display.setTextSize(1); //1-8; 1 is default, not needed 43 | display.setTextColor(WHITE); // Not relevant for one or two color OLED display but needed for the code 44 | display.setCursor(0,0); //0,0 to 120,57 45 | display.println("Weather Station by!"); 46 | display.println("Mategm!"); 47 | display.display(); 48 | 49 | if (pressure.begin()){ 50 | //Serial.println("BMP180 init success"); 51 | } 52 | else{ 53 | Serial.println("BMP180 init fail\n\n"); 54 | delay(5000); 55 | while(1); // Pause forever. 56 | } 57 | delay(2000); 58 | display.clearDisplay(); 59 | } 60 | void loop() { 61 | char status; 62 | double T,P,p0,a; 63 | float h = dht.readHumidity(); 64 | float t = dht.readTemperature(); // Read temperature as Fahrenheit (isFahrenheit = true; default C as false) 65 | float l = lightMeter.readLightLevel(); 66 | 67 | // pressure 68 | p0 = pressure.readSealevelPressure(ALTITUDE); 69 | /*** 70 | status = pressure.startTemperature(); 71 | delay(status); 72 | if (status != 0) { 73 | delay(status); // Wait for the measurement to complete: 74 | status = pressure.getTemperature(T); 75 | if (status != 0) { 76 | status = pressure.startPressure(3); 77 | if (status != 0) { 78 | delay(status); 79 | status = pressure.getPressure(P,T); 80 | if (status != 0) { 81 | p0 = pressure.sealevel(P,ALTITUDE); // we're at 113 meters (Sarszentmiklos, Hungary) 82 | } 83 | } 84 | } 85 | } 86 | ***/ 87 | //Convert to string and cut de second decimal numbers 88 | String temp = String(t,1); 89 | String humi = String(h,1); 90 | String lux = String(l,1); 91 | String pres = String(p0,1); 92 | 93 | 94 | // Calculate lux and pressure position according to its number length 95 | int pad1 = (lux.length() * 6) + 19; 96 | int pad2 = (pres.length() *6) + 19; 97 | 98 | // clear the display 99 | display.clearDisplay(); 100 | 101 | // display temperature 102 | display.setTextSize(1); 103 | display.setCursor(0,0); 104 | display.print("Temperature: "); 105 | display.setCursor(85,0); 106 | display.print(temp); 107 | display.drawCircle(115, 1, 1, WHITE); // degree sign 108 | display.setCursor(118,0); // repositioning the Celsius display 109 | display.print("C"); 110 | 111 | // display humidity 112 | display.setTextSize(1); 113 | display.setCursor(0, 10); 114 | display.print("Humidity: "); 115 | display.setCursor(85,10); 116 | display.print(humi); 117 | display.print(" "); 118 | display.print("%"); 119 | 120 | // display light data 121 | display.setTextSize(1); 122 | display.setCursor(0,20); 123 | display.print("Illuminance: "); 124 | display.setCursor((SCREEN_WIDTH - pad1),20); 125 | display.print(lux); 126 | display.print(" lx"); 127 | 128 | // pressure 129 | display.setCursor(0,30); 130 | display.setTextSize(1); 131 | display.print("Pressure: "); 132 | display.setCursor((SCREEN_WIDTH - pad2),30); 133 | display.print(pres); 134 | display.print(" P"); 135 | 136 | display.display(); 137 | delay(5000); // display the values for 5 seconds before update 138 | } 139 | -------------------------------------------------------------------------------- /Onion-SubCounter/7SegShift/7SegShift.ino: -------------------------------------------------------------------------------- 1 | #include "Timer.h" //include timer library 2 | Timer t; // craete a timer object 3 | long number = 0; //declear the variables 4 | int first_digit = 0; 5 | int second_digit = 0; 6 | int third_digit = 0; 7 | int fourth_digit = 0; 8 | int timer_event = 0; 9 | int CA_1 = 12; 10 | int CA_2 = 11; 11 | int CA_3 = 10; 12 | int CA_4 = 9; 13 | int clk = 6; 14 | int latch = 5; 15 | int data = 4; 16 | int count = 0; 17 | int digits[4] ; 18 | int CAS[4] = {12, 11, 10, 9}; 19 | byte numbers[10] {B11111100, B01100000, B11011010, B11110010, B01100110, B10110110, B10111110, B11100000, B11111110, B11110110}; 20 | //byte combinations for each number 0-9 21 | void setup() { 22 | Serial.begin(9600); //serial start and pin config 23 | pinMode(CA_1, OUTPUT); 24 | pinMode(CA_2, OUTPUT); 25 | pinMode(CA_3, OUTPUT); 26 | pinMode(CA_4, OUTPUT); 27 | pinMode(clk, OUTPUT); 28 | pinMode(latch, OUTPUT); 29 | pinMode(data, OUTPUT); 30 | digitalWrite(CA_1, HIGH); 31 | digitalWrite(CA_2, HIGH); 32 | digitalWrite(CA_3, HIGH); 33 | digitalWrite(CA_4, HIGH); 34 | Serial.println("please Enter a number from 0 to 9999"); 35 | } 36 | 37 | void loop() { 38 | t.update(); //timer update 39 | if (Serial.available()) { // read from serial 40 | t.stop(timer_event); //stop timer if anythign to read 41 | cathode_high(); // blank the screen 42 | String s = Serial.readString(); //read the serail value 43 | number = (long)s.toInt(); //convert it to int 44 | if (number > 9999) { //check the number is 0-9999 45 | Serial.println("Please Enter Number Between 0 - 9999"); 46 | } else { 47 | break_number(number); 48 | timer_event = t.every(1, display_number); // start timer again 49 | } 50 | } 51 | } 52 | 53 | void break_number(long num) { // seperate the input number into 4 single digits 54 | 55 | first_digit = num / 1000; 56 | digits[0] = first_digit; 57 | 58 | int first_left = num - (first_digit * 1000); 59 | second_digit = first_left / 100; 60 | digits[1] = second_digit; 61 | int second_left = first_left - (second_digit * 100); 62 | third_digit = second_left / 10; 63 | digits[2] = third_digit; 64 | fourth_digit = second_left - (third_digit * 10); 65 | digits[3] = fourth_digit; 66 | } 67 | 68 | void display_number() { //scanning 69 | 70 | cathode_high(); //black screen 71 | digitalWrite(latch, LOW); //put the shift register to read 72 | shiftOut(data, clk, LSBFIRST, numbers[digits[count]]); //send the data 73 | digitalWrite(CAS[count], LOW); //turn on the relevent digit 74 | digitalWrite(latch, HIGH); //put the shift register to write mode 75 | count++; //count up the digit 76 | if (count == 4) { // keep the count between 0-3 77 | count = 0; 78 | } 79 | } 80 | 81 | void cathode_high() { //turn off all 4 digits 82 | digitalWrite(CA_1, HIGH); 83 | digitalWrite(CA_2, HIGH); 84 | digitalWrite(CA_3, HIGH); 85 | digitalWrite(CA_4, HIGH); 86 | } 87 | -------------------------------------------------------------------------------- /Onion-SubCounter/getstats.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import serial 4 | import requests 5 | 6 | channelID = "YouTube Channel ID" 7 | key = "Google API Key" 8 | url = "https://www.googleapis.com/youtube/v3/channels?part=statistics&id=" + channelID + "&key=" + key 9 | 10 | ser = serial.Serial('/dev/ttyS1') 11 | response = requests.get(url) 12 | data = response.json() 13 | subscribe = data[u'items'][0][u'statistics'][u'subscriberCount'] 14 | # print(subscribe) 15 | 16 | ser.write(subscribe.encode('ascii')) 17 | ser.close() -------------------------------------------------------------------------------- /Onion-SubCounter/resources.txt: -------------------------------------------------------------------------------- 1 | Project Inspiration: https://www.instructables.com/id/YouTube-Subscriber-Counter-With-ESP8266/ 2 | Find YouTube Channel ID: http://www.youtube.com/account_advanced 3 | Create API Key: https://console.developers.google.com/projectselector/apis 4 | Test Channel ID and API Key: https://www.googleapis.com/youtube/v3/channels?part=statistics&id=YouTubeChannelId&key=PutYourNewlyGeneratedKeyHere 5 | 6 | Arduino Timer Library: https://raw.githubusercontent.com/osoyoo/Osoyoo-development-kits/master/Arduino%20Libraries/Timermaster.zip -------------------------------------------------------------------------------- /Project-IRRelay/IRreceiveRemote/IRreceiveRemote.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | int IR_RECEIVE_PIN = 15; 6 | IRrecv IrReceiver(IR_RECEIVE_PIN); 7 | 8 | const char* ssid = "BasementElectronics"; 9 | const char* password = "AmateurHour"; 10 | const char* mqtt_server = "vm-apps01.in.in-works.net"; 11 | 12 | WiFiClient espClient; 13 | PubSubClient client(espClient); 14 | unsigned long lastMsg = 0; 15 | #define MSG_BUFFER_SIZE (50) 16 | char msg[MSG_BUFFER_SIZE]; 17 | int value = 0; 18 | 19 | void setup_wifi() { 20 | 21 | delay(10); 22 | // We start by connecting to a WiFi network 23 | Serial.println(); 24 | Serial.print("Connecting to "); 25 | Serial.println(ssid); 26 | 27 | WiFi.mode(WIFI_STA); 28 | WiFi.begin(ssid, password); 29 | 30 | while (WiFi.status() != WL_CONNECTED) { 31 | delay(500); 32 | Serial.print("."); 33 | } 34 | 35 | randomSeed(micros()); 36 | 37 | Serial.println(""); 38 | Serial.println("WiFi connected"); 39 | Serial.println("IP address: "); 40 | Serial.println(WiFi.localIP()); 41 | } 42 | 43 | void reconnect() { 44 | // Loop until we're reconnected 45 | while (!client.connected()) { 46 | Serial.print("Attempting MQTT connection..."); 47 | // Create a random client ID 48 | String clientId = "ESP32Client-"; 49 | clientId += String(random(0xffff), HEX); 50 | // Attempt to connect 51 | if (client.connect(clientId.c_str())) { 52 | Serial.println("connected"); 53 | } else { 54 | Serial.print("failed, rc="); 55 | Serial.print(client.state()); 56 | Serial.println(" try again in 5 seconds"); 57 | // Wait 5 seconds before retrying 58 | delay(5000); 59 | } 60 | } 61 | } 62 | 63 | 64 | void setup() { 65 | Serial.begin(115200); 66 | // Just to know which program is running on my Arduino 67 | Serial.println(F("START " __FILE__ " from " __DATE__)); 68 | 69 | setup_wifi(); 70 | client.setServer(mqtt_server, 1883); 71 | 72 | // In case the interrupt driver crashes on setup, give a clue 73 | // to the user what's going on. 74 | Serial.println("Enabling IRin"); 75 | IrReceiver.enableIRIn(); // Start the receiver 76 | 77 | Serial.print(F("Ready to receive IR signals at pin ")); 78 | Serial.println(IR_RECEIVE_PIN); 79 | } 80 | 81 | void loop() { 82 | decode_results results; 83 | unsigned long irSignal; 84 | if (!client.connected()) { 85 | reconnect(); 86 | } 87 | client.loop(); 88 | 89 | if (IrReceiver.decode(&results)) { 90 | Serial.println(); 91 | irSignal = results.value; 92 | snprintf (msg, MSG_BUFFER_SIZE, "%d", irSignal); 93 | client.publish("irSignal", msg); 94 | 95 | IrReceiver.resume(); // Receive the next value 96 | } 97 | delay(100); 98 | } 99 | -------------------------------------------------------------------------------- /Project-IRRelay/IRsendRemote/IRsendRemote.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | IRsend IrSender; 6 | 7 | const char* ssid = "BasementElectronics"; 8 | const char* password = "AmateurHour"; 9 | const char* mqtt_server = "vm-apps01.in.in-works.net"; 10 | 11 | WiFiClient espClient; 12 | PubSubClient client(espClient); 13 | 14 | void setup_wifi() { 15 | 16 | delay(10); 17 | // We start by connecting to a WiFi network 18 | Serial.println(); 19 | Serial.print("Connecting to "); 20 | Serial.println(ssid); 21 | 22 | WiFi.mode(WIFI_STA); 23 | WiFi.begin(ssid, password); 24 | 25 | while (WiFi.status() != WL_CONNECTED) { 26 | delay(500); 27 | Serial.print("."); 28 | } 29 | 30 | randomSeed(micros()); 31 | 32 | Serial.println(""); 33 | Serial.println("WiFi connected"); 34 | Serial.println("IP address: "); 35 | Serial.println(WiFi.localIP()); 36 | } 37 | 38 | void callback(char* topic, byte* payload, unsigned int length) { 39 | Serial.print("Message arrived ["); 40 | Serial.print(topic); 41 | Serial.print("] "); 42 | String messageIR; 43 | 44 | for (int i = 0; i < length; i++) { 45 | messageIR += (char)payload[i]; 46 | } 47 | 48 | // Serial.print("As a proper string: "); 49 | // Serial.println(msg); 50 | // Serial.println(atol(msg), HEX); 51 | IrSender.sendNECStandard(messageIR.toInt(), 32, 2); 52 | } 53 | 54 | void reconnect() { 55 | // Loop until we're reconnected 56 | while (!client.connected()) { 57 | Serial.print("Attempting MQTT connection..."); 58 | // Create a random client ID 59 | String clientId = "ESP32Client-"; 60 | clientId += String(random(0xffff), HEX); 61 | // Attempt to connect 62 | if (client.connect(clientId.c_str())) { 63 | Serial.println("connected"); 64 | client.subscribe("irSignal"); 65 | } else { 66 | Serial.print("failed, rc="); 67 | Serial.print(client.state()); 68 | Serial.println(" try again in 5 seconds"); 69 | // Wait 5 seconds before retrying 70 | delay(5000); 71 | } 72 | } 73 | } 74 | 75 | void setup() { 76 | Serial.begin(115200); 77 | 78 | // Just to know which program is running on my Arduino 79 | Serial.println(F("START " __FILE__ " from " __DATE__)); 80 | 81 | setup_wifi(); 82 | client.setServer(mqtt_server, 1883); 83 | client.setCallback(callback); 84 | 85 | Serial.print(F("Ready to send IR signals at pin ")); 86 | Serial.println(IR_SEND_PIN); 87 | } 88 | 89 | void loop() { 90 | if (!client.connected()) { 91 | reconnect(); 92 | } 93 | client.loop(); 94 | } 95 | -------------------------------------------------------------------------------- /Project-LEDStrip/CircuitPython/alt_colours.txt: -------------------------------------------------------------------------------- 1 | # These are different colour arrays for testing the NeoPixel LED strip 2 | 3 | # Rainbow 4 | (0,0,0),(127,127,127),(127,0,0),(127,127,0),(0,127,0),(0,127,127),(0,0,127),(127,0,127) 5 | 6 | # Christmas 7 | (127,127,127),(127,0,0),(0,127,0) 8 | 9 | # Easter 10 | (127,127,127),(127,127,0),(0,127,127),(127,0,127) 11 | 12 | # Basement Electronics 13 | (0,0,0),(26,116,188),(0,165,80) 14 | -------------------------------------------------------------------------------- /Project-LEDStrip/CircuitPython/lib/adafruit_pypixelbuf.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Project-LEDStrip/CircuitPython/lib/adafruit_pypixelbuf.mpy -------------------------------------------------------------------------------- /Project-LEDStrip/CircuitPython/lib/neopixel.mpy: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Project-LEDStrip/CircuitPython/lib/neopixel.mpy -------------------------------------------------------------------------------- /Project-LEDStrip/CircuitPython/pixel_demo.py: -------------------------------------------------------------------------------- 1 | import time 2 | import board 3 | import neopixel 4 | from random import seed 5 | from random import choice 6 | 7 | seed(5) 8 | 9 | # On CircuitPlayground Express, and boards with built in status NeoPixel -> board.NEOPIXEL 10 | # Otherwise choose an open pin connected to the Data In of the NeoPixel strip, i.e. board.D1 11 | #pixel_pin = board.NEOPIXEL 12 | pixel_pin = board.D4 13 | 14 | # On a Raspberry pi, use this instead, not all pins are supported 15 | # pixel_pin = board.D18 16 | 17 | # The number of NeoPixels 18 | num_pixels = 30 19 | 20 | # The order of the pixel colors - RGB or GRB. Some NeoPixels have red and green reversed! 21 | # For RGBW NeoPixels, simply change the ORDER to RGBW or GRBW. 22 | ORDER = neopixel.GRB 23 | 24 | pixels = neopixel.NeoPixel( 25 | pixel_pin, num_pixels, brightness=0.1, auto_write=False, pixel_order=ORDER 26 | ) 27 | 28 | # Christmas colours 29 | rgb_colours = [(0,0,0),(127,127,127),(127,0,0),(0,127,0)] 30 | 31 | def colour_cycle(wait): 32 | col_start = 0 33 | for i in range(len(rgb_colours)): 34 | col_pos = col_start 35 | col_start = (col_start + 1) % len(rgb_colours) 36 | for j in range(num_pixels): 37 | pixels[j] = rgb_colours[col_pos] 38 | col_pos = (col_pos - 1) % len(rgb_colours) 39 | pixels.show() 40 | time.sleep(wait) 41 | 42 | def colour_random(wait): 43 | for j in range(num_pixels): 44 | pixels[j] = choice(rgb_colours) 45 | pixels.show() 46 | time.sleep(wait) 47 | 48 | while True: 49 | # Select which colour function you wish to use 50 | colour_cycle(0.05) 51 | # colour_random(0.5) 52 | -------------------------------------------------------------------------------- /Project-NFC Reader/nfc-reader.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import nfc 4 | 5 | def on_startup(targets): 6 | return targets 7 | 8 | def on_connect(tag): 9 | print(tag.identifier.encode('hex_codec')) 10 | 11 | rdwr_options = { 12 | 'targets': ['106A'], 13 | 'on-startup': on_startup, 14 | 'on-connect': on_connect, 15 | } 16 | with nfc.ContactlessFrontend('tty:USB0:pn532') as clf: 17 | tag = clf.connect(rdwr=rdwr_options) 18 | if tag.ndef: 19 | print(tag.ndef.message.pretty()) -------------------------------------------------------------------------------- /Project-NFC Reader/nfc-reader2.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | import wx 3 | import wx.lib.newevent 4 | import nfc 5 | import threading 6 | from binascii import hexlify 7 | 8 | ShowCardEvent, SHOW_CARD_EVENT = wx.lib.newevent.NewEvent() 9 | GoneCardEvent, GONE_CARD_EVENT = wx.lib.newevent.NewEvent() 10 | 11 | 12 | class TagReader(threading.Thread): 13 | def __init__(self, wx_frame): 14 | super(TagReader, self).__init__(name="TagReader") 15 | self.terminate = False 16 | self.wx_frame = wx_frame 17 | 18 | def run(self): 19 | clf = nfc.ContactlessFrontend('tty:USB0:pn532') 20 | rdwr_options = { 21 | 'on-connect': self.on_tag_connect, 22 | # 'on-release': self.on_tag_release 23 | } 24 | while not self.terminate: 25 | clf.connect(rdwr=rdwr_options, terminate=lambda: self.terminate) 26 | clf.close() 27 | 28 | def on_tag_connect(self, tag): 29 | wx.PostEvent(self.wx_frame, ShowCardEvent(tag=tag)) 30 | return True 31 | 32 | def on_tag_release(self, tag): 33 | wx.PostEvent(self.wx_frame, GoneCardEvent()) 34 | 35 | 36 | class Frame(wx.Frame): 37 | def __init__(self, title): 38 | super(Frame, self).__init__(None, title=title, size=(500, 200)) 39 | self.text = wx.StaticText(wx.Panel(self), pos=(100, 100)) 40 | self.Bind(SHOW_CARD_EVENT, self.show_card_event) 41 | self.Bind(GONE_CARD_EVENT, self.gone_card_event) 42 | self.Bind(wx.EVT_CLOSE, self.close_window_event) 43 | wx.PostEvent(self, GoneCardEvent()) 44 | self.Show() 45 | 46 | def close_window_event(self, event): 47 | self.Destroy() 48 | 49 | def show_card_event(self, event): 50 | self.text.SetLabel("Card ID {}".format(hexlify(event.tag.identifier))) 51 | 52 | def gone_card_event(self, event): 53 | self.text.SetLabel("no card") 54 | 55 | 56 | app = wx.App() 57 | reader = TagReader(Frame('card reader app')) 58 | reader.start() 59 | app.MainLoop() 60 | reader.terminate = True # tell the reader to terminate 61 | reader.join() # and wait for the reader thread to finish 62 | -------------------------------------------------------------------------------- /Project-NFC Reader/punchclock/clock.py: -------------------------------------------------------------------------------- 1 | import Tkinter as tk 2 | import tkMessageBox 3 | import time 4 | import nfc 5 | 6 | import clock_db 7 | 8 | time1 = '' 9 | card_read = '' 10 | card_name = '' 11 | 12 | def scan_card(tag): 13 | global card_read, card_name 14 | # card_read = 'db4e7a3f' 15 | card_read = tag.identifier.encode('hex_codec') 16 | 17 | clock_data = clock_db.clock_db() 18 | card_name = clock_data.get_employee(card_read) 19 | clock_data.close() 20 | 21 | si_status.config(text="Scanned: " + card_name) 22 | button_frame.place(button_frame.pi) 23 | button_frame.visible = not button_frame.visible 24 | # btnToggle.place_forget() 25 | 26 | rdwr_options = { 27 | 'targets': ['106A'], 28 | 'on-connect': scan_card, 29 | } 30 | 31 | def si_message(): 32 | global card_name 33 | 34 | check_time = time.strftime('%Y-%m-%d %H:%M:%S') 35 | si_status.config(text="Signed in: " + card_name + " " + check_time) 36 | 37 | clock_data = clock_db.clock_db() 38 | card_name = clock_data.checkin(card_name, "IN", check_time) 39 | clock_data.close() 40 | 41 | hide_buttons() 42 | 43 | def so_message(): 44 | global card_name 45 | 46 | check_time = time.strftime('%Y-%m-%d %H:%M:%S') 47 | si_status.config(text="Signed out: " + card_name + " " + check_time) 48 | 49 | clock_data = clock_db.clock_db() 50 | card_name = clock_data.checkin(card_name, "OUT", check_time) 51 | clock_data.close() 52 | 53 | hide_buttons() 54 | 55 | def hide_buttons(): 56 | button_frame.place_forget() 57 | button_frame.visible = not button_frame.visible 58 | 59 | 60 | # Set up interface 61 | root = tk.Tk() 62 | root.title('Punchclock') 63 | root.attributes('-fullscreen', 1) 64 | #root.configure(background="black") 65 | 66 | # Display date and time 67 | #clock=tk.Label(root, justify = tk.CENTER, font="Helvetica 32 bold", bg="black", fg="blue") 68 | clock=tk.Label(root, justify = tk.CENTER, font="Helvetica 32 bold") 69 | clock.place(relx=0.2, rely=0.2, relwidth=0.3, relheight=0.15) 70 | def tick(): 71 | global time1 72 | # get the current local time from the PC 73 | time2 = time.strftime('%A %B %d, %Y\n%-I:%M:%S %p') 74 | # if time string has changed, update it 75 | if time2 != time1: 76 | time1 = time2 77 | clock.config(text=time2) 78 | # calls itself every 200 milliseconds 79 | # to update the time display as needed 80 | # could use >200 ms, but display gets jerky 81 | clock.after(200, tick) 82 | 83 | # Line over status 84 | #canvas = tk.Canvas(root, width=2000, height=4, borderwidth=0, highlightthickness=0, bg="black") 85 | canvas = tk.Canvas(root, width=2000, height=4, borderwidth=0, highlightthickness=0) 86 | #canvas.create_line(0,2,2000,2, fill="blue") 87 | canvas.create_line(0,2,2000,2, fill="black") 88 | canvas.place(relx=0.1, rely=0.8, relwidth=0.8, height=4) 89 | 90 | #Status line 91 | #si_status=tk.Label(root, font="Helvetica 32 bold", bg="black", fg="blue", anchor=tk.NW, text="") 92 | si_status=tk.Label(root, font="Helvetica 32 bold", anchor=tk.NW, text="") 93 | si_status.place(relx=0.15, rely=0.81, relwidth=0.70, relheight=0.1) 94 | 95 | # Signin/Signout buttons 96 | # Create bounding frame 97 | #button_frame=tk.Frame(root, height=150, width=550, bg="black") 98 | button_frame=tk.Frame(root, height=150, width=550) 99 | button_frame.visible = False 100 | button_frame.place(relx=0.25, rely=0.4, width=550, height=150) 101 | button_frame.pi = button_frame.place_info() 102 | button_frame.place_forget() 103 | 104 | # Generate buttons 105 | #btnToggle = tk.Button(text="Test Scan", command=lambda: scan_card(0)) 106 | #btnToggle.place(x=70, y=150) 107 | 108 | button_si=tk.Button(button_frame, text="Sign In", command=si_message) 109 | button_si.place(x=50, y=50, width=200, height=50) 110 | button_so=tk.Button(button_frame, text="Sign Out", command=so_message) 111 | button_so.place(x=300, y=50, width=200, height=50) 112 | 113 | tick() 114 | 115 | # Initialize card reader 116 | with nfc.ContactlessFrontend('tty:USB0:pn532') as clf: 117 | tag = clf.connect(rdwr=rdwr_options) 118 | 119 | root.mainloop() 120 | -------------------------------------------------------------------------------- /Project-NFC Reader/punchclock/clock_db.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | class clock_db: 4 | def __init__(self): 5 | self.conn = sqlite3.connect('punchclock.db') 6 | self.c = self.conn.cursor() 7 | 8 | return 9 | 10 | def generate_file(self): 11 | sql_string="CREATE TABLE employee (emp_card text, emp_name text)" 12 | self.c.execute(sql_string) 13 | self.conn.commit() 14 | 15 | sql_string="CREATE TABLE checkin (emp_name text, inout text, check_date text)" 16 | self.c.execute(sql_string) 17 | self.conn.commit() 18 | 19 | 20 | def create_employee(self, card, emp_name): 21 | sql_string="INSERT INTO employee VALUES(?,?)" 22 | sql_values=(card, emp_name) 23 | self.c.execute(sql_string, sql_values) 24 | self.conn.commit() 25 | 26 | def get_employee(self, card): 27 | sql_string="SELECT emp_name FROM employee WHERE emp_card=?" 28 | sql_values=(card, ) 29 | self.c.execute(sql_string, sql_values) 30 | emp_name = self.c.fetchone() 31 | 32 | return(emp_name[0]) 33 | 34 | def checkin(self, emp_name, inout, check_date): 35 | sql_string="INSERT INTO checkin VALUES(?,?,?)" 36 | sql_values=(emp_name, inout, check_date) 37 | self.c.execute(sql_string, sql_values) 38 | self.conn.commit() 39 | 40 | def close(self): 41 | self.conn.close() -------------------------------------------------------------------------------- /Project-NFC Reader/punchclock/create_database.py: -------------------------------------------------------------------------------- 1 | import clock_db 2 | 3 | clock_data=clock_db.clock_db() 4 | clock_data.generate_file() 5 | clock_data.create_employee('db4e7a3f', 'Curtis Ireland') 6 | clock_data.create_employee('1b4bf3dc', 'David Jones') 7 | clock_data.create_employee('2b2b07dd', 'Big Clive') 8 | clock_data.close() -------------------------------------------------------------------------------- /Project-NFC Reader/punchclock/punchclock.py: -------------------------------------------------------------------------------- 1 | import Tkinter as tk 2 | import time 3 | 4 | import clock_db 5 | 6 | class Punchclock: 7 | def __init__(self, master): 8 | 9 | self.time1 = '' 10 | self.card_read = '' 11 | self.card_name = '' 12 | 13 | self.rdwr_options = { 14 | 'targets': ['106A'], 15 | 'on-connect': lambda: scan_card(), 16 | } 17 | 18 | self.master = master 19 | master.title('Punchclock') 20 | master.attributes('-fullscreen', 1) 21 | # master.configure(background="black") 22 | 23 | self.clock=tk.Label(master, justify = tk.CENTER, font="Helvetica 32 bold") 24 | self.clock.place(relx=0.2, rely=0.2, relwidth=0.3, relheight=0.15) 25 | 26 | # Signin/Signout buttons 27 | # Create bounding frame 28 | self.button_frame=tk.Frame(master, height=150, width=550) 29 | self.button_frame.visible = True 30 | self.button_frame.place(relx=0.25, rely=0.4, width=550, height=150) 31 | self.button_frame.pi = self.button_frame.place_info() 32 | 33 | self.button_si=tk.Button(self.button_frame, text="Sign In", command=lambda: self.si_message()) 34 | self.button_si.place(x=50, y=50, width=200, height=50) 35 | self.button_so=tk.Button(self.button_frame, text="Sign Out", command=lambda: self.so_message()) 36 | self.button_so.place(x=300, y=50, width=200, height=50) 37 | 38 | 39 | # Line over status 40 | self.canvas = tk.Canvas(master, width=2000, height=4, borderwidth=0, highlightthickness=0) 41 | self.canvas.create_line(0,2,2000,2, fill="black") 42 | self.canvas.place(relx=0.1, rely=0.8, relwidth=0.8, height=4) 43 | 44 | #Status line 45 | self.si_status=tk.Label(master, font="Helvetica 32 bold", anchor=tk.NW, text="") 46 | self.si_status.place(relx=0.15, rely=0.81, relwidth=0.70, relheight=0.1) 47 | 48 | # Generate buttons 49 | #btnToggle = tk.Button(text="Test Scan", command=lambda: scan_card(0)) 50 | #btnToggle.place(x=70, y=150) 51 | 52 | self.tick() 53 | self.hide_buttons() 54 | 55 | def tick(self): 56 | # get the current local time from the PC 57 | # time2 = time.strftime('%A %B %d, %Y\n%-I:%M:%S %p') 58 | time2 = time.strftime('%A %B %d, %Y\n%H:%M:%S') 59 | 60 | # if time string has changed, update it 61 | if time2 != self.time1: 62 | self.time1 = time2 63 | self.clock.config(text=time2) 64 | 65 | # calls itself every 200 milliseconds to update the time display as needed 66 | # could use >200 ms, but display gets jerky 67 | self.clock.after(200, lambda: self.tick()) 68 | 69 | def si_message(self): 70 | check_time = time.strftime('%Y-%m-%d %H:%M:%S') 71 | self.si_status.config(text="Signed in: " + self.card_name + " " + check_time) 72 | 73 | clock_data = clock_db.clock_db() 74 | clock_data.checkin(self.card_name, "IN", check_time) 75 | clock_data.close() 76 | 77 | self.hide_buttons() 78 | 79 | def so_message(self): 80 | check_time = time.strftime('%Y-%m-%d %H:%M:%S') 81 | self.si_status.config(text="Signed out: " + self.card_name + " " + check_time) 82 | 83 | clock_data = clock_db.clock_db() 84 | clock_data.checkin(self.card_name, "OUT", check_time) 85 | clock_data.close() 86 | 87 | self.hide_buttons() 88 | 89 | def hide_buttons(self): 90 | self.button_frame.place_forget() 91 | self.button_frame.visible = not self.button_frame.visible 92 | 93 | if __name__ == '__main__': 94 | root = tk.Tk() 95 | my_punchclock = Punchclock(root) 96 | root.mainloop() -------------------------------------------------------------------------------- /Project-NFC Reader/wx-punchclock.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | cd /home/pi/wx-punchclock 4 | /usr/bin/python wx-punchclock.py 5 | -------------------------------------------------------------------------------- /Project-NFC Reader/wx-punchclock/clock_db.py: -------------------------------------------------------------------------------- 1 | import sqlite3 2 | 3 | class clock_db: 4 | def __init__(self): 5 | self.conn = sqlite3.connect('punchclock.db') 6 | self.c = self.conn.cursor() 7 | 8 | return 9 | 10 | def generate_file(self): 11 | sql_string="CREATE TABLE employee (emp_card text, emp_name text)" 12 | self.c.execute(sql_string) 13 | self.conn.commit() 14 | 15 | sql_string="CREATE TABLE checkin (emp_name text, inout text, check_date text)" 16 | self.c.execute(sql_string) 17 | self.conn.commit() 18 | 19 | 20 | def create_employee(self, card, emp_name): 21 | sql_string="INSERT INTO employee VALUES(?,?)" 22 | sql_values=(card, emp_name) 23 | self.c.execute(sql_string, sql_values) 24 | self.conn.commit() 25 | 26 | def get_employee(self, card): 27 | sql_string="SELECT emp_name FROM employee WHERE emp_card=?" 28 | sql_values=(card, ) 29 | self.c.execute(sql_string, sql_values) 30 | emp_name = self.c.fetchall() 31 | 32 | if(len(emp_name) == 0): 33 | ret_val = "" 34 | else: 35 | ret_val = emp_name[0][0] 36 | 37 | return(ret_val) 38 | 39 | def checkin(self, emp_name, inout, check_date): 40 | sql_string="INSERT INTO checkin VALUES(?,?,?)" 41 | sql_values=(emp_name, inout, check_date) 42 | self.c.execute(sql_string, sql_values) 43 | self.conn.commit() 44 | 45 | def close(self): 46 | self.conn.close() 47 | -------------------------------------------------------------------------------- /Project-NFC Reader/wx-punchclock/create_database.py: -------------------------------------------------------------------------------- 1 | import clock_db 2 | 3 | clock_data=clock_db.clock_db() 4 | clock_data.generate_file() 5 | clock_data.create_employee('db4e7a3f', 'Curtis Ireland') 6 | clock_data.create_employee('1b4bf3dc', 'David Jones') 7 | clock_data.create_employee('2b2b07dd', 'Big Clive') 8 | clock_data.close() 9 | -------------------------------------------------------------------------------- /Project-Temperature/LUA/dht-test.lua: -------------------------------------------------------------------------------- 1 | dht_pin = 2 2 | status, temp, humi, temp_dec, humi_dec = dht.read(dht_pin) 3 | if status == dht.OK then 4 | -- Integer firmware using this example 5 | print(string.format("DHT Temperature:%d.%03d;Humidity:%d.%03d\r\n", 6 | math.floor(temp), 7 | temp_dec, 8 | math.floor(humi), 9 | humi_dec 10 | )) 11 | 12 | -- Float firmware using this example 13 | print("DHT Temperature:"..temp..";".."Humidity:"..humi) 14 | 15 | elseif status == dht.ERROR_CHECKSUM then 16 | print( "DHT Checksum error." ) 17 | elseif status == dht.ERROR_TIMEOUT then 18 | print( "DHT timed out." ) 19 | end 20 | -------------------------------------------------------------------------------- /Project-Temperature/LUA/init.lua: -------------------------------------------------------------------------------- 1 | dofile('project.lua') 2 | -------------------------------------------------------------------------------- /Project-Temperature/LUA/project.lua: -------------------------------------------------------------------------------- 1 | -- setup SPI and connect display 2 | function init_spi_display() 3 | -- Hardware SPI CLK = GPIO14 4 | -- Hardware SPI MOSI = GPIO13 5 | -- Hardware SPI MISO = GPIO12 (not used) 6 | -- Hardware SPI /CS = GPIO15 (not used) 7 | -- CS, D/C, and RES can be assigned freely to available GPIOs 8 | local cs = 8 -- GPIO15, pull-down 10k to GND 9 | local dc = 4 -- GPIO2 10 | local res = 3 -- GPIO16 11 | 12 | spi.setup(1, spi.MASTER, spi.CPOL_LOW, spi.CPHA_LOW, 8, 8) 13 | -- we won't be using the HSPI /CS line, so disable it again 14 | gpio.mode(8, gpio.INPUT, gpio.PULLUP) 15 | 16 | -- initialize the matching driver for your display 17 | disp = ucg.ili9341_18x240x320_hw_spi(cs, dc, res) 18 | end 19 | 20 | function draw_screen() 21 | w = disp:getWidth(); 22 | h = disp:getHeight(); 23 | 24 | disp:setColor(255, 255, 255); 25 | disp:drawRFrame(2, 2, (w - 2), (h - 2), 0); 26 | 27 | disp:setFont(ucg.font_ncenR14_hr) 28 | disp:setColor(0, 165, 80); 29 | disp:drawString(5, (5 + 14), 0, "Temperature") 30 | disp:drawString(5, (h / 2 + (14 / 2)), 0, "Humidity") 31 | 32 | disp:setColor(192, 0, 0); 33 | disp:drawHLine(5, (5 + 14 + 4), (w - 10)) 34 | disp:drawHLine(5, (5 + 14 + 5), (w - 10)) 35 | disp:drawHLine(5, ((h / 2 + (14 / 2)) + 4), (w - 10)) 36 | disp:drawHLine(5, ((h / 2 + (14 / 2)) + 5), (w - 10)) 37 | end 38 | 39 | function show_value() 40 | w = disp:getWidth() 41 | h = disp:getHeight() 42 | 43 | status, temp, humi, temp_dec, humi_dec = dht.read(dht_pin) 44 | tem = string.format("%d.%01d", 45 | math.floor(temp), 46 | temp_dec 47 | ) 48 | hum = string.format("%d.%01d", 49 | math.floor(humi), 50 | humi_dec 51 | ) 52 | 53 | disp:setColor(0, 0, 0) 54 | disp:drawRBox((w / 2), 30, (w / 2 - 5), 18, 0) 55 | disp:drawRBox((w / 2), ((h / 2 + (14 / 2)) + 7), (w / 2 - 5), 18, 0) 56 | 57 | disp:setFont(ucg.font_helvB18_hr) 58 | disp:setColor(26, 116, 188) 59 | disp:drawString((w / 2), 48, 0, tem.." C") 60 | disp:drawString((w / 2), ((h / 2 + (14 / 2)) + 25), 0, hum.."%") 61 | 62 | end 63 | 64 | 65 | init_spi_display() 66 | 67 | disp:begin(ucg.FONT_MODE_TRANSPARENT) 68 | disp:setFont(ucg.font_ncenR14_hr) 69 | disp:clearScreen() 70 | disp:setRotate270() 71 | 72 | -- Draw initial screen 73 | draw_screen(); 74 | 75 | dht_pin = 2 76 | --show_value("20.0", "37.2"); 77 | 78 | -- change 5000 to something more sane 79 | if not tmr.create():alarm(5000, tmr.ALARM_AUTO, show_value) 80 | then 81 | print("Problem starting timer") 82 | end -------------------------------------------------------------------------------- /Project-Temperature/LUA/tmr-test.lua: -------------------------------------------------------------------------------- 1 | if not tmr.create():alarm(5000, tmr.ALARM_AUTO, function() 2 | print("hey there") 3 | end) 4 | then 5 | print("whoopsie") 6 | end 7 | -------------------------------------------------------------------------------- /Project-Temperature/RemoteTemp.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Project-Temperature/RemoteTemp.fzz -------------------------------------------------------------------------------- /Project-Temperature/RemoteTemp_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/Project-Temperature/RemoteTemp_bb.png -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Basement Electronics 2 | Code examples used in the Basement Electronics YouTube series 3 | 4 | >https://www.youtube.com/c/BasementElectronics 5 | 6 | Please consider supporting through Patreaon or Ko-Fi 7 | >https://www.patreon.com/BasementElectronics 8 | > 9 | >https://ko-fi.com/curtisireland 10 | -------------------------------------------------------------------------------- /RPi-Analog/Layout-Wiring.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi-Analog/Layout-Wiring.png -------------------------------------------------------------------------------- /RPi-Analog/RPi-Analog.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi-Analog/RPi-Analog.fzz -------------------------------------------------------------------------------- /RPi-Analog/Schematic.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi-Analog/Schematic.png -------------------------------------------------------------------------------- /RPi-Analog/adc_input.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | # Written by Limor "Ladyada" Fried for Adafruit Industries, (c) 2015 4 | # This code is released into the public domain 5 | 6 | import time 7 | import RPi.GPIO as GPIO 8 | 9 | GPIO.setmode(GPIO.BCM) 10 | GPIO.setwarnings(False) 11 | 12 | # read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7) 13 | def readadc(adcnum, clockpin, mosipin, misopin, cspin): 14 | if ((adcnum > 7) or (adcnum < 0)): 15 | return -1 16 | GPIO.output(cspin, True) 17 | 18 | GPIO.output(clockpin, False) # start clock low 19 | GPIO.output(cspin, False) # bring CS low 20 | 21 | commandout = adcnum 22 | commandout |= 0x18 # start bit + single-ended bit 23 | commandout <<= 3 # we only need to send 5 bits here 24 | for i in range(5): 25 | if (commandout & 0x80): 26 | GPIO.output(mosipin, True) 27 | else: 28 | GPIO.output(mosipin, False) 29 | commandout <<= 1 30 | GPIO.output(clockpin, True) 31 | GPIO.output(clockpin, False) 32 | 33 | adcout = 0 34 | # read in one empty bit, one null bit and 10 ADC bits 35 | for i in range(12): 36 | GPIO.output(clockpin, True) 37 | GPIO.output(clockpin, False) 38 | adcout <<= 1 39 | if (GPIO.input(misopin)): 40 | adcout |= 0x1 41 | 42 | GPIO.output(cspin, True) 43 | 44 | adcout >>= 1 # first bit is 'null' so drop it 45 | return adcout 46 | 47 | # change these as desired - they're the pins connected from the 48 | # SPI port on the ADC to the Cobbler 49 | SPICLK = 22 50 | SPIMISO = 23 51 | SPIMOSI = 24 52 | SPICS = 25 53 | 54 | # set up the SPI interface pins 55 | GPIO.setup(SPIMOSI, GPIO.OUT) 56 | GPIO.setup(SPIMISO, GPIO.IN) 57 | GPIO.setup(SPICLK, GPIO.OUT) 58 | GPIO.setup(SPICS, GPIO.OUT) 59 | 60 | # 10k trim pot connected to adc #0 61 | potentiometer_adc = 0; 62 | 63 | last_read = 0 # this keeps track of the last potentiometer value 64 | tolerance = 5 # to keep from being jittery we'll only change 65 | # volume when the pot has moved more than 5 'counts' 66 | 67 | while True: 68 | # we'll assume that the pot didn't move 69 | trim_pot_changed = False 70 | 71 | # read the analog pin 72 | trim_pot = readadc(potentiometer_adc, SPICLK, SPIMOSI, SPIMISO, SPICS) 73 | # how much has it changed since the last read? 74 | pot_adjust = abs(trim_pot - last_read) 75 | 76 | if ( pot_adjust > tolerance ): 77 | trim_pot_changed = True 78 | last_read = trim_pot 79 | 80 | if ( trim_pot_changed ): 81 | print "trim_pot_changed", trim_pot_changed 82 | print "trim_pot:", trim_pot 83 | print "pot_adjust:", pot_adjust 84 | print "last_read", last_read 85 | 86 | # hang out and do nothing for a half second 87 | time.sleep(0.5) 88 | -------------------------------------------------------------------------------- /RPi-Analog/led_pwm.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | import time 4 | import RPi.GPIO as GPIO 5 | GPIO.setmode(GPIO.BCM) 6 | GPIO.setwarnings(False) 7 | 8 | GPIO.setup(18, GPIO.OUT) 9 | 10 | p = GPIO.PWM(18, 50) # channel=18 frequency=50Hz 11 | p.start(0) 12 | try: 13 | while 1: 14 | for dc in range(0, 101, 5): 15 | p.ChangeDutyCycle(dc) 16 | time.sleep(0.1) 17 | for dc in range(100, -1, -5): 18 | p.ChangeDutyCycle(dc) 19 | time.sleep(0.1) 20 | except KeyboardInterrupt: 21 | pass 22 | p.stop() 23 | GPIO.cleanup() 24 | -------------------------------------------------------------------------------- /RPi-Analog/tune_led.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/env python 2 | 3 | import time 4 | import RPi.GPIO as GPIO 5 | 6 | GPIO.setmode(GPIO.BCM) 7 | GPIO.setwarnings(False) 8 | 9 | # read SPI data from MCP3008 chip, 8 possible adc's (0 thru 7) 10 | def readadc(adcnum, clockpin, mosipin, misopin, cspin): 11 | if ((adcnum > 7) or (adcnum < 0)): 12 | return -1 13 | GPIO.output(cspin, True) 14 | 15 | GPIO.output(clockpin, False) # start clock low 16 | GPIO.output(cspin, False) # bring CS low 17 | 18 | commandout = adcnum 19 | commandout |= 0x18 # start bit + single-ended bit 20 | commandout <<= 3 # we only need to send 5 bits here 21 | for i in range(5): 22 | if (commandout & 0x80): 23 | GPIO.output(mosipin, True) 24 | else: 25 | GPIO.output(mosipin, False) 26 | commandout <<= 1 27 | GPIO.output(clockpin, True) 28 | GPIO.output(clockpin, False) 29 | 30 | adcout = 0 31 | # read in one empty bit, one null bit and 10 ADC bits 32 | for i in range(12): 33 | GPIO.output(clockpin, True) 34 | GPIO.output(clockpin, False) 35 | adcout <<= 1 36 | if (GPIO.input(misopin)): 37 | adcout |= 0x1 38 | 39 | GPIO.output(cspin, True) 40 | 41 | adcout >>= 1 # first bit is 'null' so drop it 42 | return adcout 43 | 44 | PWMOUT = 18 45 | SPICLK = 22 46 | SPIMISO = 23 47 | SPIMOSI = 24 48 | SPICS = 25 49 | 50 | # set up the interface pins 51 | GPIO.setup(PWMOUT, GPIO.OUT) 52 | GPIO.setup(SPIMOSI, GPIO.OUT) 53 | GPIO.setup(SPIMISO, GPIO.IN) 54 | GPIO.setup(SPICLK, GPIO.OUT) 55 | GPIO.setup(SPICS, GPIO.OUT) 56 | 57 | # 10k trim pot connected to adc #0 58 | potentiometer_adc = 0; 59 | pwm_freq = 50 # Set the PWM frequency to 50 Hz 60 | last_read = 0 # this keeps track of the last potentiometer value 61 | tolerance = 5 # to keep from being jittery we'll only change 62 | # volume when the pot has moved more than 5 'counts' 63 | 64 | # Configure the PWM pin 65 | p = GPIO.PWM(PWMOUT, pwm_freq) # channel=18 frequency=50Hz 66 | p.start(0) 67 | 68 | try: 69 | while True: 70 | # we'll assume that the pot didn't move 71 | trim_pot_changed = False 72 | 73 | # read the analog pin 74 | trim_pot = readadc(potentiometer_adc, SPICLK, SPIMOSI, SPIMISO, SPICS) 75 | # how much has it changed since the last read? 76 | pot_adjust = abs(trim_pot - last_read) 77 | 78 | if ( pot_adjust > tolerance ): 79 | trim_pot_changed = True 80 | last_read = trim_pot 81 | 82 | if ( trim_pot_changed ): 83 | pwm_pct = round(trim_pot / 10.24) # Determine current voltage percentage 84 | pwm_pct = int(pwm_pct) # Cast the value as an integer 85 | 86 | print "ADC read: ", trim_pot 87 | print "PWM percentage: ", pwm_pct 88 | p.ChangeDutyCycle(pwm_pct) 89 | 90 | # hang out and do nothing for a half second 91 | time.sleep(0.5) 92 | except KeyboardInterrupt: 93 | pass 94 | 95 | p.stop() 96 | GPIO.cleanup() 97 | -------------------------------------------------------------------------------- /RPi-Buttons/button.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # import needed python libraries 4 | import RPi.GPIO as GPIO 5 | 6 | # General Raspberry Pi Settings 7 | GPIO.setmode(GPIO.BCM) 8 | GPIO.setwarnings(False) 9 | 10 | # Configure GPIO pin 21 for OUTPUT 11 | GPIO.setup(20,GPIO.IN) 12 | GPIO.setup(21,GPIO.OUT) 13 | 14 | while True: 15 | if (GPIO.input(20)): 16 | GPIO.output(21,GPIO.HIGH) 17 | else: 18 | GPIO.output(21,GPIO.LOW) 19 | 20 | # Reset Raspberry Pi GPIO 21 | GPIO.cleanup 22 | -------------------------------------------------------------------------------- /RPi-CharDisp/Character Display.fzz: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi-CharDisp/Character Display.fzz -------------------------------------------------------------------------------- /RPi-CharDisp/CharacterDisplay_bb.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi-CharDisp/CharacterDisplay_bb.png -------------------------------------------------------------------------------- /RPi-CharDisp/DateTime.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from Adafruit_CharLCD import Adafruit_CharLCD 4 | from time import sleep, strftime 5 | from datetime import datetime 6 | 7 | lcd = Adafruit_CharLCD() 8 | lcd.begin(16, 1) 9 | 10 | 11 | lcd.clear() 12 | d = datetime.now() 13 | 14 | lcd.message(d.strftime('%b. %d, %Y\n')) 15 | lcd.message(d.strftime('%I:%M:%S %p')) 16 | -------------------------------------------------------------------------------- /RPi-CharDisp/HelloWorldLCD.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from Adafruit_CharLCD import Adafruit_CharLCD 4 | 5 | lcd = Adafruit_CharLCD() 6 | 7 | lcd.begin(16, 1) 8 | 9 | 10 | lcd.clear() 11 | lcd.message('Hello World\n') 12 | lcd.message('From Me') 13 | -------------------------------------------------------------------------------- /RPi-CharDisp/clear.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | from Adafruit_CharLCD import Adafruit_CharLCD 4 | 5 | lcd = Adafruit_CharLCD() 6 | lcd.begin(16, 1) 7 | 8 | 9 | lcd.clear() 10 | -------------------------------------------------------------------------------- /RPi-FirstStart/led1.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # import needed python libraries 4 | import time 5 | import RPi.GPIO as GPIO 6 | 7 | # General Raspberry Pi Settings 8 | GPIO.setmode(GPIO.BCM) 9 | GPIO.setwarnings(False) 10 | 11 | # Configure GPIO pin 21 for OUTPUT 12 | GPIO.setup(21,GPIO.OUT) 13 | 14 | # Turn LED on 15 | GPIO.output(21,GPIO.HIGH) 16 | 17 | # Wait one second 18 | time.sleep(1) 19 | 20 | # Turn LED off 21 | GPIO.output(21,GPIO.LOW) 22 | 23 | # Reset Raspberry Pi GPIO 24 | GPIO.cleanup 25 | -------------------------------------------------------------------------------- /RPi-FirstStart/led_repeat.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python 2 | 3 | # import needed python libraries 4 | import time 5 | import RPi.GPIO as GPIO 6 | 7 | # General Raspberry Pi Settings 8 | GPIO.setmode(GPIO.BCM) 9 | GPIO.setwarnings(False) 10 | 11 | # Configure GPIO pin 21 for OUTPUT 12 | GPIO.setup(21,GPIO.OUT) 13 | 14 | # Repeat endlessly 15 | while 1: 16 | # Turn LED on 17 | GPIO.output(21,GPIO.HIGH) 18 | 19 | # Wait one second 20 | time.sleep(1) 21 | 22 | # Turn LED off 23 | GPIO.output(21,GPIO.LOW) 24 | 25 | # Wait one second 26 | time.sleep(1) 27 | -------------------------------------------------------------------------------- /RPi3-TestResults/pts-results-viewer/background-pattern.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi3-TestResults/pts-results-viewer/background-pattern.png -------------------------------------------------------------------------------- /RPi3-TestResults/pts-results-viewer/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi3-TestResults/pts-results-viewer/favicon.ico -------------------------------------------------------------------------------- /RPi3-TestResults/pts-results-viewer/horizontal-nav-bg-hover.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi3-TestResults/pts-results-viewer/horizontal-nav-bg-hover.png -------------------------------------------------------------------------------- /RPi3-TestResults/pts-results-viewer/horizontal-nav-bg.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi3-TestResults/pts-results-viewer/horizontal-nav-bg.png -------------------------------------------------------------------------------- /RPi3-TestResults/pts-results-viewer/pts-106x55.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi3-TestResults/pts-results-viewer/pts-106x55.png -------------------------------------------------------------------------------- /RPi3-TestResults/pts-results-viewer/pts-logo-bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi3-TestResults/pts-results-viewer/pts-logo-bottom.png -------------------------------------------------------------------------------- /RPi3-TestResults/pts-results-viewer/pts-logo-top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/CurtisIreland/electronics/012752f9d1e01dad38ea1bbe1341343d86a57253/RPi3-TestResults/pts-results-viewer/pts-logo-top.png -------------------------------------------------------------------------------- /RPi3-TestResults/pts-results-viewer/pts.js: -------------------------------------------------------------------------------- 1 | 2 | function switchShow(i) 3 | { 4 | if(document.getElementById(i).style.display == "none") 5 | showObject(i); 6 | else 7 | hideObject(i); 8 | } 9 | function hideObject(i) 10 | { 11 | document.getElementById(i).style.display = "none"; 12 | } 13 | function showObject(i) 14 | { 15 | document.getElementById(i).style.display = "block"; 16 | } 17 | function setImagesFromURL() 18 | { 19 | var html = ""; 20 | var pf = location.href; 21 | pf = pf.substring(pf.search(/#/) + 1); 22 | var imgarray = pf.split(","); 23 | 24 | for(i = 0; i < imgarray.length; i++) 25 | { 26 | var exsplit = imgarray[i].split("."); 27 | 28 | if(exsplit[1] == "svg") 29 | html += "

"; 30 | else 31 | html += "

"; 32 | } 33 | 34 | document.getElementById("pts_monitor").innerHTML = html; 35 | } 36 | function boldBodyComponents() 37 | { 38 | var el = document.getElementsByName('pts_column_body'); 39 | 40 | for(var i = 0; i < el.length; i++) 41 | { 42 | el[i].innerHTML = el[i].innerHTML.replace(/:/, ":"); 43 | el[i].innerHTML = el[i].innerHTML.replace(/,/, ", "); 44 | el[i].innerHTML = "" + el[i].innerHTML; 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/index.html: -------------------------------------------------------------------------------- 1 | Phoronix Test Suite -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/result-graphs/8_table.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | GraphicsMagick 16 | Sharpen 17 | 18 | Results 19 | rpi2-cpu-test 20 | 9 21 | 22 | 23 | 24 | PHORONIX-TEST-SUITE.COM 25 | 26 | 27 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/result-graphs/9_table.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | GraphicsMagick 16 | Resizing 17 | 18 | Results 19 | rpi2-cpu-test 20 | 15 21 | 22 | 23 | 24 | PHORONIX-TEST-SUITE.COM 25 | 26 | 27 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/cc: -------------------------------------------------------------------------------- 1 | Using built-in specs. 2 | COLLECT_GCC=./cc 3 | COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper 4 | Target: arm-linux-gnueabihf 5 | Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf 6 | Thread model: posix 7 | gcc version 4.9.2 (Raspbian 4.9.2-10) 8 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/cmdline: -------------------------------------------------------------------------------- 1 | dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2709.boardrev=0xa01041 bcm2709.serial=0x1c23e976 smsc95xx.macaddr=B8:27:EB:23:E9:76 bcm2708_fb.fbswap=1 bcm2709.uart_clock=3000000 bcm2709.disk_led_gpio=47 bcm2709.disk_led_active_low=0 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=ttyAMA0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait 2 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/cpuinfo: -------------------------------------------------------------------------------- 1 | processor : 0 2 | model name : ARMv7 Processor rev 5 (v7l) 3 | BogoMIPS : 57.60 4 | Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 5 | CPU implementer : 0x41 6 | CPU architecture: 7 7 | CPU variant : 0x0 8 | CPU part : 0xc07 9 | CPU revision : 5 10 | 11 | processor : 1 12 | model name : ARMv7 Processor rev 5 (v7l) 13 | BogoMIPS : 57.60 14 | Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 15 | CPU implementer : 0x41 16 | CPU architecture: 7 17 | CPU variant : 0x0 18 | CPU part : 0xc07 19 | CPU revision : 5 20 | 21 | processor : 2 22 | model name : ARMv7 Processor rev 5 (v7l) 23 | BogoMIPS : 57.60 24 | Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 25 | CPU implementer : 0x41 26 | CPU architecture: 7 27 | CPU variant : 0x0 28 | CPU part : 0xc07 29 | CPU revision : 5 30 | 31 | processor : 3 32 | model name : ARMv7 Processor rev 5 (v7l) 33 | BogoMIPS : 57.60 34 | Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm 35 | CPU implementer : 0x41 36 | CPU architecture: 7 37 | CPU variant : 0x0 38 | CPU part : 0xc07 39 | CPU revision : 5 40 | 41 | Hardware : BCM2709 42 | Revision : a01041 43 | Serial : 000000001c23e976 44 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/dmidecode: -------------------------------------------------------------------------------- 1 | # dmidecode 2.12 2 | # No SMBIOS nor DMI entry point found, sorry. 3 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/environment-variables: -------------------------------------------------------------------------------- 1 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 2 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/lscpu: -------------------------------------------------------------------------------- 1 | Architecture: armv7l 2 | Byte Order: Little Endian 3 | CPU(s): 4 4 | On-line CPU(s) list: 0-3 5 | Thread(s) per core: 1 6 | Core(s) per socket: 4 7 | Socket(s): 1 8 | Model name: ARMv7 Processor rev 5 (v7l) 9 | CPU max MHz: 900.0000 10 | CPU min MHz: 600.0000 11 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/lsmod: -------------------------------------------------------------------------------- 1 | Module Size Used by 2 | cfg80211 389253 0 3 | rfkill 16036 1 cfg80211 4 | joydev 9024 0 5 | evdev 10278 4 6 | snd_bcm2835 19802 3 7 | bcm2835_gpiomem 2860 0 8 | snd_pcm 73442 1 snd_bcm2835 9 | snd_timer 18792 1 snd_pcm 10 | bcm2835_rng 1763 0 11 | i2c_bcm2708 4920 0 12 | spi_bcm2835 7074 0 13 | snd 50779 9 snd_bcm2835,snd_timer,snd_pcm 14 | uio_pdrv_genirq 2944 0 15 | uio 7753 1 uio_pdrv_genirq 16 | i2c_dev 5671 0 17 | fuse 80694 3 18 | ipv6 338574 30 19 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/lsusb: -------------------------------------------------------------------------------- 1 | Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver 2 | Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter 3 | Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 4 | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 5 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/meminfo: -------------------------------------------------------------------------------- 1 | MemTotal: 948060 kB 2 | MemFree: 231024 kB 3 | MemAvailable: 813412 kB 4 | Buffers: 21284 kB 5 | Cached: 585424 kB 6 | SwapCached: 0 kB 7 | Active: 455556 kB 8 | Inactive: 228568 kB 9 | Active(anon): 12636 kB 10 | Inactive(anon): 72860 kB 11 | Active(file): 442920 kB 12 | Inactive(file): 155708 kB 13 | Unevictable: 0 kB 14 | Mlocked: 0 kB 15 | SwapTotal: 102396 kB 16 | SwapFree: 102340 kB 17 | Dirty: 684 kB 18 | Writeback: 0 kB 19 | AnonPages: 77528 kB 20 | Mapped: 35244 kB 21 | Shmem: 7968 kB 22 | Slab: 17564 kB 23 | SReclaimable: 8476 kB 24 | SUnreclaim: 9088 kB 25 | KernelStack: 1376 kB 26 | PageTables: 2572 kB 27 | NFS_Unstable: 0 kB 28 | Bounce: 0 kB 29 | WritebackTmp: 0 kB 30 | CommitLimit: 576424 kB 31 | Committed_AS: 681540 kB 32 | VmallocTotal: 1105920 kB 33 | VmallocUsed: 4228 kB 34 | VmallocChunk: 860716 kB 35 | CmaTotal: 8192 kB 36 | CmaFree: 3668 kB 37 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/modules: -------------------------------------------------------------------------------- 1 | cfg80211 389253 0 - Live 0x7f128000 2 | rfkill 16036 1 cfg80211, Live 0x7f11f000 3 | joydev 9024 0 - Live 0x7f118000 4 | evdev 10278 4 - Live 0x7f111000 5 | snd_bcm2835 19802 3 - Live 0x7f107000 6 | bcm2835_gpiomem 2860 0 - Live 0x7f103000 7 | snd_pcm 73442 1 snd_bcm2835, Live 0x7f0e6000 8 | snd_timer 18792 1 snd_pcm, Live 0x7f0dc000 9 | bcm2835_rng 1763 0 - Live 0x7f0d8000 10 | i2c_bcm2708 4920 0 - Live 0x7f0d3000 11 | spi_bcm2835 7074 0 - Live 0x7f0ce000 12 | snd 50779 9 snd_bcm2835,snd_pcm,snd_timer, Live 0x7f0b7000 13 | uio_pdrv_genirq 2944 0 - Live 0x7f0a7000 14 | uio 7753 1 uio_pdrv_genirq, Live 0x7f08f000 15 | i2c_dev 5671 0 - Live 0x7f08a000 16 | fuse 80694 3 - Live 0x7f06d000 17 | ipv6 338574 30 [permanent], Live 0x7f000000 18 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/mounts: -------------------------------------------------------------------------------- 1 | /dev/root / ext4 rw,noatime,data=ordered 0 0 2 | devtmpfs /dev devtmpfs rw,relatime,size=469708k,nr_inodes=117427,mode=755 0 0 3 | sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 4 | proc /proc proc rw,relatime 0 0 5 | tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 6 | devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 7 | tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0 8 | tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0 9 | tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0 10 | cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 11 | cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 12 | cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0 13 | cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 14 | cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 15 | cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 16 | cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0 17 | systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 18 | mqueue /dev/mqueue mqueue rw,relatime 0 0 19 | debugfs /sys/kernel/debug debugfs rw,relatime 0 0 20 | fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0 21 | configfs /sys/kernel/config configfs rw,relatime 0 0 22 | /dev/mmcblk0p6 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 0 23 | tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=94808k,mode=700,uid=1000,gid=1000 0 0 24 | gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0 25 | /dev/mmcblk0p5 /media/pi/SETTINGS ext4 rw,nosuid,nodev,relatime,data=ordered 0 0 26 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/scaling_available_frequencies: -------------------------------------------------------------------------------- 1 | 600000 900000 2 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/uname: -------------------------------------------------------------------------------- 1 | Linux raspberrypi 4.1.18-v7+ #846 SMP Thu Feb 25 14:22:53 GMT 2016 armv7l GNU/Linux 2 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-cpu-test/system-logs/rpi2-cpu-test/version: -------------------------------------------------------------------------------- 1 | Linux version 4.1.18-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #846 SMP Thu Feb 25 14:22:53 GMT 2016 2 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi2-rpi3-merge/index.html: -------------------------------------------------------------------------------- 1 | Phoronix Test Suite -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/index.html: -------------------------------------------------------------------------------- 1 | Phoronix Test Suite -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/result-graphs/17_table.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | OpenSSL 15 | RSA 4096-bit Performance 16 | 17 | Results 18 | rpi3-cpu-test 19 | 11.10 20 | 21 | 22 | 23 | PHORONIX-TEST-SUITE.COM 24 | 25 | 26 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/result-graphs/4_table.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | John The Ripper 16 | Blowfish 17 | 18 | Results 19 | rpi3-cpu-test 20 | 316 21 | 22 | 23 | 24 | PHORONIX-TEST-SUITE.COM 25 | 26 | 27 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/result-graphs/7_table.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | GraphicsMagick 16 | Sharpen 17 | 18 | Results 19 | rpi3-cpu-test 20 | 10 21 | 22 | 23 | 24 | PHORONIX-TEST-SUITE.COM 25 | 26 | 27 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/result-graphs/8_table.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | GraphicsMagick 16 | Resizing 17 | 18 | Results 19 | rpi3-cpu-test 20 | 16 21 | 22 | 23 | 24 | PHORONIX-TEST-SUITE.COM 25 | 26 | 27 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/cc: -------------------------------------------------------------------------------- 1 | Using built-in specs. 2 | COLLECT_GCC=./cc 3 | COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.9/lto-wrapper 4 | Target: arm-linux-gnueabihf 5 | Configured with: ../src/configure -v --with-pkgversion='Raspbian 4.9.2-10' --with-bugurl=file:///usr/share/doc/gcc-4.9/README.Bugs --enable-languages=c,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.9 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.9 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --disable-libitm --disable-libquadmath --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-4.9-armhf --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-4.9-armhf --with-arch-directory=arm --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-sjlj-exceptions --with-arch=armv6 --with-fpu=vfp --with-float=hard --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf 6 | Thread model: posix 7 | gcc version 4.9.2 (Raspbian 4.9.2-10) 8 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/cmdline: -------------------------------------------------------------------------------- 1 | 8250.nr_uarts=1 dma.dmachans=0x7f35 bcm2708_fb.fbwidth=1824 bcm2708_fb.fbheight=984 bcm2709.boardrev=0xa22082 bcm2709.serial=0x66ef1040 smsc95xx.macaddr=B8:27:EB:EF:10:40 bcm2708_fb.fbswap=1 bcm2709.uart_clock=48000000 vc_mem.mem_base=0x3dc00000 vc_mem.mem_size=0x3f000000 dwc_otg.lpm_enable=0 console=ttyS0,115200 console=tty1 root=/dev/mmcblk0p7 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait 2 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/cpuinfo: -------------------------------------------------------------------------------- 1 | processor : 0 2 | model name : ARMv7 Processor rev 4 (v7l) 3 | BogoMIPS : 76.80 4 | Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 5 | CPU implementer : 0x41 6 | CPU architecture: 7 7 | CPU variant : 0x0 8 | CPU part : 0xd03 9 | CPU revision : 4 10 | 11 | processor : 1 12 | model name : ARMv7 Processor rev 4 (v7l) 13 | BogoMIPS : 76.80 14 | Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 15 | CPU implementer : 0x41 16 | CPU architecture: 7 17 | CPU variant : 0x0 18 | CPU part : 0xd03 19 | CPU revision : 4 20 | 21 | processor : 2 22 | model name : ARMv7 Processor rev 4 (v7l) 23 | BogoMIPS : 76.80 24 | Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 25 | CPU implementer : 0x41 26 | CPU architecture: 7 27 | CPU variant : 0x0 28 | CPU part : 0xd03 29 | CPU revision : 4 30 | 31 | processor : 3 32 | model name : ARMv7 Processor rev 4 (v7l) 33 | BogoMIPS : 76.80 34 | Features : half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm crc32 35 | CPU implementer : 0x41 36 | CPU architecture: 7 37 | CPU variant : 0x0 38 | CPU part : 0xd03 39 | CPU revision : 4 40 | 41 | Hardware : BCM2709 42 | Revision : a22082 43 | Serial : 0000000066ef1040 44 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/dmidecode: -------------------------------------------------------------------------------- 1 | # dmidecode 2.12 2 | # No SMBIOS nor DMI entry point found, sorry. 3 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/environment-variables: -------------------------------------------------------------------------------- 1 | PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 2 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/glxinfo: -------------------------------------------------------------------------------- 1 | Error: unable to open display 2 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/lscpu: -------------------------------------------------------------------------------- 1 | Architecture: armv7l 2 | Byte Order: Little Endian 3 | CPU(s): 4 4 | On-line CPU(s) list: 0-3 5 | Thread(s) per core: 1 6 | Core(s) per socket: 4 7 | Socket(s): 1 8 | Model name: ARMv7 Processor rev 4 (v7l) 9 | CPU max MHz: 1200.0000 10 | CPU min MHz: 600.0000 11 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/lsmod: -------------------------------------------------------------------------------- 1 | Module Size Used by 2 | i2c_bcm2708 4920 0 3 | bnep 10336 2 4 | hci_uart 13533 1 5 | btbcm 4196 1 hci_uart 6 | bluetooth 317981 22 bnep,btbcm,hci_uart 7 | brcmfmac 177546 0 8 | brcmutil 5501 1 brcmfmac 9 | evdev 10278 4 10 | joydev 9024 0 11 | cfg80211 389253 1 brcmfmac 12 | rfkill 16036 4 cfg80211,bluetooth 13 | snd_bcm2835 19802 3 14 | snd_pcm 73442 1 snd_bcm2835 15 | bcm2835_gpiomem 2860 0 16 | bcm2835_rng 1763 0 17 | snd_timer 18792 1 snd_pcm 18 | snd 50779 9 snd_bcm2835,snd_timer,snd_pcm 19 | uio_pdrv_genirq 2944 0 20 | uio 7753 1 uio_pdrv_genirq 21 | i2c_dev 5671 0 22 | fuse 80694 3 23 | ipv6 338574 30 24 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/lsusb: -------------------------------------------------------------------------------- 1 | Bus 001 Device 004: ID 046d:c52b Logitech, Inc. Unifying Receiver 2 | Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. SMSC9512/9514 Fast Ethernet Adapter 3 | Bus 001 Device 002: ID 0424:9514 Standard Microsystems Corp. 4 | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub 5 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/meminfo: -------------------------------------------------------------------------------- 1 | MemTotal: 948056 kB 2 | MemFree: 229808 kB 3 | MemAvailable: 717900 kB 4 | Buffers: 17252 kB 5 | Cached: 568968 kB 6 | SwapCached: 408 kB 7 | Active: 441440 kB 8 | Inactive: 237736 kB 9 | Active(anon): 1544 kB 10 | Inactive(anon): 174512 kB 11 | Active(file): 439896 kB 12 | Inactive(file): 63224 kB 13 | Unevictable: 0 kB 14 | Mlocked: 0 kB 15 | SwapTotal: 102396 kB 16 | SwapFree: 72 kB 17 | Dirty: 636 kB 18 | Writeback: 0 kB 19 | AnonPages: 92516 kB 20 | Mapped: 105524 kB 21 | Shmem: 83132 kB 22 | Slab: 22216 kB 23 | SReclaimable: 10904 kB 24 | SUnreclaim: 11312 kB 25 | KernelStack: 1624 kB 26 | PageTables: 3756 kB 27 | NFS_Unstable: 0 kB 28 | Bounce: 0 kB 29 | WritebackTmp: 0 kB 30 | CommitLimit: 576424 kB 31 | Committed_AS: 1055412 kB 32 | VmallocTotal: 1105920 kB 33 | VmallocUsed: 4236 kB 34 | VmallocChunk: 849988 kB 35 | CmaTotal: 8192 kB 36 | CmaFree: 3328 kB 37 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/modules: -------------------------------------------------------------------------------- 1 | i2c_bcm2708 4920 0 - Live 0x7f341000 2 | bnep 10336 2 - Live 0x7f335000 3 | hci_uart 13533 1 - Live 0x7f32d000 4 | btbcm 4196 1 hci_uart, Live 0x7f328000 5 | bluetooth 317981 22 bnep,hci_uart,btbcm, Live 0x7f2c7000 6 | brcmfmac 177546 0 - Live 0x7f251000 7 | brcmutil 5501 1 brcmfmac, Live 0x7f245000 8 | evdev 10278 4 - Live 0x7f23b000 9 | joydev 9024 0 - Live 0x7f237000 10 | cfg80211 389253 1 brcmfmac, Live 0x7f119000 11 | rfkill 16036 4 bluetooth,cfg80211, Live 0x7f107000 12 | snd_bcm2835 19802 3 - Live 0x7f0fd000 13 | snd_pcm 73442 1 snd_bcm2835, Live 0x7f0e0000 14 | bcm2835_gpiomem 2860 0 - Live 0x7f0dc000 15 | bcm2835_rng 1763 0 - Live 0x7f0d8000 16 | snd_timer 18792 1 snd_pcm, Live 0x7f0ce000 17 | snd 50779 9 snd_bcm2835,snd_pcm,snd_timer, Live 0x7f0b7000 18 | uio_pdrv_genirq 2944 0 - Live 0x7f0a7000 19 | uio 7753 1 uio_pdrv_genirq, Live 0x7f08f000 20 | i2c_dev 5671 0 - Live 0x7f08a000 21 | fuse 80694 3 - Live 0x7f06d000 22 | ipv6 338574 30 [permanent], Live 0x7f000000 23 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/mounts: -------------------------------------------------------------------------------- 1 | /dev/root / ext4 rw,noatime,data=ordered 0 0 2 | devtmpfs /dev devtmpfs rw,relatime,size=469708k,nr_inodes=117427,mode=755 0 0 3 | sysfs /sys sysfs rw,nosuid,nodev,noexec,relatime 0 0 4 | proc /proc proc rw,relatime 0 0 5 | tmpfs /dev/shm tmpfs rw,nosuid,nodev 0 0 6 | devpts /dev/pts devpts rw,nosuid,noexec,relatime,gid=5,mode=620,ptmxmode=000 0 0 7 | tmpfs /run tmpfs rw,nosuid,nodev,mode=755 0 0 8 | tmpfs /run/lock tmpfs rw,nosuid,nodev,noexec,relatime,size=5120k 0 0 9 | tmpfs /sys/fs/cgroup tmpfs ro,nosuid,nodev,noexec,mode=755 0 0 10 | cgroup /sys/fs/cgroup/systemd cgroup rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/lib/systemd/systemd-cgroups-agent,name=systemd 0 0 11 | cgroup /sys/fs/cgroup/cpuset cgroup rw,nosuid,nodev,noexec,relatime,cpuset 0 0 12 | cgroup /sys/fs/cgroup/cpu,cpuacct cgroup rw,nosuid,nodev,noexec,relatime,cpu,cpuacct 0 0 13 | cgroup /sys/fs/cgroup/blkio cgroup rw,nosuid,nodev,noexec,relatime,blkio 0 0 14 | cgroup /sys/fs/cgroup/devices cgroup rw,nosuid,nodev,noexec,relatime,devices 0 0 15 | cgroup /sys/fs/cgroup/freezer cgroup rw,nosuid,nodev,noexec,relatime,freezer 0 0 16 | cgroup /sys/fs/cgroup/net_cls cgroup rw,nosuid,nodev,noexec,relatime,net_cls 0 0 17 | systemd-1 /proc/sys/fs/binfmt_misc autofs rw,relatime,fd=22,pgrp=1,timeout=300,minproto=5,maxproto=5,direct 0 0 18 | mqueue /dev/mqueue mqueue rw,relatime 0 0 19 | debugfs /sys/kernel/debug debugfs rw,relatime 0 0 20 | fusectl /sys/fs/fuse/connections fusectl rw,relatime 0 0 21 | configfs /sys/kernel/config configfs rw,relatime 0 0 22 | /dev/mmcblk0p6 /boot vfat rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,errors=remount-ro 0 0 23 | tmpfs /run/user/1000 tmpfs rw,nosuid,nodev,relatime,size=94808k,mode=700,uid=1000,gid=1000 0 0 24 | gvfsd-fuse /run/user/1000/gvfs fuse.gvfsd-fuse rw,nosuid,nodev,relatime,user_id=1000,group_id=1000 0 0 25 | /dev/mmcblk0p5 /media/pi/SETTINGS ext4 rw,nosuid,nodev,relatime,data=ordered 0 0 26 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/scaling_available_frequencies: -------------------------------------------------------------------------------- 1 | 600000 1200000 2 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/uname: -------------------------------------------------------------------------------- 1 | Linux raspberrypi 4.1.18-v7+ #846 SMP Thu Feb 25 14:22:53 GMT 2016 armv7l GNU/Linux 2 | -------------------------------------------------------------------------------- /RPi3-TestResults/rpi3-cpu-test/system-logs/rpi3-cpu-test/version: -------------------------------------------------------------------------------- 1 | Linux version 4.1.18-v7+ (dc4@dc4-XPS13-9333) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611) ) #846 SMP Thu Feb 25 14:22:53 GMT 2016 2 | -------------------------------------------------------------------------------- /Review - IoTaaP/IRreceiveRemoteSSL/IRreceiveRemoteSSL.ino: -------------------------------------------------------------------------------- 1 | /***************************************** 2 | * This application uses IoTaaP Cloud 3 | * for its MQTTS service 4 | * 5 | * Sign up at https://console.iotaap.io/ 6 | * to create an account and MQTTS service 7 | * 8 | * This uses IRremote library version 2.8.0. 9 | * Later version will not work 10 | */ 11 | 12 | #include 13 | #include 14 | #include 15 | 16 | int IR_RECEIVE_PIN = 15; 17 | IRrecv IrReceiver(IR_RECEIVE_PIN); 18 | 19 | const char* ssid = "WIFI_SSID"; 20 | const char* password = "WIFI_PASS"; 21 | const char* mqtt_server = ""; 22 | const int mqtt_port = 8883; 23 | const char* mqtt_user = ""; 24 | const char* mqtt_pass = ""; 25 | 26 | WiFiClientSecure espClient; 27 | PubSubClient client(espClient); 28 | unsigned long lastMsg = 0; 29 | #define MSG_BUFFER_SIZE (50) 30 | char msg[MSG_BUFFER_SIZE]; 31 | int value = 0; 32 | 33 | void setup_wifi() { 34 | 35 | delay(10); 36 | // We start by connecting to a WiFi network 37 | Serial.println(); 38 | Serial.print("Connecting to "); 39 | Serial.println(ssid); 40 | 41 | WiFi.mode(WIFI_STA); 42 | WiFi.begin(ssid, password); 43 | 44 | while (WiFi.status() != WL_CONNECTED) { 45 | delay(500); 46 | Serial.print("."); 47 | } 48 | 49 | randomSeed(micros()); 50 | 51 | Serial.println(""); 52 | Serial.println("WiFi connected"); 53 | Serial.println("IP address: "); 54 | Serial.println(WiFi.localIP()); 55 | } 56 | 57 | void reconnect() { 58 | // Loop until we're reconnected 59 | while (!client.connected()) { 60 | Serial.print("Attempting MQTT connection..."); 61 | // Create a random client ID 62 | String clientId = "ESP32Client-"; 63 | clientId += String(random(0xffff), HEX); 64 | // Attempt to connect 65 | if (client.connect(clientId.c_str(), mqtt_user, mqtt_pass)) { 66 | Serial.println("connected"); 67 | } else { 68 | Serial.print("failed, rc="); 69 | Serial.print(client.state()); 70 | Serial.println(" try again in 5 seconds"); 71 | // Wait 5 seconds before retrying 72 | delay(5000); 73 | } 74 | } 75 | } 76 | 77 | 78 | void setup() { 79 | Serial.begin(115200); 80 | // Just to know which program is running on my Arduino 81 | Serial.println(F("START " __FILE__ " from " __DATE__)); 82 | 83 | setup_wifi(); 84 | client.setServer(mqtt_server, mqtt_port); 85 | 86 | // In case the interrupt driver crashes on setup, give a clue 87 | // to the user what's going on. 88 | Serial.println("Enabling IRin"); 89 | IrReceiver.enableIRIn(); // Start the receiver 90 | 91 | Serial.print(F("Ready to receive IR signals at pin ")); 92 | Serial.println(IR_RECEIVE_PIN); 93 | } 94 | 95 | void loop() { 96 | decode_results results; 97 | unsigned long irSignal; 98 | if (!client.connected()) { 99 | reconnect(); 100 | } 101 | client.loop(); 102 | 103 | if (IrReceiver.decode(&results)) { 104 | char gen_topic[25]; 105 | Serial.println(); 106 | irSignal = results.value; 107 | sprintf(gen_topic, "/%s/irSignal", mqtt_user); 108 | snprintf (msg, MSG_BUFFER_SIZE, "%d", irSignal); 109 | client.publish(gen_topic, msg); 110 | 111 | Serial.print("IR Code: "); 112 | Serial.println(irSignal); 113 | 114 | IrReceiver.resume(); // Receive the next value 115 | } 116 | delay(100); 117 | } 118 | -------------------------------------------------------------------------------- /Review-RYC1001/DHT_RYC1001/DHT_RYC1001.ino: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | #include 4 | 5 | #include "reyax_vars.h" 6 | 7 | /* Uncomment according to your sensortype. */ 8 | //#define DHT_SENSOR_TYPE DHT_TYPE_11 9 | //#define DHT_SENSOR_TYPE DHT_TYPE_21 10 | #define DHT_SENSOR_TYPE DHT_TYPE_22 11 | 12 | static const int DHT_SENSOR_PIN = 4; 13 | DHT_nonblocking dht_sensor( DHT_SENSOR_PIN, DHT_SENSOR_TYPE ); 14 | 15 | WiFiClient espClient; 16 | PubSubClient client(espClient); 17 | 18 | #define MSG_BUFFER_SIZE (512) 19 | char msg[MSG_BUFFER_SIZE]; 20 | 21 | const char* ssid = "BasementElectronics"; 22 | const char* password = "AmateurHour"; 23 | 24 | const String reyax_client = reyax_user + "0002"; 25 | 26 | const char* msg_format = "{\"action\": \"notification/insert\", \"deviceId\": \"%s\", \"notification\": {\"notification\": \"dht\", \"parameters\": {\"temperature\": \"%.1f\",\"humidity\": \"%.1f\"}}}"; 27 | 28 | void setup_wifi() { 29 | 30 | delay(10); 31 | // We start by connecting to a WiFi network 32 | Serial.println(); 33 | Serial.print("Connecting to "); 34 | Serial.println(ssid); 35 | 36 | WiFi.mode(WIFI_STA); 37 | WiFi.begin(ssid, password); 38 | 39 | while (WiFi.status() != WL_CONNECTED) { 40 | delay(500); 41 | Serial.print("."); 42 | } 43 | 44 | randomSeed(micros()); 45 | 46 | Serial.println(""); 47 | Serial.println("WiFi connected"); 48 | Serial.println("IP address: "); 49 | Serial.println(WiFi.localIP()); 50 | } 51 | 52 | void reconnect() { 53 | // Loop until we're reconnected 54 | while (!client.connected()) { 55 | Serial.print("Attempting MQTT connection..."); 56 | // Attempt to connect 57 | if (client.connect(reyax_client.c_str(), reyax_user.c_str(), reyax_pass.c_str())) { 58 | Serial.println("connected"); 59 | } else { 60 | Serial.print("failed, rc="); 61 | Serial.print(client.state()); 62 | Serial.println(" try again in 5 seconds"); 63 | // Wait 5 seconds before retrying 64 | delay(5000); 65 | } 66 | } 67 | } 68 | 69 | void setup( ) 70 | { 71 | Serial.begin( 115200); 72 | 73 | setup_wifi(); 74 | client.setServer(mqtt_server, 1883); 75 | client.setBufferSize(1024); 76 | client.setKeepAlive(60); 77 | } 78 | 79 | static bool measure_environment( float *temperature, float *humidity ) 80 | { 81 | static unsigned long measurement_timestamp = millis( ); 82 | 83 | /* Measure once every five seconds. */ 84 | if( millis( ) - measurement_timestamp > 5000ul ) 85 | { 86 | if( dht_sensor.measure( temperature, humidity ) == true ) 87 | { 88 | measurement_timestamp = millis( ); 89 | return( true ); 90 | } 91 | } 92 | 93 | return( false ); 94 | } 95 | 96 | void loop( ) 97 | { 98 | float temperature; 99 | float humidity; 100 | 101 | if (!client.connected()) { 102 | reconnect(); 103 | } 104 | client.loop(); 105 | 106 | if( measure_environment( &temperature, &humidity ) == true ) 107 | { 108 | snprintf (msg, MSG_BUFFER_SIZE, msg_format, reyax_device.c_str(), temperature, humidity); 109 | client.publish("api/request", msg); 110 | Serial.print("MQTT Message: "); 111 | Serial.println(msg); 112 | 113 | 114 | Serial.print( "T = " ); 115 | Serial.print( temperature, 1 ); 116 | Serial.print( " deg. C, H = " ); 117 | Serial.print( humidity, 1 ); 118 | Serial.println( "%" ); 119 | } 120 | } 121 | -------------------------------------------------------------------------------- /Review-RYC1001/DHT_RYC1001/reyax_vars.h: -------------------------------------------------------------------------------- 1 | /* 2 | * Fill in these values from the registration information 3 | * given to you by REYAX 4 | */ 5 | 6 | const char* mqtt_server = "iot.reyax.com"; 7 | const String reyax_user = "CGf6SEmcV5"; 8 | const String reyax_pass = "YKCZ4unfPP"; 9 | const String reyax_network = "42"; 10 | const String reyax_device = "bFTgCplkwOp3U1Dzyg94AvG6QWqCx7jpzEIU"; 11 | -------------------------------------------------------------------------------- /Review-RYC1001/ryc1001-notes.txt: -------------------------------------------------------------------------------- 1 | Receive in Registration 2 | 3 | 4 | 5 | 6 | 7 | 8 | = #### 9 | 10 | Subscription Topics 11 | api/command//# 12 | api/command_update//# 13 | api/notification//# 14 | api/response/command/get@ 15 | 16 | 17 | JSON Data Structures for Publish 18 | { 19 | "action": "command/insert", 20 | "deviceId": "", 21 | "command": { 22 | "command": "Control Temperature", 23 | "parameters": {"Control":"Temperature"}, 24 | "status":"initialize", 25 | "result": {"temperature": "-1"} 26 | } 27 | } 28 | => Will return in subscription ['command']['id'] to be used as CommandId in update and get commands 29 | 30 | { 31 | "action": "command/update", 32 | "deviceId": "", 33 | "commandId": id returned in command/insert>, 34 | "command": { 35 | "status": "update", 36 | "result": {"temperature": "28"} 37 | } 38 | } 39 | 40 | 41 | { 42 | "action": "notification/insert", 43 | "deviceId": "", 44 | "notification": { 45 | "notification": "dht", 46 | "parameters": {"temperature": "25"} 47 | } 48 | } 49 | 50 | { 51 | "action": "command/get", 52 | "deviceId": "", 53 | "commandId": id returned in command/insert> 54 | } -------------------------------------------------------------------------------- /Rpi-BTDevices/bt_read.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys 4 | import asyncio 5 | from bleak import BleakClient 6 | 7 | DEVICE = "" 8 | CHARACTERISTIC = "19b10001-e8f2-537e-4f6c-d104768a1214" 9 | 10 | async def main(): 11 | async with BleakClient(DEVICE) as client: 12 | dev_value = await client.read_gatt_char(CHARACTERISTIC) 13 | print("Device Value: {0}".format(int(dev_value[0]))) 14 | 15 | if len(sys.argv) < 2: 16 | print("Usage: {} ".format(sys.argv[0])) 17 | sys.exit(1) 18 | 19 | DEVICE = sys.argv[1] 20 | 21 | asyncio.run(main()) -------------------------------------------------------------------------------- /Rpi-BTDevices/led_control.py: -------------------------------------------------------------------------------- 1 | #!/usr/bin/python3 2 | 3 | import sys 4 | import asyncio 5 | from bleak import BleakClient 6 | 7 | DEVICE = "" 8 | CHARACTERISTIC = "19b10001-e8f2-537e-4f6c-d104768a1214" 9 | STATE = b"\xff" 10 | 11 | async def main(): 12 | async with BleakClient(DEVICE) as client: 13 | await client.write_gatt_char(CHARACTERISTIC, STATE, response=True) 14 | 15 | 16 | if len(sys.argv) < 3: 17 | print("Usage: {} on|off".format(sys.argv[0])) 18 | sys.exit(1) 19 | 20 | DEVICE = sys.argv[1] 21 | if sys.argv[2] == "on": 22 | STATE = b"\x00" 23 | 24 | asyncio.run(main()) -------------------------------------------------------------------------------- /Rpi-BTDevices/notes.txt: -------------------------------------------------------------------------------- 1 | BLEAK Python Library: 2 | https://github.com/hbldh/bleak 3 | 4 | GitHub for Demonstration Scripts: 5 | https://github.com/CurtisIreland/electronics/tree/master/Rpi-BTDevices 6 | 7 | List local Bluetooth Devices 8 | $ hcitool dev 9 | 10 | Use bluetoothctl to connect to device 11 | $ bluetoothctl 12 | > scan on 13 | (Wait for device to appear in list) 14 | > trust EE:XX:XX:XX:XX:XX 15 | > connect EE:XX:XX:XX:XX:XX 16 | 17 | 18 | LED BLE: 7C:9E:BD:3C:60:46 19 | Service: 19B10000-E8F2-537E-4F6C-D104768A1214 20 | Characteristic: 19B10001-E8F2-537E-4F6C-D104768A1214 21 | 22 | gatttool -b 7C:9E:BD:3C:60:46 --char-desc 23 | gatttool -b 7C:9E:BD:3C:60:46 --char-read -a 0x000c 24 | gatttool -b 7C:9E:BD:3C:60:46 --char-write-req -a 0x000c -n ff 25 | gatttool -b 7C:9E:BD:3C:60:46 --char-read -a 0x000c 26 | gatttool -b 7C:9E:BD:3C:60:46 --char-write-req -a 0x000c -n 00 27 | 28 | https://github.com/hbldh/bleak 29 | 30 | sudo apt install -y python3-bleak 31 | 32 | --------------------------------------------------------------------------------