#include //TX , PA0 , could be A0, 0 , 10 //RX , PA1 , could be A1 , 1 , 9 const int mosfet = 7; // connected to PA7 or 7 in arduino const int phototransistor = A3 ; // connected to PA3 , A3 in arduino int photovalue = 0; int timing = 50; SoftwareSerial mySerial(0, A1); // RX, TX void setup() { mySerial.begin(9600); pinMode(mosfet, OUTPUT); pinMode(phototransistor, INPUT); } void loop() { photovalue = analogRead(phototransistor); mySerial.println(photovalue); delay(timing); }