Arduino Flower | Lasha A
- Lasha Areshidze

- Mar 11, 2019
- 1 min read

Here is the code used.
#include <Servo.h>
int sensorPin = A0;
int servoPin = 9;
int sensorValue = 0;
int servoGrad = 90;
int tolerance = 40;
Servo myservo;
void setup() {
pinMode( sensorPin, INPUT);
myservo.attach( servoPin );
myservo.write( servoGrad );
}
void loop() {
sensorValue = analogRead(sensorPin);
if ( sensorValue < (512-tolerance) )
{
if (servoGrad < 180) servoGrad++;
}
if ( sensorValue > (512+tolerance) )
{
if (servoGrad > 0) servoGrad--;
}
myservo.write( servoGrad );
delay(100);
}









![[Arduino Compass] Craig, Christian, Jodi, and Nile in Collaboration with ECE Students](https://static.wixstatic.com/media/a27d24_5c1e57d2651248e6be3663dbc78b0b7a~mv2.png/v1/fill/w_852,h_669,al_c,q_90,enc_avif,quality_auto/a27d24_5c1e57d2651248e6be3663dbc78b0b7a~mv2.png)
![[Video Mapping] Christian Menendez](https://static.wixstatic.com/media/a27d24_35aca51570894c8f8c9071acda9a00e4~mv2.jpg/v1/fill/w_960,h_540,al_c,q_85,enc_avif,quality_auto/a27d24_35aca51570894c8f8c9071acda9a00e4~mv2.jpg)
Great job! kiss mark sunflower lol however, you missed the image, video, explanation and late upload. I only can give you 20 for this, but if you upload video and explanation and image to cover it up. I will add more points on this. good luck