01 machine learning Neural Networks

01 machine learning Neural Networks

Experiments with style transfer [2015]

Style transfer is the technique of recomposing images in the style of other images. These were mostly created using Justin Johnson’s code based on the paper by Gatys, Ecker, and Bethgedemonstrating a method for restyling images using convolutional neural networks. Instructions here, and more details here. A gallery with all of these and more style transfers can be viewed here.

 

http://genekogan.com/works/style-transfer/

 

 

 

World’s Tiniest Violin

Created by Design I/O, World’s Tiniest Violin is a ‘speed project’ that uses Google’s Project Soli – Alpha Dev Kit combined with the Wekinator machine learning tool and openFrameworks to detect small movements that look like someone playing a tiny violin and translate that to control the playback and volume of a violin solo.

The team used the Project Soli openFrameworks example provided with the ofxSoli addon and searched for the signal that seemed to correlate closest with the tiny violin gesture. In this case it was the fine displacement signal, which then they fed the delta of to Wekinator via OSC. Theo (Design I/O) then had to train Wekinator on what types of finger movements corresponded to playing the violin and which ones it should reject. So he recorded a few different finger movements and assigned the value of 1.0 on the slider. The slider to 0.0 and recorded gestures were then set which didn’t correspond: like pulling your hand away from the sensor, or just holding it there without moving your fingers. After a few minutes of recording these gestures, the ‘training’ was initiated and they were then able to send back an animated value ranging from 0.0 to 1.0 representing how much Theo’s hand looked like it was trying to play a tiny violin. The last step was to map that number to the volume of the violin sample that was being played back by the openFrameworks app.

https://hackaday.com/2016/06/15/worlds-tiniest-violin-using-radar-and-machine-learning/

 

Computed Curation

Curating photography with neural networks

Created by Philipp Schmitt (with Margot Fabre), ‘Computed Curation’ is a photobook created by a computer. Taking the human editor out of the loop, it uses machine learning and computer vision tools to curate a series of photos from an archive of pictures.

https://philippschmitt.com/projects/computed-curation

 

 

 

https://www.youtube.com/watch?v=KkwX7FkLfug

 

 

06. Appraisal of a an Art .app with ANT

Theory Background

 

The walkthrough method is grounded in the principles of Actor-Network Theory (ANT), as a specific aspect of STS (science and technology studies). ANT foregrounds a relational ontology according to which sociocultural and technical processes are mutually shaping.

The core of this method involves the step-by-step observation and documentation of an app’s screens, features and flows of activity – slowing down the mundane actions and interactions that form part of normal app use in order to make them salient and therefore available for critical analysis. The researcher registers and logs into the app, mimics everyday use where possible and dis- continues or logs out while attending to technical aspects, such as the placement or num- ber of icons, as well as symbolic elements, like pictures and text.

Chosen Review

The app being reviewed here is from the art website ArtRabbit.
https://www.artrabbit.com

Statements from the Provider

Turning Art on its head
ArtRabbit is a global digital platform and mobile app for the promotion, discovery and appreciation of contemporary art.

It’s a unique guide to the contemporary art scene, connecting thousands of art spaces, exhibitions and events to artists, art professionals, collectors, students and art-interested people alike.

 

.app Screens

 

 

 

 

Branding

Bond worked with the team at ArtRabbit to establish a new logo and brand language – creating a bold and simple logotype with the distinctive graphic rabbit head ‘R’ – turning Art on its head!

https://bond-agency.com/project/artrabbit/

A brand-driven creative agency

 

 

Basic Usage
The Website is an online social networking facility and database of art exhibitions, conferences, performances, screening and other events and galleries from across the world. You can access the Website either as a visitor  or by registering with the Website and becoming a member and/or a venue owner  (hereafter collectively referred to as “Users”). As a Member and/or Venue Owner, you can create your own profile for the purpose of using the Services and the Website, which is made available to other Users .

What you can do as a basic user

  1. See the ArtRabbit to Find up-to-date information on contemporary art exhibitions and events, large and small, current and upcoming.
  2. Explore ArtRabbit’s interactive map of events, near you and around the world
    Search listings for exhibitions, venues, artists and event types
  3.  Get recommendations from leading artists, curators and art world insiders
  4. Follow your favourite artists, project spaces and galleries to have their upcoming shows sent directly to your email inbox
  5. Plan ahead – compile lists of exhibitions you’d like to attend and track what you’ve already seen
  6. Get directions to exhibitions close to where you are
  7. Share events with your friends and network, via email and other social channels
  8. Get a handy overview of what shows are all about
  9. Travel with the art crowd – ArtRabbit keeps tabs with the busiest cities at any time, so you’ll know what’s happening around the world

