Raspberry Pi Pico MicroPython IoT Device for Trading BOT Automation and Analysis

Raspberry Pi Pico MicroPython IoT Device Microcontroller Fix Broken BOOTSEL Issues:


It has dedicated test point pads (TP1–TP6) right in the middle of the board (you can see them in photo, between the two rows of pins, above where GP0/GP1 are labeled). One of those, TP6, is literally the BOOTSEL signal, and one of the others (TP1) is GND — exactly what the button normally shorts together.
Steps:
Unplug the USB cable from the Pico for a moment
Take one of your jumper wires (or just touch the two pads with a single wire/tweezers) and bridge TP6 to a GND pad
Looking at photo, TP6 is the topmost of that middle block of small square pads, and TP1 (or any of the GND-labeled pads nearby, e.g. "GND" next to GP1) works as ground
While holding that short, plug the USB cable into your laptop
Keep holding the bridge for about 2 seconds after plugging in, then release
The Pico should now show up on your computer as a USB drive called RPI-RP2
Tips:
Make sure you're bridging TP6 to GND(TP1), not accidentally two GPIO pads — a wrong short won't hurt anything (these are just logic-level pins) but won't trigger bootloader either
If it doesn't enumerate, try again — timing matters a little (some people find it easier to hold the short first, then plug in USB while still touching)
Once it's in RPI-RP2 mode, drag your .uf2 firmware file onto it like normal

OS is detecting the Pico as a USB mass storage device and setting it up
The bootloader shorting worked
What to do now:
Wait a few seconds for it to finish setting up
Open File Explorer (Windows) or Finder (Mac) — you should see a new drive appear named RPI-RP2
If it appears, you're in bootloader mode. Now you just need to flash firmware:
Download a .uf2 file — either:
MicroPython: https://micropython.org/download/RPI_PICO/ (or RPI_PICO2 if this is a Pico 2)
Or whatever firmware/project you were trying to flash originally
Drag and drop the .uf2 file onto the RPI-RP2 drive
The Pico will automatically reboot and run the new firmware once the copy finishes (the drive will disappear — that's normal)

Raspberry Pi Pico MicroPython IoT Device Microcontroller:


For Instructions Watch The Video Here:



from machine import Pin
import time

led = Pin(25, Pin.OUT)

while True:
    led.on()
    time.sleep(1)
    led.off()
    time.sleep(1)

MicroPython Pico Driving an Arduino Mega TFT Shield:


For Instructions Watch The Video Here:


Upload the Below Code to Arduino Mega through Arduino IDE:


#define LCD_CS A3
#define LCD_CD A2
#define LCD_WR A1
#define LCD_RD A0
#define LCD_RESET A4

#include 
#include 
MCUFRIEND_kbv tft;

#define BLACK   0x0000
#define BLUE    0x001F
#define RED     0xF800
#define GREEN   0x07E0
#define CYAN    0x07FF
#define MAGENTA 0xF81F
#define YELLOW  0xFFE0
#define WHITE   0xFFFF

void setup(void) {
    Serial.begin(9600);     // USB - keep for debugging via laptop if connected
    Serial1.begin(9600);    // <-- pins 18(TX1)/19(RX1), talks to Pico

    uint16_t ID = tft.readID();
    if (ID == 0xD3D3) ID = 0x9481;
    tft.begin(ID);

    tft.setRotation(0);
    tft.fillScreen(BLACK);
    tft.setTextColor(WHITE, BLACK);
    tft.setTextSize(2);
    tft.setCursor(0, 0);
    tft.println("Waiting for Pico...");
}

void loop(void) {
    if (Serial1.available()) {           // <-- changed from Serial
        String msg = Serial1.readStringUntil('\n');
        msg.trim();

        tft.fillScreen(BLACK);
        tft.setCursor(0, 0);
        tft.setTextColor(WHITE, BLACK);
        tft.setTextSize(2);
        tft.println(msg);

        Serial.println("OK: " + msg);    // this still goes to laptop if USB connected, for debugging
    }
}1)


Run the Below Code to Pico through Thonny IDE:


from machine import UART, Pin
uart = UART(0, baudrate=9600, tx=Pin(0), rx=Pin(1))
uart.write('Hello from Pico\n')

Hedging Strategies Utilizing Delta Exchange API in Python

Identify ATM Strike Price Symbol through Search and Sorting Method for Trading Straddle Strategy:


For Instructions Watch The Video Here:



import requests 
import pandas as pd

underlying_asset_symbols='BTC'
expiry_date='02-09-2026'

url=f"https://api.india.delta.exchange/v2/tickers?contract_types=call_options,put_options&underlying_asset_symbols={underlying_asset_symbols}&expiry_date={expiry_date}"

df=pd.json_normalize(requests.get(url).json().get('result'))
df['strike_price']=pd.to_numeric(df['strike_price'])
spot_price=df['spot_price'].astype(float).loc[0]
atm_strike=df.loc[(df['strike_price']-spot_price).abs().idxmin(), 'strike_price']
date=expiry_date.replace('-','')
ce_symbol=f'C-{underlying_asset_symbols}-{atm_strike}-{date}'
pe_symbol=f'P-{underlying_asset_symbols}-{atm_strike}-{date}'
print(ce_symbol,pe_symbol)