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(){

    void loop() {
    sensorValue = analogRead(analogInPin);

    Serial.print(¨Voltage Output = ");
    Serial.println(" ");

    ===============================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?

  • Contest Winner


    are they connected via Serial TX/RX?

  • Connected via SPI (MOSI, MISO,.....etc)

Log in to reply

Looks like your connection to MySensors Forum was lost, please wait while we try to reconnect.