For the artist

Make the most of your artist page
Your artist page is a free spot of advertising for you and your practice. Add a description about yourself, your medium and achievements, as well as links to your portfolio and social media accounts. The popularity of events and people on ArtRabbit is driven by clicks, so make sure you keep your artist page and event listings up-to-date.

Get listed!
Not listed yet? Then join ArtRabbit and get listed now. Artist pages are created when events are added to ArtRabbit, so next time you feature in an exhibition or contemporary art event, pop it on the site. Make sure you add yourself as an artist when prompted, then claim your artist page and show the contemporary art world what you do!

Follow your favourite project spaces and galleries, curators and artists, save events you’re interested in, and ArtRabbit does the rest. We’ll let you know what’s coming up from places and people you follow, and tell you about other events we think you’ll like. You never need to miss another exhibition, preview, performance or launch event.

 

TERMS AND CONDITIONS

Information that you provide by filling in forms on our site www.artrabbit.com (Website). This includes information provided at the time of registering to use our Website (which may be directly through the Website, or through third party service providers, and in the case of the latter, we will obtain the personal data you have provided to the third party service provider), purchasing an item, posting material or requesting further information or services. We may also ask you for information when you report a problem with our Website.
If you contact us, we may keep a record of that correspondence. We may also ask you to complete surveys that we use for research purposes, although you do not have to respond to them.

Details of your visit to the Website, including products viewed or searched for, page response times, lengths of visit, transactions you carry out through our Website and of the fulfilment of orders

We may disclose your personal information to any member of our group, which means our subsidiaries, our ultimate holding company and its subsidiaries, as defined in section 1159 of the UK Companies Act 2006 (where applicable).

 

The user Contract

You shall not submit to appear on the Website through your use of the Services, any information, comments, images, third party URL links or other material whatsoever in any format (“User Submissions”), whether on your Profile or elsewhere on the Website, that may reasonably be deemed to be offensive, illegal, inappropriate or that in any way:

  1. promote racism, bigotry, hatred or physical harm of any kind against any group or individual;
  2. harass or advocate harassment of another person;
  3. display pornographic or sexually explicit material;
  4. promote any conduct that is abusive, threatening, obscene, defamatory or libellous;
  5. promote any illegal activities;
  6. provide instructional information about illegal activities, including violating someone else’s privacy or providing or creating computer viruses
  7. promote or contain information that you know or believe to be inaccurate, false or misleading;
  8. engage in or promote commercial activities and/or sales, including but not limited to contests, sweepstakes, barter, advertising and pyramid schemes, without our prior written consent;
  9. or infringe any rights of any third party.

Notwithstanding the foregoing, we reserve the right to:
accept or reject your application to register for any reason; and
refuse you access to the Services and/or Website (partly or wholly) if you breach any of the provisions hereunder.
Unless otherwise expressly set out to the contrary herein, your Contract with us shall remain in force:

 

Revenue

 

Advertise on ArtRabbit
In addition to our free event listing service, ArtRabbit offers access to its audience via integrated banner advertising on the site, in the weekly newsletter and across our social media channels. Spaces can be bought separately or as a package.

Audience
ArtRabbit’s engaged audience is made up of curators, artists, arts professionals and enthusiasts. Our rich, diverse database represents over 6000 art organisations and venues in over 60 countries who have hosted more than 60k contemporary art events, and listed over 13k artists and 1k curators to date.

ArtRabbit is used by leading art museums, galleries, art organisations, art fairs, biennials, foundations and project spaces. Our growing user-base in Europe, North America and Asia consists of 40% art professionals and 60% art lovers: an international, socially- and creatively-engaged audience, with many working in the cultural and creative industries.

 

It encourages the interaction and advertising  to all users for art events and forums and exhibitions. The basic reward for this is a self-promotion page for yourself.

 

Promote themselves as a modern social media website

 

ArtRabbit has a strong presence on all social media websites: Web platform, Smart phone iPhone and android, TWITTER, Facebook,Instagram

 

 

ANT Review

