Week10:Input devices

Previous weekAssciment listNext week

Trying to measure the light.

input

input

input


Second try: redesign the PCB

Programing the board

input
input

The demo video, demo code and original eagel pcb design file

#include<SoftwareSerial.h>

SoftwareSerial mySerial(0, 1);  // RX pin5, TX pin6

void setup() // setup all pins as OUTPUTS to drive current for
{
    mySerial.begin(9600);
    pinMode(A1, INPUT);
}

void loop()
{
    int sensorVal = analogRead(A1);
    
    int scaledValue = map(sensorVal, 0, 1023, 0, 255);

    mySerial.println(sensorVal);
    
    delay(200);

}

About meassignmentAbout Final Project

Creative Commons License
This work is licensed under a Creative Commons Attribution-ShareAlike 4.0 International License.