Outcome
- Practice exercise for learning to use button and potentiometer
- A simple device for the table: DND and okay to disturb signal using flex sensor, Switch and LED.
int flexPin = A0;
int flexReading = 0;
int ledPin = D2;
int ledBrightness = 0;
void setup() {
pinMode(ledPin, OUTPUT);
Particle.variable("snoopy", flexReading );
}
void loop() {
flexReading = analogRead(flexPin);
ledBrightness = map(flexReading, 0, 4095, 0, 255);
analogWrite(ledPin, ledBrightness);
delay(100);
}
Exercise 2: Using Flex Sensor to indicate availability
Use Scenario
When I'm working on my desk in the studio, I often get disturbed by peers wanting to chat or ask a question. This sometimes breaks my flow of work and I would really appreciate a subtle way of communicating when is it okay for someone to disturb me and when it's an absolute DND. Therefore, I hope to design a phone holder that gives out warnings when I pick up the phone.
Input:
- Switch: turn the light system on/off
- Flex Sensor (FSR): sense the bend
Output:
- Switch: turn the light system on/off
- (when the flex sensor is bent halfway): low brightness of LED
- (when the flex sensor is all the way): high brightness of LED
You can upload files of up to 20MB using this form.