The revenues for the site relies mostly on advertising for events and exhibitions from professional galleries and art organizations. The promotion of individual artist to the site helps sell the advertising so that the target audience are mostly  either art lovers or art professionals. The main target of advertising for art organizations.

The gender bias aims to be neutral. In my opinion the design seems 60-40 % feminine-masculine design. I would guess they have decided upon a gender neutral tone for the site.

The design and fonts are modern, clean and hip.  The typography has been purposely constructed to feel gender neutral. It has a strong yet simple and clean layout. The feeling of space and whiteness is a modern design aesthetic

The Branding. Is so graphic design led clean and simple and easily to identify and remember the brand. I would say brand awareness is high. You will remember the logo and design aesthetic.

Going through the usage is of the .app is very easy u only have access to : openings , exhibition and events. All of the events in your area are shown on a mobile map.
You can explore the pin-points by clicking on each of them and going into detail on whats on offer. You will receive a brief summary of whats on offer and a link to the website for more information. U have 2 icons for to save favorites (a star) and to book mark ( an eye).

The use of icons. If you add a star to to something the site will remember this and send u details of all related starred events. It will remind u of the event as the event nears. An Eye events mean u have seen this event and it invites u to add a review of the event for the site. Social media icon U can instantly share events on social media. Map icon shows u where the event is on a google style map and gives u a route to the vent from where u are.

Overall opinion.  I would say this is a artists site primarily. You have the opportunity to advertise you own exhibitions and promote them. People can follow you. U can link instagram and websites into the app so u get further promotion. Linked closely to this are the professional galleries that want close associations with artists and also curators.

 

 

Posted in art

04. Swarm art Computing Appraisal

 

