rhoadley.net   music   research   software   blogs

aru    seminars    m&t    critski    focm1a    cmc    circuit bending    mic2b    sensor technology    comp 3    sonic art    major project
youtube    vimeo    facebook


Resources:    Bioacoustics    Jitter    MaxMSP    OSC    Physical    PD       CBHH    sTech    SuperCollider    C/Xcode

sTech Resources:     Home     Blog     Forum     Examples     Projects     Tasks     Tutorials


Sensor Technology Tasks

Writing to the Arduino

Task 8 Name: Triggering and modulating events Set: w5i Due: Monday 19th December 2016 Weighting: assessable (10%) Courses: stech
Prev Task: Investigating sensors - Make your own sensor - Make your own arduino Next Task: Advanced sensors
Task Summary All sTech tasks

Writing to the Arduino

A brief tutorial concerning writing to the arduino.

Resources

Save the following files as...

Code


int ledPina = 11;
int ledPinb = 10;
int ledPinc = 9;


int vala;
int valb;
int valc;

int nextval = 1;

void setup()
{
  // begin the serial communication
  Serial.begin(115200);

  pinMode(ledPina, OUTPUT);
  pinMode(ledPinb, OUTPUT);
  pinMode(ledPinc, OUTPUT);
}

void loop()
{
  
  if (Serial.available()) {
    if(nextval == 1) {
    
    vala = Serial.read();
    analogWrite(ledPina, vala);
    nextval = 2;
                     } 
                          }
             if (Serial.available()) {
    if(nextval == 2) {
    
    valb = Serial.read();
    analogWrite(ledPinb, valb);
    nextval = 3;
                     } 
                          }
             if (Serial.available()) {
    if(nextval == 3) {
    
    valc = Serial.read();
    analogWrite(ledPinc, valc);
    nextval = 1;
                     } 
                          }     
}

To Cover

  • This is to cover

Ramifications

  • Using many more than the normal range of inputs and outputs from the Arduino, but not without some cost to responsiveness under some circumstances.




to top of page The Task

  • This is not a task.

  • Clearly, I don't want you to submit your Arduinos. That means you need to submit some documentary evidence that you've completed your task. The most obvious way to do this is to submit some sort of video of your task working, as well as of the code running. If you can't do this, take photos.

  • Bear in mind that you'll get extra marks for added value, so try to adapt and make more interesting your files. Simply repeating what we've already done will get minimal marks. So try each patch out in various ways. For instance, even if the task just involves a blinking LED, try using patterns of colours and/or timings.

  • Zip or Stuff your patches, demos, photos, videos etc. into one file called your_student_number_"multiplex" (e.g. 0504335_multiplex.zip), include a readme with your name and student number and, if necessary, how to use or just open the patch, and submit the whole thing here.

You might also be interested in:


The Projects