Mail Call #10: Thanks Craig! Also loot from AliExpress | In The Lab With Jay Jay

This post is part of my video blog and you can find more information about this video over here.

You can support this channel on Patreon: patreon.com/JohnElliotV

In this video I receive Engineer’s Mini Notebook Volume II – Science and Communication Circuits & Projects all the way from the USA from my friend (and mentor (and reader (and viewer (and patron (and Lisp hacker))))) Craig. Thanks Craig! <3

I mention that the October 2024 edition of Silicon Chip magazine is out.

I mention that I recently got my symbol keyboard working on Linux! Pretty happy about that! These are the extra keys that I have at my workstation now: ° ± § λ Δ Σ Π Ω ε µ π θ

I also get a bunch of stuff from AliExpress, including:

And yes, despite confusion, I did get three lots of two different kinds of hard brushes, and yes, I did end up saying the wrong thing in the video! Can’t take me anywhere.

Oh, and as I mention in the video I am from a beautiful part of the world known as the Blue Mountains. It’s pretty hot here today!

In the end my collection of Arduino boards includes:

Thanks very much for watching! And please remember to hit like and subscribe! :)


Following is a product I use picked at random from my collection which may appear in my videos. Clicking through on this to find and click on the green affiliate links before purchasing from eBay or AliExpress is a great way to support the channel at no cost to you. Thanks!

Wozniak Solder LugsThis is an image of the product.notes

Let’s go shopping!

Controlling Arduino Uno with Serial commands

@kline helped me with Phase 1 of my Crustacean Chirpy Chip Challenge project, which I have completed (sort of). I got the programming done but I didn’t do all the reading (yet).

Note to self: My Arduino Uno knockoff identifies itself as a “QinHeng Electronics USB Serial” USB device.

This is my code:

enum state { OFF, ON, FLASH };

enum state state = OFF;

int blink_pin = 13;

void setup() {
  pinMode( blink_pin, OUTPUT );
  Serial.begin( 9600 );
}

void loop() {
  if ( Serial.available() > 0 ) { read_command(); }
  switch ( state ) {
    case ON :
      digitalWrite( blink_pin, HIGH );
      break;
    case OFF :
      digitalWrite( blink_pin, LOW );
      break;
    case FLASH :
      int pin = digitalRead( blink_pin );
      digitalWrite( blink_pin, !pin );
      delay( 500 );
      digitalWrite( blink_pin, pin );
      delay( 500 );
      break;
  }
}

void read_command() {
  String command = Serial.readString();
  command.trim();
  command.toLowerCase();
  Serial.print( "Command: " );
  Serial.println( command );
  if ( command == "on" ) {
    state = ON;
  }
  else if ( command == "off" ) {
    state = OFF;
  }
  else if ( command == "flash" ) {
    state = FLASH;
  }
  else {
    Serial.println( "Unknown command." );
  }
}

This is my setup:

The code which would actually implement the spec, as given:

void read_command() {
  char c = Serial.read();
  switch ( c ) {
    case 'a' :
      state = ON;
      break;
    case 's' :
      state = OFF;
      break;
  }
}