TinyPico & MicroPython !

Received my TinyPico boards I backed on Crowd Supply, and making some notes based on Seon’s Youtube video “MicroPython #1 – Lets Get Started”.

Download from: http://micropython.org/download#esp32

Using OSX, Terminal

ls /dev/tty.*

/dev/tty.SLAB_USBtoUART
esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART erase_flash
esptool.py --chip esp32 --port /dev/tty.SLAB_USBtoUART --baud 460800 write_flash -z 0x1000 esp32-20190731-v1.11-182-g7c15e50eb.bin
screen /dev/tty.SLAB_USBtoUART 115200

Gives a python prompt from the TinyPico !

https://github.com/dhylands/rshell

sudo pip3 install rshell
rshell -p /dev/tty.SLAB_USBtoUART 
ls /pyboard

cp micropython_dotstar.py /pyboard
repl
import example.py

 

 

 

Posted in Uncategorized | Leave a comment

MAX7219 Clock countdown for artworks

 

Using a pre-loved Telechron 6-digit 7-segment clock, controlled by a MAX7219 IC…

 

On power up.. clock to display  00 00 00

if Digital I/O xx is HIGH (pulled to 5v) (requires external pull-up-resistor)

counter = 1 hour.  ** Closed contact closed, or button pushed..

Counter is always counting down

When clock gets to 00 00 00, stop counting.

 

Closed contact from Brightsign Relay box, when clip starts – timecode 00h00m00s00f  for 2 seconds.. tells clock to start counting down.

 

Code: https://github.com/dargs/timer

 

Parts:

1x ATMega168

1x 16MHZ Crystal

2x 22pF Caps

10k resistor (reset pullup)

10uF cap (decoupling)

 

 

Posted in Uncategorized | Leave a comment

Teensy Hardware Joystick & Keyboard emulator

Testing if Teensy can be a Joystick and a Keyboard.. as some game emulators expect joystick commands as default, but require keyboard keys also. Handy in installation environment.

 

/* Basic USB Joystick Example

  GPIO 0 Keyboard - F1
  GPIO 1 Keyboard - F3
  GPIO 2 Keyboard - F5
  GPIO 3 Joystick -X
  GPIO 4 Joystick +X
  GPIO 5 Joystick -Y
  GPIO 6 Joystick +Y
  GPIO 7 Joystick Button 1 FIRE

Set Teensy 3.2 to be Serial/Joystick/Host.
*/

#include <Bounce.h>

// Create Bounce objects for each button.  The Bounce object
// automatically deals with contact chatter or "bounce", and
// it makes detecting changes very simple.

Bounce button0 = Bounce(0, 10);  // F1
Bounce button1 = Bounce(1, 10);  // F3 10 = 10 ms debounce time
Bounce button2 = Bounce(2, 10);  // F5  which is appropriate for

int ledPin = 13;
const int joystick_X_neg_pin = 3;
const int joystick_X_pos_pin = 4;
const int joystick_Y_neg_pin = 5;
const int joystick_Y_pos_pin = 6;
const int joystick_fire_pin = 7; 

void setup() {
  pinMode(0, INPUT_PULLUP);
  pinMode(1, INPUT_PULLUP);
  pinMode(2, INPUT_PULLUP);
  pinMode(3, INPUT_PULLUP);
  pinMode(4, INPUT_PULLUP);
  pinMode(5, INPUT_PULLUP);
  pinMode(6, INPUT_PULLUP);  // Teensy++ LED, may need 1k resistor pullup
  pinMode(7, INPUT_PULLUP);
  pinMode(ledPin, OUTPUT);     

  Serial.begin(9600);
  Serial.println("... Setup ... ");
}

