GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — bionic-frog/docs/06-firmware.md at main · purticra/bionic-frog

Expand file tree

/

06-firmware.md

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
84 lines (60 loc) · 3.18 KB
/

06-firmware.md

Copy path

File metadata and controls

84 lines (60 loc) · 3.18 KB
Raw
Copy raw file
Download raw file
Outline
Edit and raw actions

6 · Firmware

Built on Arduino; Bluetooth control via the Blinker IoT platform. A phone pairs with the Lolin32's BLE radio.

Source: firmware/frog-main/frog-main.ino

Dependencies

#include <Arduino.h>
#define BLINKER_BLE
#include <Blinker.h>
#include <OneWire.h>
#include <DallasTemperature.h>

Install Blinker, OneWire and DallasTemperature through the Arduino Library Manager.

Control map

App button Blinker key Callback Function
GoForward gf GoForward_callback Forward
TurnLeft tl TurnLeft_callback Turn left
TurnRight tr TurnRight_callback Turn right
Suck sk Suck_callback Sample water

Control strategy

Open-loop timed sequencing. Every delay was tuned empirically in the pool. There is no feedback — no pressure sensing, no IMU in the loop.

void GoForward_callback(const String & state)
{
  digitalWrite(LED_BUILTIN, !digitalRead(LED_BUILTIN)); // command received

  digitalWrite(pineg, HIGH);  delay(3000);  // build pressure, 3 s
  digitalWrite(pinlb, HIGH);
  digitalWrite(pinrb, HIGH);  delay(200);   // hind limbs fire first
  digitalWrite(pinlf, HIGH);
  digitalWrite(pinrf, HIGH);  delay(2000);  // forelimbs follow
  digitalWrite(pinlb, LOW);
  digitalWrite(pinrb, LOW);   delay(500);   // vent hind limbs
  digitalWrite(pineg, LOW);
  digitalWrite(pinlf, LOW);
  digitalWrite(pinrf, LOW);                 // vent all
}

The 200 ms offset matters. Hind limbs lead the forelimbs, mirroring the frog's gait where the hind limbs drive and the forelimbs stabilise. Turning simply drives one forelimb — left turn fires the right-front valve and vice versa.

Initialisation

  • Serial at 115200 baud, MCU to on-board BLE module
  • All six control pins pinMode(OUTPUT) and digitalWrite(LOW)
  • Blinker.begin(), then attach() for the four button callbacks

Temperature branch

A DS18B20 on GPIO 26, 9-bit resolution, reported back to the phone via BlinkerNumber.

Fixed for release. The archived version referenced an undefined deviceAddress and an undefined Number1, and would not compile. The published frog-main.ino corrects both, adds a disconnected-sensor guard, and polls at 1 Hz rather than every loop iteration (a 12-bit DS18B20 conversion blocks for ~750 ms, which would otherwise stall Blinker.run()).

Version history

The firmware/legacy/ directory preserves the development sequence:

Directory Notes
00-platformio-prototype/ Earliest PlatformIO version, two test buttons, pressure-sensor definitions
01-basic-test/ Basic valve test, 90 lines
02-add-single-valve/ Single-channel addition, 112 lines
03-single-route-test/ Single pneumatic route test, 167 lines
04-add-pump/ Pump control added, 122 lines
05-pump-and-temperature/ Pump + temperature, 136 lines
../frog-main/ Final, 210 lines

Mobile app

Blinker provides BLE access for ESP32 boards. The project uses its button widgets to dispatch commands; no custom app was written.


Prev: 5 · Electronics · Next: 7 · Simulation

You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.