Main Content

Results for

Hannah
Hannah
Last activity on 26 Mar 2024

Lots of students like me have a break from school this week or next! If y'all are looking for something interesting to do learn a bit about using hgtransform by making the transforming snake animation in MATLAB!
Code below!
⬇️⬇️⬇️
numblock=24;
v = [ -1 -1 -1 ; 1 -1 -1 ; -1 1 -1 ; -1 1 1 ; -1 -1 1 ; 1 -1 1 ];
f = [ 1 2 3 nan; 5 6 4 nan; 1 2 6 5; 1 5 4 3; 3 4 6 2 ];
clr = hsv(numblock);
shapes = [ 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 1 % box
0 0 .5 -.5 .5 0 1 0 -.5 .5 -.5 0 1 0 .5 -.5 .5 0 1 0 -.5 .5 -.5 0 % fluer
0 0 1 1 0 .5 -.5 1 .5 .5 -.5 -.5 1 .5 .5 -.5 -.5 1 .5 .5 -.5 -.5 1 .5 % bowl
0 .5 -.5 -.5 .5 -.5 .5 .5 -.5 .5 -.5 -.5 .5 -.5 .5 .5 -.5 .5 -.5 -.5 .5 -.5 .5 .5]; % ball
% Build the assembly
set(gcf,'color','black');
daspect(newplot,[1 1 1]);
xform=@(R)makehgtform('axisrotate',[0 1 0],R,'zrotate',pi/2,'yrotate',pi,'translate',[2 0 0]);
P=hgtransform('Parent',gca,'Matrix',makehgtform('xrotate',pi*.5,'zrotate',pi*-.8));
for i = 1:numblock
P = hgtransform('Parent',P,'Matrix',xform(shapes(end,i)*pi));
patch('Parent',P, 'Vertices', v, 'Faces', f, 'FaceColor',clr(i,:),'EdgeColor','none');
patch('Parent',P, 'Vertices', v*.75, 'Faces', f(end,:), 'FaceColor','none',...
'EdgeColor','w','LineWidth',2);
end
view([10 60]);
axis tight vis3d off
camlight
% Setup vectors for animation
h=findobj(gca,'type','hgtransform')'; h=h(2:end);
r=shapes(end,:)*pi;
steps=100;
% Animate between different shapes
for si = 1:size(shapes,1)
sh = shapes(si,:)*pi;
diff = (sh-r)/steps;
% Animate to a new shape
for s=1:steps
arrayfun(@(tx)set(h(tx),'Matrix',xform(r(tx)+diff(tx)*s)),1:numblock);
view([s*360/steps 20]); drawnow();
end
r=sh;
for s=1:steps; view([s*360/steps 20]); drawnow(); end % finish rotate
end
This Arduino ino sketch utilizes the new Arduino R4 with LED matrix. I use a thermistor to measure temperature and send it to the led MAtrix for local display and also to ThingSpeak for cloud display at public
  • Channel ID: 2300884
Note: I used Christopher's suggestion (elsewhere) to start with the Arduino R4 wifi example in the example folder of the Arduino IDE. That made all the difference in the world! Plus, I had serious issues with "write" data until I watched this YouTube video.
I have a development that requires 12 fields, but ThingSpeak only offers 8. Without further subscription, can I combine 2 Channels ?
I've read thru the API refernce doc and the information in the right-hand side panel on "API Keys" tab and so I 'm pretty sure the answer is "no" but throught it was worth double-checking.
My application for this is that I have several devices, each with their own channel. For security, I'd like them to be able to deduce or calculate the write API key to their channel based on their device serial number (which each device knows) so that I don't have to store the API key in their firmware.
thanks...
Hello everyone,
I am currently working on a project to simulate an autonomous energy production plant integrating renewable sources and a hydroelectric generator using MATLAB.
If anyone has experience in this area or can provide advice I would be extremely grateful. Thank you in advance for your precious help !
Hello, I am using an Arduino UNO R3 with an ESP8266 WiFi Shield to connect 2 DHT-11 sensors to upload their data to ThingSpeak. Sometimes ThingSpeak would only post data on a certain sensor for a bit and then upload to the other randomly. I want ThingSpeak to pick up the sensors within 30-40 seconds of each other consistently. I believe there might be something wrong with my code. I was hoping to get some help on it. Anything is appreciated.
Below is provided code
SoftwareSerial esp8266(RX,TX);
void setup() {
Serial.begin(9600);
esp8266.begin(38400);
sendCommand("AT",5,"OK");
sendCommand("AT+CWMODE=1",5,"OK");
sendCommand("AT+CWJAP=\""+ AP +"\",\""+ PASS +"\"",20,"OK");
}
void loop() {
String getData = "GET /update?api_key="+ API +"&field1="+getTemperatureValue()+"&field2="+getHumidityValue();
sendCommand("AT+CIPMUX=1",5,"OK");
sendCommand("AT+CIPSTART=0,\"TCP\",\""+ HOST +"\","+ PORT,15,"OK");
sendCommand("AT+CIPSEND=0," +String(getData.length()+4),4,">");
esp8266.println(getData);delay(6000);countTrueCommand++;
String getData2 = "GET /update?api_key="+ API +"&field3="+getTemperatureValue2()+"&field4="+getHumidityValue2();
sendCommand("AT+CIPMUX=1",5,"OK");
sendCommand("AT+CIPSTART=0,\"TCP\",\""+ HOST +"\","+ PORT,15,"OK");
sendCommand("AT+CIPSEND=0," +String(getData2.length()+4),4,">");
esp8266.println(getData2);delay(6000);countTrueCommand++;
sendCommand("AT+CIPCLOSE=0",5,"OK");
}
String getTemperatureValue(){
dhtObject.read(dht_apin);
Serial.print(" Temperature(C)= ");
int temp = dhtObject.temperature;
Serial.println(temp);
delay(50);
return String(temp);
}
String getHumidityValue(){
dhtObject.read(dht_apin);
Serial.print(" Humidity in %= ");
int humidity = dhtObject.humidity;
Serial.println(humidity);
delay(50);
return String(humidity);
}
String getTemperatureValue2(){
dhtObject2.read(dht_bpin);
Serial.print(" Temperature(C)= ");
int temp2 = dhtObject2.temperature;
Serial.println(temp2);
delay(50);
return String(temp2);
}
String getHumidityValue2(){
dhtObject2.read(dht_bpin);
Serial.print(" Humidity in %= ");
int humidity2 = dhtObject2.humidity;
Serial.println(humidity2);
delay(50);
return String(humidity2);
}
void sendCommand(String command, int maxTime, char readReplay[]) {
Serial.print(countTrueCommand);
Serial.print(". at command => ");
Serial.print(command);
Serial.print(" ");
while(countTimeCommand < (maxTime*1))
{
esp8266.println(command);//at+cipsend
if(esp8266.find(readReplay))//ok
{
found = true;
break;
}
countTimeCommand++;
}
if(found == true)
{
Serial.println("Pass");
countTrueCommand++;
countTimeCommand = 0;
}
if(found == false)
{
Serial.println("Fail");
countTrueCommand = 0;
countTimeCommand = 0;
}
found = false;
}
Sarati
Sarati
Last activity on 29 Feb 2024

