Skip to content

Week11

Networking and Communications

Group assignment:

  • Send a message between two projects
  • Document your work to the group work page and reflect on your individual page what you learned

Individual assignment:

  • design, build and connect wired or wireless node(s) with network or bus addresses and a local input and/or output device(s)

Group assignment

Our group assignment is on lab’s page.

Individual assignment:

Take-san ordered QPAD-xiao PCB and gave it to me, so I assembled it. So, I used QPAD to finish my week 11 assignment. The design file of QPAD-xiao can be found in the repository.

I wrote very simple sketch that read string from USB-serial and draw it on OLED through I2C. USB-serial is local input, OED is local output in this project.

I refer test_display_RP2040.ino and got how to handle this OLED on Arduino IDE, and added some code that read the string through USB-serial from personal computers. I2C is the bus that use addresses. For the SSD1306, the slave address is either “b0111100” or “b0111101” by changing the SA0 to LOW or HIGH. The board I used was “b0111100” (0x3C) one.

#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define SCREEN_ADDRESS 0x3C // 0x3D or 0x3C depending on brand
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire, -1, 1700000UL, 1700000UL);

String incomingstring;

void setup() {
  Serial.begin(115200);
  delay(50);

  /* initializing display */
  display.begin(SSD1306_SWITCHCAPVCC, SCREEN_ADDRESS);
  display.clearDisplay();
  display.display();
  display.setTextSize(1);
  display.setTextColor(SSD1306_WHITE);
}

void loop() {
  if (Serial.available() > 0) {
    incomingstring = Serial.readStringUntil('\n'); // reading string until Line Feed
    display.clearDisplay();
    display.setCursor(0, 0);
    display.print(incomingstring); // display read string on OLED
    display.display(); // let the display go
  }
}

Unfortunately, there are nothing special I learned from the process finishing this assignment. Sorry for being cheeky.

Problem I had.

The PCB take-san provided doesn’t have drill holes. So I cut tip of pin header for about one mm and soldered on the surface of top side of PCB. It works because traces of thie board are only on top side of this PCB.

Checklist

  • Linked to the group assignment page
  • Documented your project and what you have learned from implementing networking and/or communication protocols.
  • Explained the programming process(es) you used.
  • Ensured and documented that your addressing for boards works
  • Outlined problems and how you fixed them.
  • Included design files (or linked to where they are located if you are using a board you have designed and fabricated earlier) and original source code.
  • Included a ‘hero shot’ of your network and/or communications setup