From its commercial games/film humble beginnings with craig Reynolds paper Flocks, Herds, and Schools: A Distributed Behavioral Model (http://www.cs.toronto.edu/~dt/siggraph97-course/cwr87/) the ideas of using swarm algorithms in art are growing and varied in there output. From the artwork of 2001 Leonel Moura who produced Swarm Paintings with a ant algorithm to the beautiful installation Diffusion Choir,(https://vimeo.com/187037469) the movements of the sculpture are perpetually evolving, driven by the flocking simulation.

The idea of emergence deriving from flocking algorithms is inherent in the algorithms developed for Stochastic diffusion search (J.M Bishop) 1989 and 1992 Ant colony optimization (Marco Dorigo). In art it was first seen in the artwork of 2001 Leonel Moura who produced Swarm Paintings with an ant algorithm. http://www.leonelmoura.com/index.php/robot-art/swarm-paintings/

In his book, Emergence: The Connected Lives of Ants, Cities and Software, Steven Johnson presents Emergence as an alternative way of understanding complex systems. A hierarchical, top-down system attempts to use a centralized decision-making process based on abstract rules to guide behavior. The emergent position looks at complex systems differently: a small number of rules that are processed by individual units are the best method of explaining the aggregate behavior. While a statistical analysis of an emergent system will lead to abstract outcomes. This system has an inherent relationship with Swarm intelligence (SI) that the collective behavior of decentralized, self-organized systems, natural or artificial.  A population of simple agents or boids interacting locally with one another and with their environment (The expression was introduced by Gerardo Beni and Jing).

If we look at the swarm art sister of cellular automata with swarm art (http://ieeexplore.ieee.org/document/7361206/) its a topic that Andy Lomas uses in his artworks which he calls Morphogenetic Creations. (https://www.youtube.com/watch?v=k7u2CVXzs2c). There are simularities with this work and Neri Oxman https://www.youtube.com/watch?v=CVa_IZVzUoc. Both use a mixture of cellular automata with swarm art algorithms.

Swarm art in architecture. The paper of swarm modeling by Carranza, Pablo Miranda and Paul Coates (https://www.generativeart.com/on/cic/2000/CARRANZA_COATES.HTM.) , Paul chooses swarms as a study case is the fascination of the simplicity of its mechanics and its complexity as a phenomenon. It describes the swarms understanding them as examples of sensori-motor intelligence. Another architect Arne Quinze uses curves, lines, colours and movement in his pieces. his woodstick structures provide a feeling of movement and fluidity, that combine to create a large frame structure. (https://www.dezeen.com/2008/12/09/the-sequence-by-arne-quinze/)

When we look at swarm interactive art that utilizes a proximity sensor such as the kinect the observer becomes a conductor of the art form and becomes far more immersed in the work. More connected to the work and more responsive. Great examples of this work are Daniel Rozin, “Penguins Mirror,” 2015 (https://vimeo.com/129674054) and the swarm wall by Michael Theodore (https://vimeo.com/45073818).

The psychology of swarm interactive art is an inherent behaviour of human urbanization. We like living in close proximity. We enjoy the human swarms at football matches as well as the group human interactions of dance and team events. Swarming behavior is part of our psychology as Dr Ian Couzin has been researching.(http://www.nytimes.com/2007/11/13/science/13traff.html).

The future of swarm art lies in more immersive experiences. Either in the real word or the virtual world. The idea of mobile interactive swarms in the real world will be the closest we can experience the true wonders of swarm art. The development process of 3d swarm art computing is very much tied to technology and how and what we can physically do. At the moment we don’t have any technology that can integrate into a entire swarm. We do have air drones and they have been used in previous installations the Faena Studio Drift 300 Drone Swarm: https://www.youtube.com/watch?v=mGmtId_ePmc but as yet they haven’t been used to this extent inside a installation venue. When air drones can be made to be insect size and can fly for greater times proper inside swarms will emerge.

Class 06- Lab Christmas project Idea 03

IDEA:
 

Interactive Stain Glass Sculpture
Making a 1ft 6 piece square pyramid sculpture connected by copper wire. Each pyramid has a LED inside it which will be activated using a sonar distance sensor. 

As the hand moves up and down the sculpture the LEDS mirror the rough position of the hand and switch on and off as the hand passes.

Materials: 

  1. Paper mockup build and connect
  2. 2amp 9 volt power supply for ardunino or arduino uno.
  3. stain glass and copper foil and solder and solder wire
  4. support copper wire & conducting wire leds
  5. switch to turn on and off
  6. sonar distance detector.
  7. wooden housing box
  8. possible audio shield
  9. shifter register
  10. LED 8MM PL9823 RGB integrated controller
  11. Solder. Glass and copper foil and flux and cutters.

Further development: add sound to be triggered in the same way

Mockup and circuit diagram:

Print

 
Interactive Glass Sculpture
 
 
VIDEO OF CIRCUIT:
SCULPTURE WITH LIGHTS AND SOUND
 
CIRCUIT DIAGRAMS:
 
ch_SCULPTUREARDINO1 ch_SCULPTUREARDINO2
 

 Acrylic surfaces retextured with iridescent film:

new_texture

 
Solid state circuit built and complete and tested with mig-welded stand;
 
 
 
Prototype finished test:
 
 
 

Class 05- Soldering Assignment

Soldering assignment :   Solder on to a proto-board a previous sketch from the Arduino kit. 02: Space interface

Sketch:  (click on image to enlarge)

week 05-soldering-fritzing-2

Circuit Soldered

Soldered board: (click on image to enlarge)

Soldered Board

Soldered Board

 

 

 

 

Class 05- Lab assignments 13 14

Lab assignment 13:  CapacitiveSensor . Using the  body
The wires and the foil make a live capacitor as the body approaches the foil the capitance changes.
Key terms:
// import the library (must be located in the Arduino/libraries directory)
#include <CapacitiveSensor.h>

// create an instance of the library
// pin 4 sends electrical energy
// pin 2 senses senses a change
CapacitiveSensor capSensor = CapacitiveSensor(4, 2);

// open a serial connection
Serial.begin(9600);
// set the LED pin as an output
pinMode(ledPin, OUTPUT);
}

void loop() {
// store the value reported by the sensor in a variable
long sensorValue = capSensor.capacitiveSensor(30);

 

 

Lab assignment 14:  Set Serial communication between Arduinio+Processing
Use the values from a potentiometer and pass them directly to processing to control the color of a sketch
Key terms:

// initialize serial communication
Serial.begin(9600);
}

void loop() {
// read the value of A0, divide by 4 and send it as a byte over the
// serial connection
//Serial.print(“POTENTIOMETER =”);
// Serial.println(analogRead(0) / 4.0);
Serial.write(analogRead(0) / 4.0);
delay(5);

PROCESSING:

// import the serial library
import processing.serial.*;

// create an instance of the serial library
Serial myPort;

// create an instance of PImage
PImage logo;

// load the Arduino logo into the PImage instance
logo = loadImage(“http://www.arduino.cc/arduino_logo.png”);

// print a list of available serial ports to the Processing status window

println(“Available serial ports:”);
println(Serial.list());

// Tell the serial object the information it needs to communicate with the
// Arduino. Change Serial.list()[0] to the correct port corresponding to
// your Arduino board. The last parameter (e.g. 9600) is the speed of the
// communication. It has to correspond to the value passed to
// Serial.begin() in your Arduino sketch.
myPort = new Serial(this, Serial.list()[0], 9600);

 

00 : A Diary. Swarms and Computational Art

Week 01 30 oct- 03 Nov
Met up with the group and spent 2 afternoons researching information on slides for Swarms and Computational Art. We looked over our strategy for slides and decided upon our 3 slides categories: The history of swarms, The world of digital computational swarms and Physical swarms.

The slides we produced are here:

01_digital_swarm_example-0102_digital_swarm_example-0103 digital_swarm_example-01

We also had an opportunity to see a computational Swarm expert Tim Blakewell a lecturer at Goldsmiths. We talked about his work and his use of different algorithms. There was some great work on swarming and uses of different algorithms and how they can used across different areas of study. One example of physical swarms he mentioned was on ants and on there use of following there trails. He also mentioned to get in touch with his colleague Dr Mohammad Majid al-Rifaie. Which we have and he agreed to meet with us and further discuss his work.

 

Week 06 Nov- 10 Nov
We met up to discuss the slide content and our title of research.
We decided upon:
Notes on thoughts for possible slide order (obv dependent on question):
1 – Introduction to what we are looking at and why
2 – History – art/film – Boids
3 – History – science (Vicsek? Other?)
4 – Early swarm art (90s? More film related or music? Ask Mohammad)
5 – How does the algorithm work
6 – Physical art – hive (science and art)
7 – Leonel Moura – ant painting (science and art)
8 – SwarmPainter (coding art)
9 – al-Rifaie work (science and art)
10 – imaginative possibilities – include slime
11 – Where is swarm art going – conclusion and our work
12 – Where is swarm art going – conclusion and our work

Our title of research:
What is the future of swarm art computing?
An examination of the application of swarm algorithms in science and art

We also interviewed Tim Blackwell (researcher and teacher at Goldsmiths) specializing in swarms. As well as arranging to meet up with lior ben gai and Mohammad Majid Al-Rifaie.

 

 

Week 13 Nov- 17 Nov
We further revised our plan into dates of deliverables.

OUR QUESTION:

1.What is the future of swarm (+art) computing?
An examination of the application of swarm algorithms in science and art.

 

Slide plan and key dates:

1. Introduction to what we are looking at and why 
ACTION: Colin to do math, Laura will do philosophy 
Due: 24 November

2. History – Boids
ACTION: Petros will compile the images and films
Due: 21 November

3. History – science (Vicsek? Other?)
ACTION: Colin
Due: 24 November

4. Early swarm art
ACTION: Laura
Due: 20 November

5. How does the algorithm work
ACTION: Colin will do it and show it to Tim 16 November
Due: 29 November

6. Physical art – hive (science and art)
ACTION: Petros
Due: 21 November

7. – Leonel Moura – ant painting (science and art)
ACTION: Laura
Due: 20 November

8. SwarmPainter (coding art)
ACTION: Laura will compile
Due: 20 November

9. Swarms in society
ACTION: Laura 
Due: 20 November

10. al-Rifaie work (science and art)
ACTION: Petros
Due: 23 November

11. Imaginative possibilities
ACTION: All of us, Petros to look at grabbing images, Colin to set up a new slack channel
Due: 27 November

12 a) and b) Where is swarm art going – conclusion and our work
ACTION: All of this…
Due: 16 November Colin to speak to Tim

Timeline:

We decided on our artifacts:

1. Trying to control swarms with kinect.
I started to play with the basic swarm mechanism following a mouse and then grabbed a kinect and started to look at the control of the swarms with a kinect. This procedure is on going.

Screen Shot 2017-11-19 at 20.45.53 Screen Shot 2017-11-19 at 20.45.43 Screen Shot 2017-11-19 at 20.45.31 
IMG_7091

2. Laura producing a artwork drawing influenced by swarm theory.
http://www.lauratraver.com

3. Petros looking at creating swarms using video cams of people.

 

Week 20 Nov- 26 Nov

Re-interveiwed Tim Blackwell (researcher and teacher at Goldsmiths) specializing in swarms. Working on 1 of our artifacts interviews with lior ben gai and Mohammad Majid Al-Rifaie. A video piece.

Working on our slides for the presentation.

Working on our swarm algorithm generative artifact. The swarm algorithm has been combined with kinect to make a interactive swarm.

SWARM ALGORITHM DEVELOPMENT

01   TRACKING KINECT INFER RED DATA

 

02   INTRODUCING A BASIC PARTICLE SYSTEM

 

03   COMBINING A BOIDS SWARM WITH KINECT

 

 

 

 

Posted in art

Class 04- Lab assignments 10 11 12


Lab assignment 10:
   H-Bridge integrated circuit. Reverse Motor
An H-bridge has up to 4 inputs and outputs with 2 separate power supplies. A potentiometer is used to control the power supply Arduino will send 2 seperate highs and lows change the motor direction.
Key terms:
// if the on/off button changed state since the last loop()
if (onOffSwitchState != previousOnOffSwitchState) {
// change the value of motorEnabled if pressed
if (onOffSwitchState == HIGH) {
motorEnabled = !motorEnabled

// if the motor is supposed to be on
if (motorEnabled == 1) {
// PWM the enable pin to vary the speed
analogWrite(enablePin, motorSpeed);
} else { // if the motor is not supposed to be on
//turn the motor off
analogWrite(enablePin, 0);

 

Lab assignment 11:   LCD Display with messages
Use a tilt switch randomly select 8 messages to be displayed on a lcd screen. Use the potentiometer to control the screen brightness. 
Key terms:
// include the library code:
#include <LiquidCrystal.h>
// initialize the library with the numbers of the interface pins
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
// set up the number of columns and rows on the LCD
lcd.begin(16, 2);
// line 1 is the second row, since counting begins with 0
lcd.setCursor(0, 1);
// print to the second line
lcd.print(“Crystal Ball!”);

 

 

Lab assignment 12: Use a Piezo as a sound in input
Use a piezo as a sound input and monitor the sound values between different inputs to signal a LED output and control a servo motor which acts as a visual signal.
Key terms:
// import the library
#include <Servo.h>
// create an instance of the Servo library
Servo myServo;
// attach the servo to pin 9
myServo.attach(9);
// this function checks to see if a detected knock is within max and min range
boolean checkForKnock(int value) {
if (value > quietKnock && value < loudKnock) {
return true;
// check the value of the piezo
knockVal = analogRead(piezo);

 

Class 03- Lab assignments 06 07 08 09

Lab assignment 06:   Use a Piezo as a Theremin
Use a photoresistor to calibrate a Piezo that changes the frequency.
The calibration process takes place with while loop (millis() < 5000). The key point in calibration is the high and low points are initially reversed. sensorValue <1023 (LOW)
sensorValue > 0 (HIGH)
Key terms:
while (millis() < 5000) {
sensorValue = analogRead(A0);
// remap sensr 0-1023 to freq 50,4000
int pitch = map (sensorValue,sensorLow,sensorHigh,500,4000);
  tone(8,freq[i],30);

 

 

Lab assignment 07:   Use a Piezo as a Keyboard
Using a resistor ladder. Take reading from 5 resistors in series the voltage drops across each resistor giving a different output. The values are converted to frequencies for the piezo.

Key terms:
int notes[] = {262,294,330,349};
int keyVal = analogRead(A0); (0-1023)
 tone(8,notes[1]);
(keyVal >= 990 && keyVal <=1010) 



 

Lab assignment 08:   Digital Hourglass +tilt switch
Using a millis() function to read the time in milliseconds count the interval time and then set on a LED for that time period. Then use the tilt switch to reset all the LED’s.

Key terms:
unsigned long previousTime = 0;
long interval = 1000;
//read switchpin 8
switchState = digitalRead(switchPin);(either 1 or 0)
prevSwitchState=switchState;

 

 

Lab assignment 09:  Motor switch using a transistor gate and switch
Press a button to send a signal to arduino that resends a high to the transistor gate. That activates the motor. Use a diode in parallel with the motor to counteract reverse induced voltage.

Key terms:
 pinMode(motorPin, OUTPUT);

switchState = digitalRead(switchPin);

if (switchState == HIGH) {

digitalWrite(motorPin,HIGH);
} else {

digitalWrite(motorPin,LOW);
}