sadsadsadsadsafasfsaasasd

Dependencies:   mbed MSGEQ7

Files at this revision

API Documentation at this revision

Comitter:
aldir99
Date:
Thu Mar 25 08:14:47 2021 +0000
Parent:
0:96716743b93d
Commit message:
a

Changed in this revision

MSGEQ7.lib Show annotated file Show diff for this revision Revisions of this file
main.cpp Show annotated file Show diff for this revision Revisions of this file
diff -r 96716743b93d -r ed4f480e9a18 MSGEQ7.lib
--- a/MSGEQ7.lib	Wed Oct 16 06:45:05 2013 +0000
+++ b/MSGEQ7.lib	Thu Mar 25 08:14:47 2021 +0000
@@ -1,1 +1,1 @@
-http://mbed.org/users/chrisisthefish/code/MSGEQ7/#974a4855a7f8
+https://os.mbed.com/users/chrisisthefish/code/MSGEQ7/#974a4855a7f8
diff -r 96716743b93d -r ed4f480e9a18 main.cpp
--- a/main.cpp	Wed Oct 16 06:45:05 2013 +0000
+++ b/main.cpp	Thu Mar 25 08:14:47 2021 +0000
@@ -1,23 +1,27 @@
-// MSGEQ7_Hello_World
-// Created by Chris Wilson
-// 10/16/2013
-
-
 #include "mbed.h"
 #include "MSGEQ7.h"
+#include <ros.h>
+#include "std_msgs/Int32MultiArray.h"
 
 #define MAX 500
 
 MSGEQ7 eq(p13, p14, p15); //reset, strobe, analog
 
+ros::NodeHandle  nh;
+
+std_msgs::Int32MultiArray str_msg;
+ros::Publisher chatter("chatter", &str_msg);
+
 int main() {
+    nh.initNode();
+    nh.advertise(chatter);
+    
     while(1) {
         eq.readInt(MAX); //Read in integer frequency data with max value set to 'MAX'
         
         //Print out frequency data
         for(int i = 0; i < 7; i++){
-            printf("%d\t", eq.freqDataInt[i]);
+            array.data.push_back(eq.freqDataInt[i]);
         }
-        printf("\n");
     }
 }