Skip to content

Commit

Permalink
second commit
Browse files Browse the repository at this point in the history
  • Loading branch information
chee committed Mar 14, 2021
1 parent 38bce36 commit e4a36ad
Show file tree
Hide file tree
Showing 36 changed files with 12,445 additions and 57 deletions.
1 change: 1 addition & 0 deletions .gitignore
@@ -0,0 +1 @@
build/
Binary file not shown.
Binary file not shown.
4 changes: 4 additions & 0 deletions bleepbloopmachine/CMakeLists.txt
@@ -0,0 +1,4 @@
cmake_minimum_required(VERSION 3.0.0)
project(bleepbloopmachine CXX)
add_executable(bleepbloopmachine main.cc)
target_link_arduino_libraries(bleepbloopmachine AUTO_PUBLIC)
2 changes: 2 additions & 0 deletions bleepbloopmachine/Makefile
@@ -0,0 +1,2 @@
BOARD := pro5v
include /usr/share/arduino/Arduino.mk
22 changes: 22 additions & 0 deletions bleepbloopmachine/README.md
@@ -0,0 +1,22 @@
# bleepbloopmachine

## building

```sh
mkdir build
cd build
cmake -D CMAKE_TOOLCHAIN_FILE=/home/chee/projects/Arduino-CMake-Toolchain/Arduino-toolchain.cmake
-D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..
ln build/compile_commands.json ..
```

then uncomment the pygamer lines in the generated `BoardOptions.cmake`, then run
the cmake command again and run `make` to build it.

## watching

if you keep this running, emacs will know about the new includes when you do an lsp-workspace-restart

```sh
watchexec -e cc,h -w .. 'cmake -D CMAKE_TOOLCHAIN_FILE=/home/chee/projects/Arduino-CMake-Toolchain/Arduino-toolchain.cmake -D CMAKE_EXPORT_COMPILE_COMMANDS=1 ..'
```
11,902 changes: 11,902 additions & 0 deletions bleepbloopmachine/TAGS

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions bleepbloopmachine/bleepbloopmachine.ino
@@ -0,0 +1,9 @@
#include "main.h"

void setup() {
_setup();
}

void loop() {
_loop();
}
1 change: 1 addition & 0 deletions bleepbloopmachine/compile_commands.json
57 changes: 57 additions & 0 deletions bleepbloopmachine/main.cc
@@ -0,0 +1,57 @@
#include "main.h"
#include <Adafruit_BusIO.h>
#include "Adafruit_SPIFlash.h"
#include "Adafruit_TinyUSB.h"
#include "AudioStream.h"
#include "output_dacs.h"
#include <Adafruit_Arcada.h>
#include <Adafruit_NeoPixel.h>
#include <Arduino.h>
#include <Audio.h>

Adafruit_Arcada arcada;

// pygamer specific
Adafruit_NeoPixel neopixels(5, 8, NEO_GRB);

/* there are only monophonic noises on this one so far :)
* but this will need updated for:
* - chords
* - panning
* - each instrument should perhaps have its own mixer?
AudioMixer4 q_mixer;
AudioMixer4 p_mixer;
AudioMixer4 s_mixer;
AudioMixer4 n_mixer;
*/
AudioMixer4 mixer;
AudioOutputAnalogStereo headphones;
AudioConnection left_ear_patch(mixer, 0, headphones, 0);
AudioConnection right_ear_patch(mixer, 0, headphones, 1);


Adafruit_FlashTransport_QSPI flashTransport;
Adafruit_SPIFlash flash(&flashTransport);
FatFileSystem fatfs;
FatFile root;
FatFile file;
Adafruit_USBD_MSC usb_msc;


void setup() {
arcada.arcadaBegin();
arcada.filesysBeginMSD();
arcada.displayBegin();
arcada.setBacklight(255);
arcada.drawBMP((char *)"icon.bmp", 0, 0);
neopixels.begin();
neopixels.setBrightness(180);
}

void loop() {
arcada.readButtons();
uint8_t buttons = arcada.justPressedButtons();
int16_t joyX = arcada.readJoystickX();
int16_t joyY = arcada.readJoystickY();
}
8 changes: 8 additions & 0 deletions bleepbloopmachine/main.cpp
@@ -0,0 +1,8 @@
#include "main.h"
#include "Arduino.h"

void setup() {
}

void loop() {
}
Empty file added bleepbloopmachine/main.h
Empty file.
7 changes: 7 additions & 0 deletions bleepbloopmachine/sketch.json
@@ -0,0 +1,7 @@
{
"cpu": {
"fqbn": "adafruit:samd:adafruit_pygamer_m4",
"name": "Adafruit PyGamer M4 Express (SAMD51)",
"port": "serial:///dev/ttyACM0"
}
}

0 comments on commit e4a36ad

Please sign in to comment.