Due to temporary problem MathWorks account was unable to login. Kindly resolve this issue.

KAVYA
KAVYA
Last activity on 29 Feb 2024

how to generate CA signed certificate for mqtt
I asked my question in the general forum and a few minutes later it was deleted. Perhaps this is a better place?
Rather than using my German regional forum (as I do not speak German), I want to ask questions in an international English-speaking forum. Presumably there should be an international English forum for everyone around the world, as English is the first or second language of everyone who has gone to school. Where is it?
When I embed Matlab windows into C#, I use C# to call the mouse functions such as drawline() and getpts() which are encapsulated in Matlab's dll, and then the program crashes, how can I solve this problem?
ps : The functions that I call in C# can be executed in Matlab.
ps : If I don't embed the window into C#, but just let C# call the Matlab function, it can execute the mouse control normally in the window, but once embedded into the C# window, it will crash when execute the mouse command.
I have a channel updating every 10 minutes. The last 8000 entries therefore go back to late December (around 55 days). I want to extend the range of data downloaded by setting a timescale between results, so say if I request a timescale of 20 minutes should I not be able to get data from twice as long ago? e.g.
https://api.thingspeak.com/channels/xxxxxx/fields/1.json?api_key=XXXXXXXXXXX&timescale=20&start=2022-12-30%2022:00:00
No matter what timescale or averaging I use, the last 8000 entries are the only ones processed for the downloaded data, so I just get fewer results. Unless I use a timescale of 1440; then I can download results from the very first entry in 2022. A timescale of 720 or lower however will only go back 55 days.
So I see the desired result when I use a timescale of 1440, but no other timescale will work. Is this a bug?
New to ThingsSpeak. I have a Photon 2 and vreated a webhook with simple code to send random numbers reprsented as 'temp' to a channel in ThingSpeak. All good with the code and my device shows the webhook is sending data and the events corespond to the same number of entries received in my channel. However, I do not see any visual graph of the data. What am i missing?
Hi Everyone. I am facing a problem while connecting the FMU to the buses. I have one FMU which expects 9 inputs and I did clarify the same while using bus creator. But in the end i am getting this error which i am trying to solve for couple of hours but didn't get any solution. So if any knows about the same please help me. I would give details as well if you need any other information.
Komal Memon
Komal Memon
Last activity on 15 Feb 2024

Hello Im tring to connect my master node to thingspeak but it gives error like:
Data received from slave - Temperature: 25.90, Humidity: 46.00, Soil Moisture: 0, pH: 4.26
Failed to send data to ThingSpeak, status code: -301
Data received from slave - Temperature: 25.90, Humidity: 46.00, Soil Moisture: 0, pH: 4.26
Failed to send data to ThingSpeak, status code: -301
What should I do?
Chen Lin
Chen Lin
Last activity on 14 Feb 2024

See code here in our community contest area. (author: @Zhaoxu Liu / slandarer)
And what do you do for Valentine's Day?
I need to copy Channel field data from a specific data range (e.g. January 2024) from field 6 of channel A(see sample attached) to field 1 of channel B.
I have tried to adopt the Template "Get data from private channel" in the Matlab analysis area of Thingspeak. The last data can be copied according the sample, but I cannot manage to copy the complete datarange. My channel field contains half empty data in field 6, because I have posted data asynchrously from 2 devices to 1 channel up to now.
Any advice for proper Matlab code sample or the like is welcome!
K
K
Last activity on 10 Feb 2024

which technical support should I contact/ask for the published Simscape example?
Is anyone having issues downloading the entire data from a channel? I usually include this line to the url but it no longer works: /feed.csv?days=1000000. Any suggestions on a way forward?
Hannah
Hannah
Last activity on 8 Feb 2024

I was looking into the possibility of making a spin-to-win prize wheel in MATLAB. I was looking around, and if someone has made one before they haven't shared. A labeled colored spinning wheel, that would slow down and stop (or I would take just stopping) at a random spot each time. I would love any tips or links to helpful resources!