How to read from ATmega328P with Raspberry Pi
-
I have compiled and flashed following program to the atmega328P (connected to a raspberry pi). This program reads a voltage on pin. A0
============================Begin program================================
const int analogInPin = A0;float sensorValue = 0;
void setup(){
Serial.begin(9600);
}void loop() {
sensorValue = analogRead(analogInPin);Serial.print(¨Voltage Output = "); Serial.print(sensorValue*5/1023); Serial.println(" "); delay(100);}
===============================End program================================I only use the command line in the raspberry pi. (no GUI)
When I've flashed the program I get the command prompt back.
Q: How do I read the values of the program in the atmega328p back in my raspberry pi? -
I have compiled and flashed following program to the atmega328P (connected to a raspberry pi). This program reads a voltage on pin. A0
============================Begin program================================
const int analogInPin = A0;float sensorValue = 0;
void setup(){
Serial.begin(9600);
}void loop() {
sensorValue = analogRead(analogInPin);Serial.print(¨Voltage Output = "); Serial.print(sensorValue*5/1023); Serial.println(" "); delay(100);}
===============================End program================================I only use the command line in the raspberry pi. (no GUI)
When I've flashed the program I get the command prompt back.
Q: How do I read the values of the program in the atmega328p back in my raspberry pi?are they connected via Serial TX/RX?
-
Connected via SPI (MOSI, MISO,.....etc)
Hello! It looks like you're interested in this conversation, but you don't have an account yet.
Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.
With your input, this post could be even better 💗
Register Login