This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <BLEDevice.h> | |
#include <BLEUtils.h> | |
#include <BLEServer.h> | |
// See the following for generating UUIDs: | |
// https://www.uuidgenerator.net/ | |
#define SERVICE_UUID "4fafc201-1fb5-459e-8fcc-c5c9c331914b" | |
#define CHARACTERISTIC_UUID "beb5483e-36e1-4688-b7f5-ea07361b26a8" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add_executable(hello_serial | |
hello_serial.c | |
) | |
# Pull in our pico_stdlib which aggregates commonly used features | |
target_link_libraries(hello_serial pico_stdlib) | |
# create map/bin/hex/uf2 file etc. | |
pico_add_extra_outputs(hello_serial) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if (TARGET tinyusb_device) | |
add_executable(hello_usb | |
hello_usb.c | |
) | |
# Pull in our pico_stdlib which aggregates commonly used features | |
target_link_libraries(hello_usb pico_stdlib) | |
# enable usb output, disable uart output | |
pico_enable_stdio_usb(hello_usb 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
** | |
* Copyright (c) 2020 Raspberry Pi (Trading) Ltd. | |
* | |
* SPDX-License-Identifier: BSD-3-Clause | |
*/ | |
#include <stdio.h> | |
#include "pico/stdlib.h" | |
int main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <BluetoothSerial.h> | |
#define ledPIN 2 | |
BluetoothSerial SerialBT; | |
byte BTData; | |
/* Check if Bluetooth configurations are enabled in the SDK */ | |
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) | |
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "BluetoothSerial.h" | |
/* Check if Bluetooth configurations are enabled in the SDK */ | |
/* If not, then you have to recompile the SDK */ | |
#if !defined(CONFIG_BT_ENABLED) || !defined(CONFIG_BLUEDROID_ENABLED) | |
#error Bluetooth is not enabled! Please run `make menuconfig` to and enable it | |
#endif | |
BluetoothSerial SerialBT; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <WiFi.h> | |
const int servoPin = 16; /* GPIO16 */ | |
const char* ssid = "ESP32-WiFi"; /* Add your router's SSID */ | |
const char* password = "12345678"; /*Add the password */ | |
int dutyCycle = 0; | |
//int position1 = 0; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define ADCPIN A0 | |
const int redLEDPin = 16; /* GPIO16 */ | |
int dutyCycle = 0; | |
int adcValue; | |
/* Setting PWM properties */ | |
const int PWMFreq = 50; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* ESP32 Servo Sweep */ | |
const int servoPin = 16; /* GPIO16 */ | |
int dutyCycle = 0; | |
/* Setting PWM properties */ | |
const int PWMFreq = 50; | |
const int PWMChannel = 0; | |
const int PWMResolution = 8; | |
//const int MAX_DUTY_CYCLE = (int)(pow(2, PWMResolution) - 1); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const int servoPin = 16; /* GPIO16 */ | |
int dutyCycle = 0; | |
/* Setting PWM properties */ | |
const int PWMFreq = 50; | |
const int PWMChannel = 0; | |
const int PWMResolution = 8; | |
//const int MAX_DUTY_CYCLE = (int)(pow(2, PWMResolution) - 1); |