Skip to content

Work log - Week 14 - April 27, 2022

Wednesday 4/27

Attended class.

I’m going to start dropping the links I collect from the classes in here. It’s something I should have done from day 1.

http://cba.mit.edu/docs/theses/19.09.calisch.pdf

http://cba.mit.edu/docs/papers/20.11.meta_combined.pdf

G Code Sender: https://sienci.com/gsender/

http://fabacademy.org/2020/labs/leon/students/adrian-torres/week04.html#board_house

Synthesiser code for arduino, I’ve used it years ago. Cool. https://sensorium.github.io/Mozzi/

easy composites youtube channel: https://www.youtube.com/channel/UC7F-suscQATns3qRYHpyijw

https://fabacademy.org/2022/labs/waag/students/saco-heijboer/electronics/4-input%26output/#output-devices

https://fab.cba.mit.edu/classes/862.22/index.html

https://fabacademy.org/2022/labs/aalto/students/matti-niinimaki/weekly-assignments/week06/#testing-with-touchdesigner

“Arduiono Nano” using attiny412: https://fabacademy.org/2020/labs/leon/students/adrian-torres/adrianino.html#hc05

Thursday 4/28

Documentation and designed the v4 version of the Attiny412 board with SCL/SDA and two sensor inputs. I had to design one from scratch because KiCad was all “Dude, I can’t find that schematic you’ve made this PCB from, even though you clicked the button in the schematic window to open the PCB desgin window? I’m freaking out man.” Thanks Kicad.

But I designed the new boards, seen here. Still have to make them, populate them, and test them of course. This is now on v4.

Attiny Neopixel v4 - F.Cu Attiny Neopixel v4 Eco2_user

Also: http://www.thestacksreader.com/secrets-of-the-blue-box-ron-rosenbaum-steve-jobs-influence/

and Cool:

https://sandify.org/

Friday 4/29

Managed to get the i2c network over my Attiny412 boards to work. Yay.

Sometimes things that you think will be simple turn out to be ridiculously hard, and sometimes the opposite is true. Thankfully, setting up the i2c network was much easier than I had expected.

i2c blink

Tried to get the GPS Attiny1614 to work. No luck. I’m not sure what the problem is, but I couldn’t get any serial data out of it, which is telling.

attiny 1614 gps

Saturday 4/30

Found this, a list of libraries that work with megaTinycore. Useful, even if they might not work with the limited 412.

https://github.com/SpenceKonde/megaTinyCore/blob/master/megaavr/extras/LibraryCompatibility.md

I kind of got the rotary encoder working, using polling.

yay?

But it’s way too slow. Moving the encoder at even a moderate speed loses a number of pulses.

It also only works if I hold the dupont cables juuuuust right. Stupid stupid dupont cables. I’m going to stop using them asap.

cables

cables 2

Here’s the code for the polling, stolen from Matthias Hertel’s rotary encoder library example:=, I changed a couple of things, like pulling things out of the if/else #define statements since my board isn’t an Uno or an ESP8266.

// -----
// SimplePollRotator.ino - Example for the RotaryEncoder library.
// This class is implemented for use with the Arduino environment.
//
// Copyright (c) by Matthias Hertel, http://www.mathertel.de
// This work is licensed under a BSD 3-Clause License. See http://www.mathertel.de/License.aspx
// More information on: http://www.mathertel.de/Arduino
// -----
// 18.01.2014 created by Matthias Hertel
// 04.02.2021 conditions and settings added for ESP8266
// -----

// This example checks the state of the rotary encoder in the loop() function.
// The current position and direction is printed on output when changed.

// Hardware setup:
// Attach a rotary encoder with output pins to
// * A2 and A3 on Arduino UNO.
// * D5 and D6 on ESP8266 board (e.g. NodeMCU).
// Swap the pins when direction is detected wrong.
// The common contact should be attached to ground.

#include <Arduino.h>
#include <RotaryEncoder.h>

#if defined(ARDUINO_AVR_UNO) || defined(ARDUINO_AVR_NANO_EVERY)
// Example for Arduino UNO with input signals on pin 2 and 3
#define PIN_IN1 2
#define PIN_IN2 3

#elif defined(ESP8266)
// Example for ESP8266 NodeMCU with input signals on pin D5 and D6
#define PIN_IN1 D5
#define PIN_IN2 D6

#endif

#define PIN_IN1 2  // pin 2 is SDA on attiny whatever boards
#define PIN_IN2 3  // pin 3 is SCL

// Setup a RotaryEncoder with 4 steps per latch for the 2 signal input pins:
// RotaryEncoder encoder(PIN_IN1, PIN_IN2, RotaryEncoder::LatchMode::FOUR3);

// Setup a RotaryEncoder with 2 steps per latch for the 2 signal input pins:
RotaryEncoder encoder(PIN_IN1, PIN_IN2, RotaryEncoder::LatchMode::TWO03);

void setup()
{
  Serial.begin(57600);
  while (! Serial);
  Serial.println("SimplePollRotator example for the RotaryEncoder library.");
} // setup()


// Read the current position of the encoder and print out when changed.
void loop()
{
  static int pos = 0;
  encoder.tick();

  int newPos = encoder.getPosition();
  if (pos != newPos) {
    Serial.print("pos:");
    Serial.print(newPos);
    Serial.print(" dir:");
    Serial.println((int)(encoder.getDirection()));
    pos = newPos;
  } // if
} // loop ()

// The End

Sunday 5/1

Spent a decent part of the day trying to get the SAMD11 board I had previously made to work. It was “verified” as programmed, but it wasn’t being “seen” by any of the computers when hooked up via usb.

Finally tried edbg, which showed it wasn’t passing verification, and that helped me find out what was wrong. I needed to re-write the fuses. Updated week 9 with more information on this issue.

Monday 5/2

Didn’t do much today, kept working on networking, and helped Cori with some electronics and designing a new board for input and networking projects, and discussed her final project. I made a cable.

I did catch Adam wearing these amazing glasses. I’m pretty sure he was in ZZ Top at one point.

adam

Tuesday 5/3

I made the new boards, a version of the attiny-whatever board. I designed this board so you could use a neopixel or a normal led with it. I soldered a normal led (as I wanted these for playing with i2c, and the attiny412 doesn’t have enough memory to run i2c wire.h library and the tiny_neopixel library.)

Spent a lot of time helping Cori with her board. She was ridiculously excited when it blinked a led in different colors. We then networked our boards, and one board told the other board to blink. It worked. Down with the patriarchy.

(more info on week 14 group page.)


Last update: May 6, 2022