Skip to content

Commit

Permalink
Document what the different builds are (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
hmaarrfk authored Mar 3, 2025
1 parent 0f8fe88 commit 02fcf18
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 57 deletions.
46 changes: 34 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ a host computer that sends requests to accomplish different actions.
Currently, we support:


| Protocol | Teensy 3.2 | Teensy 4.0 |
|:---------|:-----------|:-----------|
| GPIO | Yes | Yes |
| I2C | Yes | Yes |
| PWM | Yes | Yes |
| SPI | Yes | Yes |
| Protocol | Teensy 4.0 |
|:---------|:-----------|
| GPIO | Yes |
| I2C | Yes |
| PWM | Yes |
| SPI | Yes |

Future protocols include:

Expand All @@ -25,28 +25,50 @@ Future protocols include:

Generally speaking, this should help you prototype hardware, by bypassing the tedious steps of creating a USB Serial Parser, and letting you bring up hardware more naturally.

## Teensy 3.2
## Teensy 4.0

upload with

```
platformio run -e teensy32 --target upload
platformio run -e teensy40 --target upload
```

To upload a precompiled build:
```
teensy_loader_cli -s --mcu=TEENSY31 build_version_number.hex
teensy_loader_cli -s --mcu=TEENSY40 build_version_number.hex
```

## Teensy 4.0
This library also provides a basic "setup" and loop capabilities. This can be
useful if you want to create an open-loop demonstration application. No "if"
statements are used in the loop meaning it is very difficult to create
conditions.

* `teensy40_blinder`: blinks the built in LED of the Teensy40 a few times for your pleasure!
* `teensy40_fan_hub`: shows how the teensy can control 4 pin fans at different speeds.
* `teensy40_fan_hub_default_off`: setups up 4 pin fan control on Pin 2. After bootup, fans are off.
* `teensy40_neopixel_example`: Drives 5 neopixel RGBW LEDs.


<details><summary>Deprecation of Teensy3</summary>

## Teensy 3.2

| Protocol | Teensy 3.2 |
|:---------|:-----------|
| GPIO | Yes |
| I2C | Yes |
| PWM | Yes |
| SPI | Yes |

upload with

```
platformio run -e teensy40 --target upload
platformio run -e teensy32 --target upload
```

To upload a precompiled build:
```
teensy_loader_cli -s --mcu=TEENSY40 build_version_number.hex
teensy_loader_cli -s --mcu=TEENSY31 build_version_number.hex
```

</details>
49 changes: 4 additions & 45 deletions src/examples/fan_hub_default_off/fan_hub.cpp
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
/* A small demo to show how the teensy-to-any can be used to control 4 pin fans.
* It is assumed that the fan PWM pin is connected to pin 2
* and that an indicator LED is connected to Pin 13 (this is the default board)
/* Setup the Teensy 4 to control a 4 pin PWM fan on pin 2.
*
* The demo code will run the fan at
* * 100%
* * 75%
* * 50%
* * 25%
* * 0%
* For 3 seconds at a time and then continue in an infinite loop.
* The LED can be used as a visual guide of the expected speed of the fan.
* After bootup, the Teensy is ready to control the fan, however
* the fan is set to off.
*
* Not all fan will be able to operate at 25% duty cyle.
*
* Ramona Optics - 2024
* Ramona Optics - 2024-2025
*/
const char *teensy_to_any_startup_commands[] = {
// Setup the LED as an indicator pin
Expand All @@ -31,36 +21,5 @@ const char *teensy_to_any_startup_commands[] = {

// Change the fan speed
const char *teensy_to_any_demo_commands[] = {
// "analog_write 2 255",
// "analog_write 13 255",
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms

// "analog_write 2 192",
// // Brightness is a strange thing, and does not
// // decrease so linearly according to human perception
// "analog_write 13 128",
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms

// "analog_write 2 128",
// "analog_write 13 30",
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms

// "analog_write 2 64",
// "analog_write 13 10",
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms

// "analog_write 2 0",
// "analog_write 13 0",
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
// "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", "sleep 0.2", // 1000 ms
nullptr,
};

0 comments on commit 02fcf18

Please sign in to comment.