void loop() {
 
  // Update all the buttons for the keyboard.  There should not be any long
  // delays in loop(), so this runs repetitively at a rate
  // faster than the buttons could be pressed and released.

  button0.update(); // F1 Start
  button1.update(); // F3 1/2 Player
  button2.update(); // F5 Restart

// Check each button for "falling" edge.

  if (button0.fallingEdge()) {
    Keyboard.press(KEY_F1); // Button 0 = F1 = Start Game
    delay(10);
    Keyboard.release(KEY_F1);
  }

  if (button1.fallingEdge()) {
    Keyboard.press(KEY_F3); // Button 1 = F3 = 1 Player / 2 Player
    delay(10);
    Keyboard.release(KEY_F3);
  }
 
  if (button2.fallingEdge()) {
    Keyboard.press(KEY_F5); // Button 2 = F5 = Restart Game
    delay(10);
    Keyboard.release(KEY_F5);    
  }

if (digitalRead(joystick_X_neg_pin) == LOW)
    {    
    Joystick.X(0);          // Min X
    } else if (digitalRead(joystick_X_pos_pin) == LOW)
    {
    Joystick.X(1023);          // Max X
    } else   {
    Joystick.X(512);          // X Centred
   }

if (digitalRead(joystick_Y_neg_pin) == LOW)
   {
    Joystick.Y(1023);          // Y Max
  } else if (digitalRead(joystick_Y_pos_pin) == LOW)
    {
    Joystick.Y(0);          // Y Min
  } else {
    Joystick.Y(512);          // Y Centred
  }

if (digitalRead(joystick_fire_pin) == LOW) {
    Joystick.button(1, HIGH);  // Button  1 = FIRE High
    delay(10);
  } else {
    Joystick.button(1, LOW);  // Button  1 = FIRE Low
  }

  delay(50);  // a brief delay
}
Posted in Arduino-Projects, electronics | Tagged , , , | Leave a comment

USB Remote monitor

Web enabled (ESP32 ? PoE Shield ?)

USB Tester OLED

https://www.tindie.com/products/FriedCircuits/usb-tester-20-bundle/

https://github.com/FriedCircuits/FC-USB-Tester-OLED-Backpack/blob/master/USB_Tester_v1/Pre_JSON/USB_Tester_OLED/USB_Tester_OLED.ino

 

Monitors Voltage and Current for installations (Keyboards, Mice, Game Controllers). Able to report via web interface / SNMP under voltage / disconnects

 

 

Posted in Uncategorized | Leave a comment

RS232 Serial debugger

 

Passive split: (No latency, no re-transmitting packets…. Receive Only, can’t tell which device is sending)

https://www.compuphase.com/electronics/rs232split.htm

.. Use 2 splits, into 2 MAX232s into 2 Serial RX on Teensy.

 

 

Serial In (From Control System)

MAX232 -> TTL Serial #1

Microcontroller (Teensy?)  Echos incoming strings to output, and onto – USB for Monitoring & Manual commands on local laptop running Putty etc.

TTL Serial #2 -> MAX232

Serial Out (To Device under test – ie Projector)

 

  • USB control includes prompt to change baud rate. Settings stored to EEPROM.
  • Phoenix to Screw terminals TX/RX/GND
  • Phoenix to DB9 connector adapter.
  • Phoenix to RJ45 adapter
  • jumpers to bypass TX / RX
  • LEDs to indicate traffic on bus.

 

Optional

  • Ethernet to remotely log
  • SD Card slot to log inc Real Time Clock.
  • LCD / OLED for local monitoring
Posted in electronics, Uncategorized | Tagged | Leave a comment

Brightsign media player Relay & Button control PCB

DB15 IDC Connector

https://www.digikey.com.au/product-detail/en/cnc-tech/410M0-15-1-00/1175-1813-ND/6024195

 

15cm 16 way ribbon cable

https://www.digikey.com.au/product-detail/en/assmann-wsw-components/AWG28-16-G-300/AE16G-5-ND/686332

 

16 Pin 8×2 Header

https://www.digikey.com.au/product-detail/en/on-shore-technology-inc/302-S161/ED10523-ND/2794234

 

Jumper select ? for Relay vs Button (GPI vs GPO) or have 4 relays, 4 buttons?

3 way Screw Terminals (Relays C, N/C, N/O) x 4

2 way Screw Terminals x 4 (Buttons)

9v ? 5v ? 500mA DC Input (5v Relays)

https://www.digikey.com.au/product-detail/en/omron-electronics-inc-emc-div/G5LE-1-ASI-DC5/Z5212-ND/414237

 

Transistors x4

Diodes x 4

Resistors

LEDs PSU

LED Off/On per channel?

PCB

DIN Rail enclosure

 

 

Posted in electronics | Leave a comment

Prey Q&A with Raphael Colantonio

https://www.acmi.net.au/events/prey-raphael-colantonio/

Posted in Uncategorized | Leave a comment